You need to sign in to do that
Don't have an account?
Jyosi jyosi
Callout through tirgger compare the old and new values
Hello Everyone,
I have a webservice where i need to compare the old and new value if i have the old values i need to send it another method for other i need to send in another method in webservice callout.
Need to collect the parent and child old and new values.
I wrote the trigger but i always get the new values when i send it how can i get the old values
if(Trigger.isUpdate && Trigger.isbefore){
XXXX.ABC(trigger.newMap.keySet());
}
public static void ABC(Set<Id>SampleLineItem) in this method i need to acheive the old and new values.
{
// Map<Id,Sample_Line_Item__c> Sample_Line_Item__c= new Map<Id,Sample_Line_Item__c>();
List<Sample__c> LstSampleQuery= new List<Sample__c>();
Set<Id> SetSampleIds= new Set<id>();
Map<Id, Sample_Line_Item__c> LstSampleLineItems = new Map<Id, Sample_Line_Item__c>([select Id,Line_number__c,Unit_of_Measure__c,Delivery_Group__c,Product_No__c,Sample__c from
Sample_Line_Item__c where Id IN:SampleLineItem and Line_Number__C!=null order by Name Asc]);
Thanks for help
I have a webservice where i need to compare the old and new value if i have the old values i need to send it another method for other i need to send in another method in webservice callout.
Need to collect the parent and child old and new values.
I wrote the trigger but i always get the new values when i send it how can i get the old values
if(Trigger.isUpdate && Trigger.isbefore){
XXXX.ABC(trigger.newMap.keySet());
}
public static void ABC(Set<Id>SampleLineItem) in this method i need to acheive the old and new values.
{
// Map<Id,Sample_Line_Item__c> Sample_Line_Item__c= new Map<Id,Sample_Line_Item__c>();
List<Sample__c> LstSampleQuery= new List<Sample__c>();
Set<Id> SetSampleIds= new Set<id>();
Map<Id, Sample_Line_Item__c> LstSampleLineItems = new Map<Id, Sample_Line_Item__c>([select Id,Line_number__c,Unit_of_Measure__c,Delivery_Group__c,Product_No__c,Sample__c from
Sample_Line_Item__c where Id IN:SampleLineItem and Line_Number__C!=null order by Name Asc]);
Thanks for help
See also: How to reference old or prior field value in apex trigger? (https://help.salesforce.com/apex/HTViewSolution?id=000181625&language=en_US)
Is there any workaround how to get the old values.
Thanks