-
-
Save sergeytunnik/59476d80c0786e71522565ed65b554ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export namespace TimelineWallControl { | |
export type Command = "Assign" | "Delete" | "Close Activity" | "Add to Queue" | "Open Entity Record"; | |
export function HideCommand(commandName: Command): void { | |
const timer = setInterval(() => { | |
try { | |
const parent = window.parent as any; | |
const activityCommands = parent.MscrmControls.TimelineWallControl.Utility.CommandFactory.ActivityCommands as Record<Command, any>; | |
if (activityCommands === undefined) { | |
throw new Error("ActivityCommands is undefined"); | |
} | |
activityCommands[commandName] = {}; | |
const timeline = Xrm.Page.getControl("Timeline"); | |
timeline.refresh(); | |
console.log("Clearing interval."); | |
clearInterval(timer); | |
} catch (err) { | |
console.log(`Error: ${err.message}.`); | |
} | |
}, 500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment