Hi,
I added my JavaScript function to the form of entity Collection.
I want to retrieve the records of entity Movie related to the current Collection, and I'm doing it by using a fetchXml which will be passed inside a Xrm.WebApi.retrieveMultipleRecords.
I can get the Guid of the target entity this way:
var collectionid = formContext.data.entity.getId();
But how can I compare it to the Guid of the lookup record in Movie, inside the fetchXml?
The follwoing code throws an error ( A binary operator with incompatible types was detected. Found operand types 'Microsoft.Dynamics.CRM.collection' and 'Edm.Guid' for operator kind 'Equal'.") :
var moviesFetchXml = "";
Xrm.WebApi.retrieveMultipleRecords("movie", "?moviesFetchXml");
I assume that I cannot use collectionid here:
... and I should substitute it with some variable which stores the Guid value of the lookup/related entity, but I can I retrieve it with JavaScript?