문제

Ok in crm 2011 using Odata Query - if a workflows Odata Set name is AsyncOperationSet What is the equivalent for a dialog?

I have tried to figure this out with no luck

Please help

Thank you

P.s I need to get the dialogs id from its name

도움이 되었습니까?

해결책

When searching for a dialog to launch via javascript:

Category = 1 (Dialog) Type = 1 (Definition) - This is important if trying to call a dialog from javascript!

Solution:

triggerDialog = function (name, entityName, recordId) {

var dialogId = "";

    var request = Xrm.Page.context.getServerUrl() + "/XRMServices/2011/OrganizationData.svc/WorkflowSet?$select=Name,WorkflowId&$filter=Type/Value eq 1 and Category/Value eq 1 and Name eq '"+name+"'";
    $.ajax({
        type: "GET",
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        url: request,
        async: false,
        beforeSend: function (XMLHttpRequest) {
            XMLHttpRequest.setRequestHeader("Accept", "application/json");
        },
        success: function (data, textStatus, XmlHttpRequest) {
            if (data.d.results.length > 0) {
                dialogId = data.d.results[0].WorkflowId;  
           }
        },
        error: function (XmlHttpRequest, textStatus, errorThrown) {
            /*Error Occurred*/
        }
    });

var serverUrl = Xrm.Page.context.getServerUrl();

window.showModalDialog(
serverUrl + "/cs/dialog/rundialog.aspx?DialogId=" + encodeURIComponent(dialogId) + "&EntityName=" + encodeURIComponent(entityName) + "&ObjectId=" + encodeURIComponent(recordId), null, "dialogHeight:600px;dialogWidth:800px;center:yes; resizable:1;maximize:1;minimize:1;status:no;scroll:no");

Hope this helps

다른 팁

Just for your information. AsyncOperation is not instances of workflows only. It could be anything that is executed asynchronously (async plugins, calculating of matchcodes for dupdetection rules and many other).

Not sure what exactly do you want to get from Odata. What exactly do you need to get? If you need an instance of dialog - you will need to use AsyncOperation as well.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top