VMS Staging Submittal Flow: After Create Update

  1. Go to Setup > Flows > New Flow.
  2. Select Start From Scratch.
  3. Select Record-Triggered Flow and click Create.
  4. Select the following values:
    • Object: VMS Staging Submittal
    • Configure Trigger: A Record is created or updated
    • Optimize the flow for: Actions and Related Records
  5. Hover over circle below Trigger and type “get”. Select Get Records.
  6. Enter the following values:
    • Label: Existing Application Rec
    • API Name: Existing_Application_Rec
    • Object: Search for “Application”
    • Conditions: set AND
    • Field: FyreSyncApplication__c Equals {!$Record.Id}
    • Sort Order: Not Sorted
    • How many records to Store: Only the first record
    • How to Store Record Data: Choose fields and let Salesforce do the rest
  7. Click the box to left of Select Elements (top left of screen) and click New Resource.
  8. Enter the following values:
    • Resource Type: Variable
    • API Name: v_NewApplicationRec
    • Data Type: Record
    • Object: Application V2
  9. Click Done.
  10. Click Select Elements and select New Resource.
  11. Enter the following values:
    • Select Formula
    • API Name: f_ApplicationStatus
    • Data Type: Text
  12. Click Save.
  13. Edit the underlined values in the list below (the Customer’s ATS Submittal Status values) to match the text values in the Customer’s Application Stage dropdown:

    CASE({!$Record.VMSSNC__VMS_vmsStatus__c},
    "waiting", "Assessment",
    "declined", "",
    "accepted", "Offer",
    "placed", "Application",
    "review", "",
    "filled", "Closed",
    "rejected", "",
    "interviewing", "Internal Interview",
    "Offer")

  14. Paste the above into the Formula section and click Done.
  15. Click Select Elements and select New Resource.
  16. Enter the following values:
    • Select Formula
    • API Name: f_rejected
    • Data Type: Boolean
  17. Click Save/Done.
  18. Paste the below into Formula section and click Done. This sets Rejected to "True/False".

    Copy
    IF({!$Record.VMSSNC__VMS_syncStatus__c}="rejected", true, false)
  19. Hover over circle below Trigger and type “get”, then select Get Records.
  20. Enter the following values:
    • Label: Application Record Type
    • API Name: Application_Record_Type
    • Object: Search for “Record Type”
    • Conditions: All Conditions Are Met (AND)
    • Field: SobjectType Equals TR1__Application_V2__c
    • Sort Order: Descending
      • Sort By: CreatedDate
    • How many records to Store: Only the first record
    • How to Store Record Data: Automatically Store all fields
  21. Hover over the circle above Stop and type “decision”, then select Decision.
  22. Enter the following values:
    • Label: Application Exists?
    • API Name: Application_Exists
  23. Select the new outcome panel and configure:
    • Label: Application already exists
    • Outcome API Name: Application_already_exists
    • Condition: All Conditions Are Met (AND)
    • Resource: {!Existing_Application_Rec}
    • Operator: is Null
      • Value: False
    • When to execute Outcome: If the condition requirements are met
  24. Select the bottom right of the decision and change Label to Application doesn't exist.
  25. Hover over the circle left of the Application already exists label, type "Assignment", and select Assignment.
  26. Change the following values:
    • Label: ExistingApplication
    • API Name: Existing_Application
    • Set variable values:
      • {!v_NewApplicationRec.SubmissionId__c} Equals `{!$Record.VMSSNC__VMS_submittalId__c}`
      • {!v_NewApplicationRec.FyreSyncApplication__c} Equals {!$Record.Id}
      • {!v_NewApplicationRec.Id} Equals {!Existing_Application_Rec.Id}
      • {!v_NewApplicationRec.TR1__Stage__c} Equals {!f_ApplicationStatus}
      • {!v_NewApplicationRec.TR1__Reject__c} Equals {!f_rejected}
  27. Hover below this assignment and type "Update", then select Update Records.
  28. Change the following values:
    • Label: Update Application
    • API Name: Update_Application
    • How to Find Records to update and Set Their Values: Use the IDs and all field values from a record or record collection
    • Record or Record Collection: {!v_NewApplicationRec}
  29. Hover over the circle left of the Application doesn’t exist label and type "Assignment", then select Assignment.
  30. Change the following values:
    • Label: NewApplication
    • API Name: New_Application
    • Set variable values:
      • {!v_NewApplicationRec.FyreSyncApplication__c} Equals {!$Record.Id}
      • {!v_NewApplicationRec.FyreSyncReq__c} Equals {!$Record.VMSSNC__fyreReqAtsId__c}
      • {!v_NewApplicationRec.TR1__Applicant__c} Equals {!$Record.VMSSNC__candidateAtsId__c}
      • {!v_NewApplicationRec.TR1__Job__c} Equals {!$Record.VMSSNC__jobAtsId__c}
      • {!v_NewApplicationRec.SubmissionId__c} Equals {!$Record.VMSSNC__VMS_submittalId__c}
      • {!v_NewApplicationRec.TR1__Stage__c} Equals {!f_ApplicationStatus}
      • {!v_NewApplicationRec.TR1__Reject__c} Equals {!f_rejected}
  31. Hover below this assignment and type "Update", then select Update Records.
  32. Change the following values:
    • Label: Create Application
    • API Name: Create_Application
    • How to Set record field values: From a Record Variable
    • How many Records to Create: One
    • How to Find Records to Update and Set Their Values: {!v_NewApplicationRec}
  33. Click Save.
    • Set the Flow Label to "VMS Staging Submittal AfterCreate Update".
  34. Click Activate.

Next Steps

With these new flows in place, you'll need to add and update flow fields.