function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Varun Gulati 52Varun Gulati 52 

linkssss: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error:

User-added imagecode
User-added imageAny one please guide me,
David Zhu 🔥David Zhu 🔥
The issue is at this line OK.ownerId=o.id;

Ownerd is a standard field which references Id of srandard User object.

In this line, the old_age__c object Id is assigned. 

I think you may change this line to
OK.ownerid = o.ownerid;
Varun Gulati 52Varun Gulati 52
Child account is not getting inserted automatically after clicking on save button of parent record.please  help
User-added image