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
mahesh reddy 4mahesh reddy 4 

There are two custom objects obj1 and obj2. I am writing trigger on obj1. There is no any relationship between obj1 and obj2? how can i create a record in obj2 when i create a record in obj1?

Ramu_SFDCRamu_SFDC
Follow the guidelines as outlined in the below thread

http://salesforce.stackexchange.com/questions/41031/apex-trigger-insert-record-on-another-object-on-afterinsert-event
David "w00t!" LiuDavid "w00t!" Liu
Luckily this isn't too hard - here's some sample code with a video tutorial:
http://www.sfdc99.com/2014/07/02/apex-video-tutorial-write-your-first-trigger/