Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Xrm.WebApi not working in new UI v9

$
0
0

Hi

Has anyone experienced any issues retrieving a record using Xrm.WebAp.retrieveRecord method in the new v9 Unified Interface?  I have created some JavaScript below that works fine in the classic web UI however when I use the new unified interface get errors in console 'A failure occurred in Wep Api in Dynamics 365'.  JavaScript example below:

function setSalesValue(executionContext)
{
 var formContext = executionContext.getFormContext();
 var daysDone = formContext.getAttribute("kit_daysdone").getValue();
 var salesValue = formContext.getAttribute("kit_salesvalue");
 
 Xrm.WebApi.retrieveRecord("kit_rates", "e85f60c6-1ec4-e811-a96b-0022480149c2", "?$select=kit_value").then(
  function success(result) {
   console.log(`Retrieved values: Value: ${result.kit_value}`);
   // perform operations on record retrieval
   var salesRateValue = result.kit_value;
   salesValue.setValue(daysDone * salesRateValue);
  },
  function (error) {
   console.log(error.message);
   // handle error conditions
  }
 );
}


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>