function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Francesco BigoniFrancesco 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
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:
User-added image
But on mobile i don't:
User-added image

Do you know why it does not work on mobile?

Thank You,
Francesco