You need to sign in to do that
Don't have an account?
How to insert recod to a custom object from another custom object through a trigger
I am fairy new , I did something, Not any apex in the application, DId objects, forumalas validations etc. I am actually a relational database guy for 17 yeas. Worked with Oracle PL/SQL.
I read the apex work book, and tried to write the trigger, But did not work . Here is my scenario
I have 2 Objects Change_Request__c which is parent and Change_History__c which is child.
Whenever I change the status value in the parent object and save, It must insert a new recod in the child object with parent id as foreign key.
This should happend for each time the status changed.
Change_Request__c -Parent
Request No
Request_Name__c
Change_Type__c
Description__c
Module__c
Request_Date__c
Status__c ( Possible values "Approved", "Rejected", "Changed")
*********************************************************************************************************
Change_History__c -Child History_No
Request No ( Forign key from other other object)
Request_Name__c
Change_Type__c
Description__c
Module__c
Request_Date__c Status_changed_by_c ( user modify the record in the other Object
Status__c ( Changed status in the other obeject)
Apps Hero,
Have you looked at the out-of-the-box functionality with Salesforce to capture history? If that works for you, there is no coding required.
http://help.salesforce.com/HTViewHelpDoc?id=tracking_field_history_for_custom_objects.htm&language=en_US
Best,
Ram
I need to write trigger on the first object for after update event
Something like this should do the trick:
Feel free to change the field values as you see fit.