• chaitu.gadam@hotmail.com
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi, 

 

Can any one send the steps how to
"convert lookup reationship field to master detail realtionship"

trigger AccountDuplicateTrigger on Account (before insert,before update)

{    

for(Account a:Trigger.New)    

{     List<Account> acc=new List<Account>();    

acc=[select id from Account where Name=:a.Name and Rating=:a.Rating];

    if(acc.size()>0)        

{        

acc.Name.addError('you cannot create duplicate Account');    

}

 

}

}

trigger AccountDuplicateTrigger on Account (before insert,before update)

{    

for(Account a:Trigger.New)    

{     List<Account> acc=new List<Account>();    

acc=[select id from Account where Name=:a.Name and Rating=:a.Rating];

    if(acc.size()>0)        

{        

acc.Name.addError('you cannot create duplicate Account');    

}

 

}

}