below is my code, this code is tied to an onChange event.
function sP(processId)
{
if (processId != null)
{
//only switch process if there is a processId
Xrm.Page.data.setActiveProcess (5315859b-47d6-944a-04b167b57787, switchPE);
}
}
function switchPE(result)
{
//values that would be passed to parameter 'result':
//succcess
//invalid
if (result === "invalid")
{
//show a form notification error
Xrm.Page.ui.setFormnotification("Unable to switch to the new business process.", ERROR, "error");
}
else //result === "success"
{
//cleatr form notification error
Xrm.Page.ui.clearFormNotification("error");
}
}
when i trigger the event i get the following error.
There was an error with this field's customized event.
field: new_switchtoprocess2
event: on change
error:'sP' is undefined
Microsoft Dynamics CRM Error Report Contents
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Expected ')'</Message>
<Line>6</Line>
<URL>/%7B635908128250004309%7D/WebResources/new_SP2</URL>
<PageURL>/main.aspx?etc=3&extraqs=%3f_gridType%3d3%26etc%3d3%26id%3d%257b3394FD1F-3AD0-E511-80F3-3863BB2B9B10%257d%26opened%3dgrid%26process%3deaf31a58-2d9d-4bc2-810a-13adf42fd618%26processts%3d128450040%26rskey%3d%257b00000000-0000-0000-00AA-000010003000%257d&pagemode=iframe&pagetype=entityrecord&rskey=%7b00000000-0000-0000-00AA-000010003000%7d</PageURL>
<Function></Function>
<FunctionRaw></FunctionRaw>
<CallStack>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.3; LCJB; rv:11.0) like Gecko</BrowserUserAgent>
<BrowserLanguage>en-US</BrowserLanguage>
<SystemLanguage>en-US</SystemLanguage>
<UserLanguage>en-US</UserLanguage>
<ScreenResolution>2259x1271</ScreenResolution>
<ClientName>Web</ClientName>
<ClienState>Online</ClienState>
<ClientTime>2016-02-11T12:41:09</ClientTime>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1033</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1033</UserCulture>
<OrgID>{08BF28D0-F021-4BD2-9324-184A4F17EECE}</OrgID>
<UserID>{EE8450DF-83B9-E211-B7C9-78E3B5086495}</UserID>
<CRMVersion>7.1.1.4314</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>
i been banging my head against the wall for almost a week now trying to solve this issue, any help would be much appreciated.