0

I have tried searching for an answer but could't find it. I have an OptionSet field (x) in Dynamics on an Entity. Its OptionSetType is Boolean. FalseOption is No and TrueOption is Yes.

I am to set the value of above field using CDS. I am making Http calls to update the data. The rest of the fields are updating OK but only this one has no affect and is always false. I have tried giving values like "true", true, "Yes", yes, 1, "1" ... but not working.

Does anyone know how to set the yes or not optionset using CDS?

Thanks in advance

Additional info: Here is the data that I am sending to D365 via CDS:

{{ 
"createdon": "2020-01-14T00:00:00", 
"receiveddate": "2020-01-14T00:00:00", 
"grosssaleprice": 297495.0000, 
"discount": 10374.0000, 
"islocalboolean": true, 
"agreementnumber": "Aj55" 
}} 

If you know CDS, it just works via http requests. and takes the above payload. All other fields are set as expected but the islocalboolean is not.

Dev X
  • 1
  • 3
  • Need more details like how are you assigning value and where ? Is there a code snippet or screenshot of Power automate or canvas apps expression/formula ? – Arun Vinoth-Precog Tech - MVP Sep 17 '20 at 18:43
  • Which entity, OOB or custom one? – Arun Vinoth-Precog Tech - MVP Sep 18 '20 at 12:32
  • @DevX Please do not provide additional information in comments. Instead, add the information to the question using the "edit" button. Code can be surrounded in `\`\`\`backticks\`\`\`` or indented four spaces to display it as code. – A. R. Sep 18 '20 at 13:55
  • @ArunVinoth What OOB? It is a custom entity created by D365 developers and has that islocalboolean field above. – Dev X Sep 18 '20 at 16:16
  • @AndrewRay Done now. Sorry posting a question after long! – Dev X Sep 18 '20 at 16:17
  • OOB is out of the box platform entity. Did you test with postman, any errors? Normally custom entity/attributes will have publisher prefix like new_agreement or xxx_islocalboolean. Verify them? – Arun Vinoth-Precog Tech - MVP Sep 18 '20 at 16:18
  • 1
    @ArunVinoth There are no errors. Http status 200 (OK) is returned. Other field values that go with it are updated fine. Yes the field names have publisher prefix. I have removed it just to keep it anonymous and I don't get sued by my boss. :) – Dev X Sep 18 '20 at 20:07
  • @DevX any luck with postman, did you try any other entity or Boolean field? – Arun Vinoth-Precog Tech - MVP Sep 20 '20 at 20:29
  • 1
    @ArunVinoth I tried other boolean fields and they were working fine. I found out that there are some workflows on the D365 side which are setting it back to "false" even when I give it a "true" value. So nothing wrong with my way of setting it. Thanks all. – Dev X Oct 05 '20 at 12:10

0 Answers0