You need to sign in to do that
Don't have an account?
Jim Montgomery
Getting error MISSING_ARGUMENT, Id not specified in an update call: []: ()
Here is my code. I cannot see where I am missingthe ID.
trigger ProductConfigExtendedmaintenance on Apttus_Config2__ProductConfiguration__c (after insert, after update) {
Set<Id> proposalIds = new Set<Id>();
List<Apttus_proposal__proposal__c> proposalsToUpdate = new List<Apttus_proposal__proposal__c>();
for(Apttus_Config2__ProductConfiguration__c prop :Trigger.new){
proposalIds.add(prop.Id);
}
proposalIds.remove(null);
for(AggregateResult ar :[SELECT Proposal_ID__c, MAX(extended_maintenance_max_rollup__c) maxMonths
FROM Apttus_Config2__ProductConfiguration__c
WHERE Id IN :proposalIds
GROUP BY Proposal_ID__c]){
proposalsToUpdate.add(new Apttus_proposal__proposal__c(
Id = (Id)ar.get('Proposal_ID__c'),
extended_maintenance_months__c = (Decimal)ar.get('maxMonths')
));
}
update proposalsToUpdate;
}
trigger ProductConfigExtendedmaintenance on Apttus_Config2__ProductConfiguration__c (after insert, after update) {
Set<Id> proposalIds = new Set<Id>();
List<Apttus_proposal__proposal__c> proposalsToUpdate = new List<Apttus_proposal__proposal__c>();
for(Apttus_Config2__ProductConfiguration__c prop :Trigger.new){
proposalIds.add(prop.Id);
}
proposalIds.remove(null);
for(AggregateResult ar :[SELECT Proposal_ID__c, MAX(extended_maintenance_max_rollup__c) maxMonths
FROM Apttus_Config2__ProductConfiguration__c
WHERE Id IN :proposalIds
GROUP BY Proposal_ID__c]){
proposalsToUpdate.add(new Apttus_proposal__proposal__c(
Id = (Id)ar.get('Proposal_ID__c'),
extended_maintenance_months__c = (Decimal)ar.get('maxMonths')
));
}
update proposalsToUpdate;
}
The Proposal_ID__c field was not populated with an ID. There was another field that had the correct ID in it.
Duh on me!