You need to sign in to do that
Don't have an account?
Francesco Bigoni
Missing ID digits while creating a record using Lightning Data Service
Hi all,
I am trying to create a Order record using Lightning Data Service in my custom component and i need its new ID after creation. The code of the callback after saving the record is the following:
ComponentController.js
But on mobile i don't:
Do you know why it does not work on mobile?
Thank You,
Francesco
I am trying to create a Order record using Lightning Data Service in my custom component and i need its new ID after creation. The code of the callback after saving the record is the following:
ComponentController.js
component.find("childOrderRecordCreator").saveRecord(function(saveResult) { if (saveResult.state === "SUCCESS" || saveResult.state === "DRAFT") { //Trying to show the id of the new created record alert(saveResult.recordId) } else if (saveResult.state === "INCOMPLETE") { console.log("User is offline, device doesn't support drafts."); } else if (saveResult.state === "ERROR") { console.log('Problem saving order, error: ' + JSON.stringify(saveResult.error)); } else { console.log('Unknown problem, state: ' + saveResult.state + ', error: ' + JSON.stringify(saveResult.error)); } });The problem is that same code behaves differently on mobile phone and on desktop website. Using the website I get the Id:
But on mobile i don't:
Do you know why it does not work on mobile?
Thank You,
Francesco