You need to sign in to do that
Don't have an account?
Peter Martensen 8
Can this code be modified to open the Record in Edit mode?
This code works to open the new Record that was created by a Flow, but I want the Record to open in Edit mode. Is it possible to modify this code so it opens the new Record in Edit mode?
({ invoke : function(component, event, helper) { var args = event.getParam("arguments"); var destObject = component.get("v.SObject"); var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": destObject, "slideDevName": "related" }); navEvt.fire(); } })
Given that destObject is just a recordId and not the entire object.
https://developer.salesforce.com/docs/component-library/bundle/force:editRecord/documentation
Thanks. This looks promising. I'm not a coder, so I don't understand exactly what I'm doing. I substituted the code you gave me, but maybe I didn't do it correctly. I'm getting a Field Integrity Exception error about the "(" in the editRecord command: Failed to save OpenSObjectController.js: ESLINT_ERROR: {c:OpenSObject - CONTROLLER} line:col [14:22] --> Parsing error: Unexpected token ( : Source . Can you tell what I did wrong? Thanks for your help.
You should post the code of your controller and your component.
var destObject = component.get("v.SObject");
....
editRecordEvent.setParams({ "recordId": destObject }); "recordId": destObject is suspect. We rarely do that.
We get the recordId like that most of the time:
var recordId = component.get("v.recordId")
...
editRecordEvent.setParams({ "recordId": recordId });
Thanks! It is a Lightning Component. This is all of the information I have for the Component. I use it in Flows. It is available as a local action.