
Announcements
Hello guys,
I'm creating a form for my table in Dataverse and gotta need some Javascript for its event. I'm hitting error with my script which using function retrieveMultipleRecords.
The error is ->
A binary operator with incompatible types was detected. Found operand types 'Microsoft.Dynamics.CRM.msauto_serviceorder' and 'Edm.String' for operator kind 'Equal'.
It is coming from a statement like this :
var OrderId = Xrm.Page.getAttribute("jm_serviceorder").getValue()[0].id;
var Select = "?$select=jm_journalid";
var Filter = "&$filter=jm_ServiceOrder eq "+ OrderId ;
Xrm.WebApi.retrieveMultipleRecords('jm_expensedetail', Select + Filter ).then(.....
I actually don't have any knowledge about Javascript, so am not sure what is this function needed. All I can say is that the key that I'm using for the filter (jm_ServiceOrder) is a lookup field to another table, and that I believe why the error message bring up another name Microsoft.Dynamics.CRM.msauto_serviceorder which is a table name that it is lookup with.
While googling, I found something like this-> https://coderscollection.wordpress.com/2019/02/22/error-a-binary-operator-with-incompatible-types-was-detected-found-operand-types-entity-and-edm-guid-for-operator-kind-equal/
mentioned we need to specify WEB API Property name for the filter. What is WEB API Property name ? and how can I get it ?
What is actually the error means and how to resolved this ?
Thanks.
Hello @Voltes,
Try using CRMRestBuilder, it will provide a feature to Easily generate ODATA CALL. I have provided the attachment. Please use the same.
Navigate to Model Driven Apps --> Click on Advance settings --> Click on Cusotmization--> Solutions --> Import the attached solution.
Once Import done. Refresh the screen then
You can see the button at the top. Click on that, it will open another screen there you can do your queries.
For Basics Javascript Click Here and Subscribe for more JS Videos: https://www.youtube.com/watch?v=x8kYNCkikgs&t=5s
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com