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

Update BPF active stage programmatically with EntityLogicalName: businessprocessflowinstance

$
0
0

Hi all,

i'm triyng to update the active stage of an Opportunity in the BPF after clicking the button (in c#), i'm doing it by following the sample here: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/sample-work-business-process-flows 

I'm having issue with the method:

Entity retrievedProcessInstance = crmSvc.Retrieve("businessprocessflowinstance", processOpp1Id, cols1);

Here's the error:

System.ServiceModel.FaultException`1: 'The 'Retrieve' method does not support entities of type 'businessprocessflowinstance'.'

Here below is the function code:

   newActiveStageId = (Guid)pathResp.ProcessStages.Entities[activeStagePosition].Attributes["processstageid"];

    // Retrieve the process instance record to update its active stage
    ColumnSet cols1 = new ColumnSet();
    cols1.AddColumn("activestageid");
    Entity retrievedProcessInstance = crmSvc.Retrieve("businessprocessflowinstance", processOpp1Id, cols1);

    // Update the active stage to the next stage
    retrievedProcessInstance["activestageid"] = new EntityReference("businessprocessflowinstance", newActiveStageId);
    crmSvc.Update(retrievedProcessInstance);


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images