I'm working on a Microsoft Dynamics CRM 2011 plugin attached to SalesOrder entity on Create event. I need to get the Order parent Account, to access some of its properties. I'm trying the following code inside the Execute
method, but key "accountid" is not present at time of execution.
Entity entity = (Entity)context.InputParameters["Target"]; // A salesorder entity
EntityReference accountRef = (EntityReference)entity.Attributes["accountid"];
Plugin is registered at Post-operation stage to execute in synchronous mode. Following image show all configuration.
Is there another way to get the parent Account for the SalesOrder entity?