I am trying to create a new record by calling the SDK.REST.CreateRecord
function from JavaScript. Below is the code snippet with which I am trying without any improvement -
function CreateProspect(QuoteId) {
SDK.REST.retrieveRecord(QuoteId, "brm_quote", "brm_quotedexipt,brm_inceptiondate,brm_Client", null, function (result) {
var prospect= {
brm_inceptiondate: getFomattedDate(result.brm_inceptiondate),
brm_clientName: {
Id:result.brm_Client.Id,
LogicalName :"brm_ClientName"
},//lookup fails
brm_currentAmount:{
Value:result.brm_quotedexipt.Value
},//moneyfield fails
brm_type: {Value:17200001} //optionset field Fails
}
SDK.REST.createRecord(prospect,"brm_prospect", function(){
alert('New prospect created')
},function (error) {
alert(error.message);
})
}, function (error) {
alert(error.message);
});
}
Need some help to find the correct way to add a lookup / optionset and decimal properties to the javascript object such that CRM can interpret it correctly while reading it from the SDK Create method.
Any help on this much appreciated. Thank you.