• anshuman mishra
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
I came accross this statement in apex guide  about static variables:

A static variable is static only within the scope of the Apex transaction. It’s not static across the server or the entire organization. The
value of a static variable persists within the context of a single transaction and is reset across transaction boundaries. For example, if an
Apex DML request causes a trigger to fire multiple times, the static variables persist across these trigger invocations.



My question is,what is the static part mean in static variable?Is it that during one transaction or one operation,its value remains the same and cannot be changed.I am new so would appreciate a clarification.Thanks:-)
I am new to apex and wanted to know,why do we need a system static method?Is there a reason for this?

0down votefavorite

I am creating a junction object called Candidate_Position.This has two parents candidate and position.I have to go to the Candidate Detail page and in the related list create a new Candidate Position.The next page is a VF page where I select the Position to associate with the new Candidate Position and click save.The condition however is,I have to validate if the position I am associating is not already associated with any Candidate Position having the same Candidate parent. For example if there is Candidate "Paul",and under that I am creating a Candidate Position trying to associate Position "Dev",the other Candidate Positions under Candidate "Paul" should not have "Dev" as parent Position.

So what Validation Rule I have to give for the Junction Object?

I am completely new to Salesforce,and would appreciate some answers.Thanks :-)