• A.X. Pratap
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have Created a custom picklist field on opportunity with items(Stage-1, Stage-2, Stage-3, Stage-4), Included to page layout.

Now my requirement is Write a trigger on Opportunity to validate this Stage value with below conditions,

1. while record updating, Stage can be null/Previous Stage/Same Stage/Next stage(Stage-1 to Stage-2).
2. But stage value should not be skipped to Current Stage + 2 Stages.

Thanks in advance

I need to get current user profile name in trigger. I tried by using following way. Is there any possibility to get profile name directly without query.

 

trigger triggerName on CustomObject(after Insert){

Profile ProfileName = [select Name from profile where id = :userinfo.getProfileId()];
if(ProfileName.Name=='System Administrator'){

//code

}

}

  • April 11, 2012
  • Like
  • 0
I have Created a custom picklist field on opportunity with items(Stage-1, Stage-2, Stage-3, Stage-4), Included to page layout.

Now my requirement is Write a trigger on Opportunity to validate this Stage value with below conditions,

1. while record updating, Stage can be null/Previous Stage/Same Stage/Next stage(Stage-1 to Stage-2).
2. But stage value should not be skipped to Current Stage + 2 Stages.

Thanks in advance