Hello Guido, thank you for coming back to me so quickly. I’m not sure I explained the situation very well, so I will try again.
I have written a single Plugin which has 2 classes in it, one for Retrieve and another for RetrieveMultiple, then using the Plugin Registration Tool I have registered the dll file as a new assembly as per the guidance notes. I have then Registered a new Data Provider and selected the assembly from the previous step and set the 2 event handlers as the Retrieve and RetrieveMultiple classes and then created the data source again as per the instructions.
I have added the new Virtual Entity Data Source into Dynamics, created the Virtual Entity and set the data source to be the one we just added. I have then added the appropriate fields to the Virtual Entity and added the tab to the accounts form along with the subgrid.
When I then open the account form I can go to the new tab and the API call is made and the data is displayed as expected, perfect!
However, this is just a test to make sure I understand how this all works, what I now need to do is to use the API for the licence codes rather than some other test API. The different is, in the test API, the retrieveMultiple class returns all the records, so I could then filter them based on a relationship or anything else I wanted to, however in the API for the licence codes, retrieveMultiple requires an ID as a parameter so it only returns the Licence codes for that company. So, what I need to do is to read the CompanyID field (This is just an Integer) from the open form and then pass that to the API call.
But the problem I’m having is that the RetrieveMultiple class seems to be acting upon the Virtual Entity and not the Account form so when I ask for the GUID it doesn’t return the correct value. I have tried adding different classes for getting the Account Info by adding steps into the plugin so it happens on retrieve of an account and whilst this gives me the GUID I then cant pass to the RetrieveMultiple class to pass onto the API call.
I’m stuck as to how I move forward with this, I seem to be able to get the info I want/need in different plugins but cant seem to join them all together. Please can you advise how I can access the Account GUID from the RetrieveMultiple plugin which is for the Virtual Entity?