You need to sign in to do that
Don't have an account?
Dominic Sebastian
HOW TO MAKE THE pARENT GET THE SAME FIELD DETAILS AS THE CHILD
trigger NegotiationDetails on NegotiationLogDetails__c (after insert) {
Set<Id> NegotiationLogset = new Set<Id>();
List<StatusLog__c> NegotiationLoglist = [Select Id, Original__c,Response__c,Final__c from StatusLog__c where Id In : NegotiationLogset];
for (NegotiationLogDetails__c NegotiationLogDetalstrigger : trigger.new)
{
if(NegotiationLogDetalstrigger.IsFinal__c == true)
{
//StatusLog__c nl = nls.get(NegotiationLogDetalstrigger.Id);
NegotiationLoglist.Original__c = NegotiationLogDetalstrigger.Original__c;
NegotiationLoglist.Response__c = NegotiationLogDetalstrigger.Response__c;
NegotiationLoglist.Final__c = NegotiationLogDetalstrigger.Final__c;
}
//nls.add(nl);
}
// insert nl;
}
Set<Id> NegotiationLogset = new Set<Id>();
List<StatusLog__c> NegotiationLoglist = [Select Id, Original__c,Response__c,Final__c from StatusLog__c where Id In : NegotiationLogset];
for (NegotiationLogDetails__c NegotiationLogDetalstrigger : trigger.new)
{
if(NegotiationLogDetalstrigger.IsFinal__c == true)
{
//StatusLog__c nl = nls.get(NegotiationLogDetalstrigger.Id);
NegotiationLoglist.Original__c = NegotiationLogDetalstrigger.Original__c;
NegotiationLoglist.Response__c = NegotiationLogDetalstrigger.Response__c;
NegotiationLoglist.Final__c = NegotiationLogDetalstrigger.Final__c;
}
//nls.add(nl);
}
// insert nl;
}
You dont really need to query, as you are just updating. Just create a list and update.