function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger PorttoShipment on Ship__c (after update) { set<id> shipid= new set<id>(); map<id,id> mapis= new map<id,id>(); List<Shipment__c> updateship= new List<Shipment__c>(); for(Ship__c s:Trigger.new){ Ship__c oldship=Trigger.oldmap.get(s.id); if(s.shiptoport__c!=null && s.shiptoport__c!=oldship.shiptoport__c){ // portid.add(s.shiptoport__c); shipid.add(s.id); mapis.put(s.id,s.shiptoport__c); } } if(shipid.size()>0){ for(Shipment__c objCS :[select id,llokupToport__c,lookupToship__c from shipment__c where lookupToship__c in :shipid]){ //mapship.put(objCS.ookupToship__c, objcs) ; if(mapis.containsKey(objcs.lookupToship__c)){ objCS.llokupToport__c=mapis.get(objcs.lookupToship__c); updateship.add(objCS); } } } if(updateship.size()>0){ update updateship; } }
Can you try the below trigger on ship object.
If this solution helps, please mark it as best answer.
Thanks,
All Answers
Can you please let the community know what excatly you need so it would be easy to answer that.
By just what is in the question it is difficult to answer.
Please check if the below question is soomething which you are looking for.
https://salesforce.stackexchange.com/questions/327037/how-to-clone-indirectly-related-record-using-apex-trigger
If this solution helps, Please mark it as best answer.
Thanks,
Can you try the below trigger on ship object.
If this solution helps, please mark it as best answer.
Thanks,