• Janin Dancause
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies


This is my trigger I have write to add a specific account ID to a Contact. I am new to salesforce programming and I try to write the unit test but I need some help to do it.
trigger Contacts_Accounts on Contact (Before Insert, Before Update) {

for (Contact newContact : Trigger.New){
        String id_account;
        id_account = [select id from Account where idClientSoquij__c = :newContact.idClientSoquij__c].id;
        newContact.AccountId = id_account;
        }
}