TH: Opportunity Won THEN Create Contract
Last updated
Last updated
When an Opportunity Stage is set to "Closed Won"
then a draft Contract should be created.
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.
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