• Paul Fitzpatrick 19
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi,

I am trying to figure out a way to auto-populate a lookup field with a value on initial entry(clicking New Contact) into the Contact screen.
The lookup field is a lookup to a custom object called Project Centre   ( API Name is Project_Centre__c ). The Project Centre can take on up to 5 different record values (won't list all  5, such as "Aisling Shangan" or "Aisling Woodhazel") 

I wish to set the value in the Project Centre lookup field depending on the currently logged in User's Role. So for example, if the current logged-in User's Role is "Aisling Shangan Staff" then I wish the Project Centre lookup value on the Contact object to be set to the value of "Aisling Shangan".

I understand that writing an Apex trigger may be the only way of achieving this. I haven't written a trigger yet, so any help would be much appreciated!
I have inherited the maintenance of some Visualforce and Apex code. I have downloaded the
Eclipse project, and am using the Force.com IDE. I created two Developer
Sandboxes (recently refreshed from Production), and want to "push" minor
changes between these two Sandboxes to make sure everything is Ok. I have
made Visualforce and Apex changes in one Sandbox and was able to deploy and
"see" the changes locally in that Sandbox, but I don't yet fully understand the
pitfalls of pushing "Apex and Visualforce" in Change Sets from Sandbox to
Sandbox(or ultimately Sandbox to "Production"). Can you please point me to relevant documentation! Thanks!