The process includes a flow (which acts upon a DML action to an Adm_Application__c record) and a trigger (which fires when Drawloop/Nintex creates the Decision Letter and inserts into our Salesforce Org). This article gives an overview of how the chain of events work.
Step-by-step guide
HOW TO CREATE A DECISION LETTER - PUBLISH NOW:
- The Mba Application record (Adm_Application__c) should have the following settings:
- Internal Status (Current_Status__c) = some decision;
- Field Drawloop Next6 is not empty and starts with, "SFAdm_Application__c";
- Targeted Decision Letter has a Nintex DocGen package name populated there.
- Decision Email Sent is NOT CHECKED;
- Publish Now is BLANK;
- There should be a value in the field, "Targeted Decision Letter" - that's the name of the decision letter to be rendered.
- TO INITIATE THE PROCESS:
- EDIT the Publish Now field: set to "Publish NOW";
- SAVE;
- Refresh the page a few times
- It can take a few seconds and up to a few minutes for Nintex Corp to create the Decision Letter and get it into the Mba Application.
- The Publish NOW field should show, "3 - Published";
- An email will have been built and sent to the applicant to let them know that a decision letter is available for view via the Mba Application site;
- Look for the newly created Decision Letter in the Files section of the Salesforce detail page for the Mba Application, on the "Related" tab.
HOW TO CREATE A DECISION LETTER - RENDER DECISION LETTER ONLY:
- The Mba Application record (Adm_Application__c) should have the following settings:
- Internal Status (Current_Status__c) = some decision;
- Field Drawloop Next6 is not empty and starts with, "SFAdm_Application__c".
- Targeted Decision Letter has a Nintex DocGen package name populated there.
- TO INITIATE THE PROCESS:
- EDIT the Publish Now field: set to "Render Decision Letter Only";
- SAVE;
- Refresh the page a few times
- It can take a few seconds and up to a few minutes for Nintex Corp to create the Decision Letter and get it into the Mba Application.
- The Publish NOW field should be empty;
- NO EMAIL IS SENT - the letter is only rendered and added to the Mba Application record;
- Look for the newly created Decision Letter in the Files section of the Salesforce detail page for the Mba Application, on the "Related" tab.
HOW TO CREATE A DECISION LETTER - Via the "BUTTON" method
- The Mba Application record (Adm_Application__c) should have the following settings:
- Internal Status (Current_Status__c) = some decision;
- Field Drawloop Next6 is not empty and starts with, "SFA_Application".
HOW THE PROCESS WORKS (for the Publish NOW or the Render Decision Letter Only flow):
- The SAVE of the Mba Application (Adm_Application__c) record is a "DML" event that a workflow is looking to act upon.
- The Flow: "Application Nintex Management"
- The field "Publish Now Status" is updated to, "1-Awaiting Decision Letter" (all methods show this status while the letter is being created);
- A callout to Nintex (Drawloop) is executed.
- The callout is a "non-blocking" process that requires the user to refresh the Salesforce page in order to see any updates of the process.
- "non-blocking" processes mean that the process calls something else and then just gets on with regular business; the Salesforce system does not wait for a response to show the user. Hence the need to refresh the page.
- WHEN NINTEX CREATES THE FILE it will then call back INTO our Salesforce Org and insert the File and "Parent" it with the Id of the Mba Application record;
- This causes the ContentVersion trigger to execute:
- The trigger scans all files inserted in the current transaction. For Decision Letters, this process is looking for files that begin with, "Decision_" in the File's Name.
- Each of those files causes an update to the Mba Application record:
- Set the Publish NOW field to either "3 - Published" for the "Publish NOW" flow OR to BLANK for "Render Decision Letter Only" flow;
- Build an email to be sent to the Applicant and send it;
- Check to make sure the VISIBILITY of the File is for "AllUsers" - sometimes the File will get created with "InternalUsers" and the applicant won't be able to see the decision letter.