Hi
i found below code on MSDN, please help how to use this. or very helpful if i get any other alternate.. thanks
//A namespace defined for SDK sample code //You should define a unique namespace for your libraries var Sdk = window.Sdk || { __namespace: true }; (function () { //A global variable to store information about enabled business processes after they are retrieved asynchronously this.enabledProcesses = []; // A function to log messages while debugging only this.writeToConsole = function (message) { if (typeof console != 'undefined') { console.log(message); } }; //Code to run in the OnLoad event this.formOnLoad = function () { //Retrieve Enabled processes Xrm.Page.data.process.getEnabledProcesses(function (processes) { //Move processes to the global Sdk.enabledProcesses array; for (var processId in processes) { Sdk.enabledProcesses.push({ id: processId, name: processes[processId] }) } Sdk.writeToConsole("Enabled business processes flows retrieved and added to Sdk.enabledProcesses array."); //Write the values of the Sdk.enabledProcesses array to the console if (Sdk.enabledProcesses.length < 0) { Sdk.writeToConsole("There are no enabled business process flows for this entity."); } else { Sdk.writeToConsole("These are the enabled business process flows for this entity:"); for (var i = 0; i < Sdk.enabledProcesses.length; i++) { var enabledProcess = Sdk.enabledProcesses[i]; Sdk.writeToConsole("id: " + enabledProcess.id + " name: " + enabledProcess.name) } } //Any code that depends on the Sdk.enabledProcesses array needs to be initiated here }); }; }).call(Sdk);
*This post is locked for comments
i want to change the process dynamically through javascript based on some field change
What is your requirement? Are you trying to activate business process? refer this article
https://www.powerobjects.com/2015/10/13/business-process-flows-and-javascript/
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156