You need to sign in to do that
Don't have an account?
Shiva Shankar
Hi I am getting the error on Account Record Page while editing Account record from UI Error: First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []: Trigger.AccConTestTrigger
Hi I am getting the error on Account Record Page while editing Account record from UI Error: First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []: Trigger.AccConTestTrigger and trigger code is as below
trigger AccConTestTrigger on Account (After update) {
if(trigger.isAfter && trigger.isUpdate){
System.debug('this is in isAfter and isUpdate context');
List<Contact> conList=new List<Contact>();
for(Account acc : trigger.new ){
Contact con=new Contact();
con.AccountId = acc.Id;
System.debug('Account Id value is --->'+con.AccountId);
System.debug('Account Id value from the screen --->'+acc.Id);
con.Department = 'The Last Dep';
conList.add(con);
}
update conList;
}
}
Could some one please help me in this,how to solve this
trigger AccConTestTrigger on Account (After update) {
if(trigger.isAfter && trigger.isUpdate){
System.debug('this is in isAfter and isUpdate context');
List<Contact> conList=new List<Contact>();
for(Account acc : trigger.new ){
Contact con=new Contact();
con.AccountId = acc.Id;
System.debug('Account Id value is --->'+con.AccountId);
System.debug('Account Id value from the screen --->'+acc.Id);
con.Department = 'The Last Dep';
conList.add(con);
}
update conList;
}
}
Could some one please help me in this,how to solve this
In this case, for your code change your update conList; to insert conList;
regards
Andrew
Hi Andrew, I have changed to insert DML operation still i am getting error.Please see the attachment.
note that because you are using after update trigger context, this trigger will create a new contact every time the account record is updated.
regards
andrew
On After update trigger, contact insret into account then Account will update and again trigger execute it's a recusrrion
so you need to use below code
If this solution is usefull for you, Please mark as a Best Answer to help others.
Regards
Mukesh
The Trigger is on Account. The record being inserted is a Contact. The insertion of a Contact will not update the Account record unless there is some trigger or other automation on the Contact to update the Account.
Based on the code supplied, there is no indication of recursion.
Regards
Andrew