Skip to content

Instantly share code, notes, and snippets.

@sergeytunnik
Created November 5, 2019 20:17
Show Gist options
  • Select an option

  • Save sergeytunnik/59476d80c0786e71522565ed65b554ec to your computer and use it in GitHub Desktop.

Select an option

Save sergeytunnik/59476d80c0786e71522565ed65b554ec to your computer and use it in GitHub Desktop.
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);
}
}
@xl3ehindTim

Copy link
Copy Markdown

Hey @sergeytunnik! This looks amazing, but I am wondering if it is possible to add a wall control button to the notes form in the timeline? Some guidance would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment