Get Dialog information using oData CRM 2013

No comments

Hi,

Below article describes how to get dialog information using oData in CRM 2013.

/WorkflowSet?$filter=Category/Value eq and StateCode/Value eq 1 and Type/Value eq 1 and Name eq ‘dialog name’ and  &$select=Name, WorkflowId, Description, Category, Type

Lets have a look at oData query.

Category: It contains Dialoges and workflows. As i need dialog category value will be 1.

StateCode: here 1 is for Active dialog.

Name: Name of the dialog.

Type: Here is for actual Definition. if you activate, deactivate or edit, it will hve its own record entry. So to differentiate and get actual definition we need this.

below is the complete code.

var odataQuery = “xrmservices/2011/OrganizationData.svc/WorkflowSet?$filter=Type/Value eq 1 and Category/Value eq 1 and StateCode/Value eq 1 and Name eq ‘Name of the Dialog’ &$select=Name, WorkflowId, Description, Category, Type “;

var dialoginfo = GetDataUsingODataService(odataQuery);
var dialogId= LaunchDialog(dialoginfo.results[0].WorkflowId);

Note: GetDataUsingODataService and LaunchDialog are the custom methods which we are using. So you create your own methods to fetch data.

Hope it helps some body.

Cheers..! 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.