Hiding Activities Tab from Social Pane(Notes) in CRM form

The article shows you how to hide the activities tab in the Social Pane(Notes) on entity form as shown below :

2014-07-30_1358

Social Pane

Use the below javascript file to attach it to the page load of the form :


onLoad: function () { 

var ctrlElement = document.getElementById("header_notescontrol");

if (ctrlElement.children != null && ctrlElement.children.length > 0) {

for (var ele = 0; ele < ctrlElement.children.length; ele++) {

var ctrl = ctrlElement.children[ele];

if (ctrl.title == "ACTIVITIES") {

 ctrl.style.display = "none";

if (ele + 1 < ctrlElement.children.length) {

ctrlElement.children[ele + 1].click();

return;

}

else if ((ele - 1) >= 0) {

ctrlElement.children[ele - 1].click();

return;

}

}

}

}

}

Hope this helps!

[Resolved] Error Activating Workflow after publishing in a different organization

I faced an issue today with activating a published workflow.

I opened the workflow and got the error marks in each of the steps after importing the workflow solution to the test environment.

Resolution :

  1. Open the workflow after publishing
  2. Reset all the values in the lookup/optionset.
  3. Save & Close.

The error basically occurs when there is mismatch in the GUID .

Thanks!

 

 

Disable AutoSave : For a specific CRM entity form

Simply use the below javascript to the OnSave event of the entity and check the “Pass execution context as first parameter” box in the Handler Properties to disable the auto-save property of the entity form.

function DisableAutoSave(context) {
var saveEvent = context.getEventArgs();
if (saveEvent.getSaveMode() == 70) { //Form AutoSave Event
saveEvent.preventDefault(); //Stops the Save Event

}

Happy Coding 🙂