TH: Opportunity Won THEN Create Contract
A. Specify the requirement
When an Opportunity Stage is set to "Closed Won"
then a draft Contract should be created.
B. Create a Test Case in testRigor
Create a new Test Case.
Copy-paste all steps from this Test Case: Create more records (T00004)
creates a new Account, Contact and Opportunity
Copy-paste lines from the code block below to the end of the Test Case.
Run the Test Case.
Observe that the Test Case fails.
C. Configure / Develop in Salesforce
Set Field Level Security for Contract field in Opportunity visible for all Profiles
Setup > Object Manager > Opportunity > Fields > Contract
Add Contract field to the Opportunity Layout
Create and activate a Record-Triggered, After Save Flow
GIVEN: Opportunity
WHEN: Opportunity Stage is changed to Closed Won
THEN: Create Contract
Run the test in testRigor
Last updated