Account
Earned badges
Achievement: Latest Unlocked
Replies
Topics Started
Preferences
Topic Started
Topics |
---|
On our main object, we have a quick action that fires a lightning component which on init queries for the necessary data & attachment, parses the url and then, fires an event to navigate to the |
In my current setup, I have a main custom object with two buttons: "Generate Contract" and "Send For Sign Off". |
Replies Created
Reply to: Relating a transaction to a custom object and saving completed docs to the custom object
Friday, April 17, 2020 at 10:25amThe button is a custom action using a custom lightning component to parse together the information needed to build the URL. I have an apex controller grabbing the id & Name of the main custom object, customer signer info (first name, last name, email), company signer info (User id), and documentId. I have the conventionId and signer recipient labels stored in labels. All of this is passed to the JS controller where the information is put together as a string and an navigate to URL event is fired using that string.
so given that the response is a success and none of the fields are null.
var resp = response.getReturnValue();
var parentObjectId = resp.id;
var documentName = resp.Name + " Contract";
var docId = resp.DocId__c;
var signingConventions = $A.get("$Label.c.Contract_Signing_Convention");
var Signer1Id = resp.Customer_Email__c;
var Signer1FirstName = resp.Customer_FirstName__c;
var Signer1LastName = resp.Customer_LastName__c;
var Signer1Label = $A.get("$Label.c.Customer_Signer_Label");
var Signer2Id = resp.Company_Signer__c;
var Signer2Label = $A.get("$Label.c.Company_Signer_Label");
var packageParameters = "ParentId="+parentObjectId
+"&Name="+documentName
+"&Documents="+docId
+"&ConventionId="+signingConvention
+"&Signer1="+Signer1Id
+"&Signer1FirstName="+Signer1FirstName
+"&Signer1LastName="+Signer1LastName
+"&Signer1Label="+Signer1Label
+"&Signer1AllowDelegation=0"
+"&retUrl=%2F"+parentObjectId
+"&Signer2="+Signer2Id
+"&Signer2Label="+Signer2Label
+"&Signer2AllowDelegation=1"
+"&EnforceSigningOrder=true&AutoPrepare=1";
var eUrl= $A.get("e.force:navigateToURL");
eUrl.setParams({
"url": '/apex/esl__package?'+packageParameters
});
eUrl.fire();
No errors occur in the apex controller or JS controller and all the information is correct (I console logged each variable to verify the expected values where coming through). The url reroutes the the transaction screen but the error message "Invalid Parent Id" occurs. If the ParentId parameter is removed from the string, the error does not occur and we get the edit transaction screen with all the expected info - Signers are there with the correct recipient labels, the correct document is attached, the Convention lookup is populated, etc.
Are there any steps that need to be completed to relate a transaction to my main custom object? Do I need to create a Lookup(MainCustomObject__c) field on the transaction object? Do I need to define any other parameters in the URL string?
Subscriptions
Topics | Replies | Freshness | Views | Users |
---|---|---|---|---|
On our main object, we have a quick action that fires a lightning component which on init queries for the necessary data & attachment, parses the url and then, fires an event to navigate to the |
0 | 3 years 10 months ago | 22 | |
In my current setup, I have a main custom object with two buttons: "Generate Contract" and "Send For Sign Off". |
3 | 4 years ago | 192 |