Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

CRM 2011 call a workflow or dialog process from a custom button on the ribbon

$
0
0

I have a custom workflow created to resolve a case w/out a popup and a dialog created to cancel a contract with specific termination questions. I would like to call these processes from custom buttons on the ribbon. Any assistance in both setting up the javascript to call the process and the specific settings necessary for the button to call the javascript would be appreciated.

The button calls the workflow however I get the error: Record Is Unavailable - The requested record was not found or you do not have sufficient permissions to view it.

Javascript to call the workflow

function callCloseContractDialog()
var a = new Array(crmFormSubmit.crmFormSubmitId.value);
var sIds = Xrm.Page.data.entity.getId()+";";
var sEntityTypeCode = "1010"; //Replace this with your entity type code
var sWorkflowId = "{073B4F2B-5DFC-407F-BADD-16521FB3E181}"; //Replace this with your actual workflow ID
var iWindowPosX = 500; //Modal dialog position X
var iWindowPosY = 200; //Modal dialog position Y

var oResult = openStdDlg(**ENTERED MY ORG NAME**("/_grid/cmds/dlg_runworkflow.aspx")+"?iObjType=" + CrmEncodeDecode.CrmUrlEncode(sEntityTypeCode) + "&iTotal=" +
CrmEncodeDecode.CrmUrlEncode(a.length) + "&wfId=" + CrmEncodeDecode.CrmUrlEncode(sWorkflowId)+ "&sIds=" + CrmEncodeDecode.CrmUrlEncode(sIds) , a, iWindowPosX, iWindowPosY);


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>