• Vaibhav Joshi 1
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi all
I am new to trigger and apex coding can somebody help me for the task given below..
Update an existing trigger on Realtionship object to add following logic


trigger execution: after update


- record criteria: Relationship.RecordType.Name = "Suspension"
- Loop through records meeting above criteria and check if "Suspend__c(new value)" = true and Suspend__c(new value) != Suspend__c(old value) then add record to suspended list
- Loop through suspended record list check for following
a) is suspended record is a primary(rC_Bios__Primary__c = true)? if yes, then add to Map<id(rC_Bios__Contact_2__c),id(relationship.id)>mapMemberToPrimMembership

NOTE: Requirements says if a membership is suspended and suspended membership is for primary lodge, then all other active membership for same member for non-primary lodge must be put on resigned status. If membership is suspended for non-primary lodge only, then only that lodge is suspended.

- Next find all membership(relationship) records for non-primary lodges that are still active and mark them as suspended
a) to find all other membership use following soql
[Select Id, End_Date__c, rC_Bios__Active__c, Resigned__c From rC_Bios__Relationship__c Where RecordType.Name = 'Membership' and rC_Bios__Contact_2__c in: mapMemberToPrimMembership.keySet() and Id not in: mapMemberToPrimMembership.values() and rC_Bios__Active__c = true];
b) loop through each records and check if End_Date__c == null, if so then update
rC_Bios__Active__c = false
End_Date__c = today's date
Resigned__c = true
c) update the records found in step b) above
Hi all,
I want to migrate my metadata from dev sandbox to devpro sandbox... can someone suggest me what to do ???
Its my first time using any migration technique..
Thanks for help in advance
Hi all,
I want to migrate my metadata from dev sandbox to devpro sandbox... can someone suggest me what to do ???
Its my first time using any migration technique..
Thanks for help in advance