locked
Entity Id must be specified error when calling dialog RRS feed

  • Question

  • I have a custom ribbon button on the Opportunity form that calls a custom dialog. The dialog it calls creates a phone call with the Regarding set to an Opportunity - it gets the opportunity id from the URL. It then calls a child dialog and passes the opportunity details into that child dialog along with the Phone Call as the topic. This child dialog updates the opportunity and closes the call created in the parent dialog. This works fine when I call the URL directly, and when I click on the custom ribbon button in CRM to call the parent dialog, that also works and I see everything being updated as it should be. The URL definiely works, that has all been tested multiple times. When accessing it directly, or from the report while actually on the report server - it works every time.

    The users are viewing reports via 3rd party software in a web browser tab. When the report is viewed here, the user can click on a URL to open the opportunity in CRM (opens in a new tab). Once the opportunity is open, the user can then click on the custom ribbon button that calls the parent dialog, they get a message asking "Do you want to leave this page?". (the dialog opens in a new window). They click yes, then get an error saying "Inavlid Argument". I've checked the logs and this is what's coming up:

    [2014-12-04 16:56:39.246] Process: w3wp |Organization:6ea476f3-6c49-e411-bda1-0050568e76b7 |Thread:   59 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 13b1c571-fb5a-4f74-9559-197aea53de80 | ErrorInformation.LogError  ilOffset = 0x17
    >MSCRM Error Report:
    --------------------------------------------------------------------------------------------------------
    Error: Entity Id must be specified for Update
    Error Number: 0x80040203
    Error Message: Entity Id must be specified for Update
    Error Details: Entity Id must be specified for Update
    Source File: Not available
    Line Number: Not available
    Request URL: https://crmuatintr.acornlife.ie/AcornGIUAT/AppWebServices/InteractiveWorkflowWebService.asmx
    Stack Trace Info: [CrmException: Entity Id must be specified for Update]
       at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
       at Microsoft.Crm.Application.Platform.ServiceCommands.UpdateCommand.Execute()
       at Microsoft.Crm.Application.WebServices.InteractiveWorkflowWebService.UpdateSession(String sessionId, String comments)
    [2014-12-04 16:56:46.469] Process: w3wp |Organization:6ea476f3-6c49-e411-bda1-0050568e76b7 |Thread:   64 |Category: Platform.Workflow |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 7180dcbd-457b-4054-9a28-006c38a038bd | UnhandledExceptionEventHandler.OnStage1Complete  ilOffset = 0x46
    >Workflow terminated: {3D6BEF6D-0EAF-4D4A-9BBC-2237E556C08D} - Microsoft.Crm.Workflow.Activities.StopWorkflowException: Jumping to Child Interactive Workflow.
       at Microsoft.Crm.Workflow.Services.ChildInteractiveWorkflowActivityService.StartChildInteractiveWorkflowInternal(String entityName, Guid entityId, Guid workflowDefinitionId, Dictionary`2 inputArguments)
       at Microsoft.Crm.Workflow.Services.ChildInteractiveWorkflowActivityService.ExecuteInternal(CodeActivityContext executionContext, StartChildInteractiveWorkflow startChildInteractiveWorkflow)
       at Microsoft.Crm.Workflow.Services.ChildInteractiveWorkflowActivityService.Execute(CodeActivityContext executionContext, StartChildInteractiveWorkflow startChildInteractiveWorkflow)
       at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
       at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation), WorkflowInstanceId: {C3DFD084-D67B-E411-9F8E-0050568E76B7}

    Here's the code behind the custom ribbon button, that runs the dialog. I put in alerts for the dialogId, primaryEntityId (both GUIDs) and objectTypeCode (which was 'opportunity') and they all looked like valid values.

    (function() {
    Develop1_RibbonCommands_runDialogGrid = function(ids, objectTypeCode, dialogId) {
        if ((ids == null) || (!ids.length)) {
            alert(window.LOCID_ACTION_NOITEMSELECTED);
            return;
        }
        if (ids.length > 1) {
            alert(window.LOCID_GRID_TOO_MANY_RECORDS_IWF);
            return;
        }
        var rundialog = Mscrm.CrmUri.create('/cs/dialog/rundialog.aspx');
        rundialog.get_query()['DialogId'] = dialogId;
        rundialog.get_query()['ObjectId'] = ids[0];
        rundialog.get_query()['EntityName'] = objectTypeCode;
        openStdWin(rundialog,buildWinName(null),615,480,null);
    }
    Develop1_RibbonCommands_runDialogForm = function(objectTypeCode, dialogId) {
        var primaryEntityId = Xrm.Page.data.entity.getId();
        var rundialog = Mscrm.CrmUri.create('/cs/dialog/rundialog.aspx');
        rundialog.get_query()['DialogId'] = dialogId;
        rundialog.get_query()['ObjectId'] = primaryEntityId;
        rundialog.get_query()['EntityName'] = objectTypeCode;
        openStdWin(rundialog,buildWinName(null),615,480,null);
    }
    })();

    Thursday, December 4, 2014 6:02 PM

Answers

  • Hello,

    Try passing the entityname instead of the objectTypeCode ("account" instead of "1", for example).

    Cornel


    Cornel Croitoriu - Senior Software Developer

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    • Marked as answer by crmNewbie1978 Thursday, December 18, 2014 11:17 AM
    Thursday, December 18, 2014 11:13 AM

All replies

  • Any ideas on this? I was getting an invalid argument error, and I realised that I had set the Due time for a phone call entity to the execution time. So I changed that to 1 minute after execution time, but it's still Coming up!!!
    Monday, December 8, 2014 4:37 PM
  • Hello,

    Try passing the entityname instead of the objectTypeCode ("account" instead of "1", for example).

    Cornel


    Cornel Croitoriu - Senior Software Developer

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    • Marked as answer by crmNewbie1978 Thursday, December 18, 2014 11:17 AM
    Thursday, December 18, 2014 11:13 AM
  • Thanks. I eventually tried that myself and it worked.
    Thursday, December 18, 2014 11:17 AM