Hello, I’m hoping someone might be able to help me, I’m new to creating plugins so apologies if this has been asked before.
I am trying to import some external data into Dynamics using a virtual entity. I have successfully created a plugin for this with the Retrieve and RetrieveMultiple event handlers and this shows me all the data in a subgrid using a sample API. However, the API I’m using requires me to filter the results as part of the request by passing a parameter, in this case it’s a company ID. This company ID is saved as a field in the account entity but I’m struggling to get this at run time in the plugin that is making the API call.
On the account form I have a tab that will be for Licence Codes that are saved in an external source, I can use an API call to retrieve these, but I need to know the company ID before I can make the call. Is there a way I can get the GUID of the account that I’m using (i.e. the account on the open form) as I can then get the company ID using a simple queryExpression? Using Guid Id = context.PrimaryEntityId only returns 00000000-0000-0000-0000-000000000000 not the GUID of the account record.
Any help would be greatly appreciated