function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Writing trigger for first time need assistance

I am looking to create a trigger under the Cases tab I have two pick lists "Tier Level" which updates "Tier Status" ( I had assistance with creating a a valdiation rule) for this. Since I can not delete the traditional "status" field I need to create a trigger so that when the user makes a selection on the Tier Status pick list it also updates the standard "status" field.

Under the cases tab we have created pick list called "Tier Level" with the following values:

Tier 1
Tier 2
Tier 3
Quality Assurance

I have also created another pick list called "Tier Status" with the following dependent values:

T1: Open
T1: Work in Progress
T1: Pending Customer Response
T1: On-Hold
T1: Closed
T1: Reopened
T2: Open
T2: Work in Progress
T2: Pending Customer Response
T2: On-Hold
T2: Closed
T2: QA Info Request
T2: Work in Progress (T3/QA)
T2: Solution Sent from T3/QA
T2: Onsite Support Required
T2: Reopened
T3: Open
T3: Work in Progress
T3: QA Recreated
T3: Assigned to Development
QA: Open (Triage)
QA: Work in Progress (Triage)
QA: Open (Test)
QA: Work in Progress (Test)

Tier Level is the "controlling field" and Tier Status is the "dependent" field. I created a validation rule for this dependency. Unfortunately we can not delete the standard field called "Status" which is located under the "Cases" tab. 

We will need to create a trigger for when the Tier Status is updated it fires and updates the standard field "Status". This way the user doesn't have to manually change both the Tier Status Field and Status (standard) field. 

User-added image

Rajiv Bhatt 16Rajiv Bhatt 16
why do you need a trigger for this? you can simply write a workflow field update which copies the Tier Status into the standard Status field (unless i am missing something here!)