1

I created an overwrite for the "new"-button on a custom object via a Lightning Component. On the desktop everything works fine but the Salesforce mobile app causes some issues.

The component contains the following:

    <force:recordData aura:id="forceRecord"
                      recordId="{!v.recordId}"
                      targetFields="{!v.record}"
                      fields="Id, Name, Street__c, PostalCode__c, City__c, Country__c"
                      mode="EDIT" />

   <lightning:button variant="brand" label="Submit" onclick="{!c.saveRecord}" />

Within the controller I execute a redirect to the created record with the following snippet:

    var tempRec = component.find("forceRecord");
    tempRec.saveRecord($A.getCallback(function(result) {
    if (result.state === "SUCCESS") {
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
          "recordId": result.recordId
        });
        navEvt.fire();  
    }

This works on desktop but not on Salesforce mobile app. I also tried window.location.href = '/' + result.recordId; without success.

Any ideas how I can make it work on mobile as well?

Thanks Chris

0

1 Answer 1

0

Seems not to be possible - therefore I wrote the method by my own. This solved the problem.

1
  • 1
    Hello Chris, that is great, would like to share a portion of your solution to help others? Commented Nov 29, 2021 at 19:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .