This topic has been locked.
Pinned topic Copy Parent record fields to Child record for the same record types?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
I am looking for a perl hook that can copy the headline,description and few other fields of the parent record to the corresponding fields in the child record when the new button is clicked on the parent child link of the parent records. If anyone has this perl, please share with me.
aoc_admin 270004TBBN25 Posts
Re: Copy Parent record fields to Child record for the same record types?2012-04-16T20:24:07ZThis is the accepted answer. This is the accepted answer.Hi Om,
I use VB, but should be the same in perl and here's the pseudo code
New button pre-action hook
set session = getsession
session.namevalue "parent_headline_variable", getfieldvalue("headline").getvalue
session.namevalue "parent_desc_var", getfieldvalue(desc).getvalue
and so on
then new button post action hook
clear the session variables by
session.namevalue "variable", ""
in the child's submit action hook initialization
if session.namevalue("FromParent"), "Yes" then
setfieldvalue "headline", session.namevalue("parent_headline_value")
setfieldvalue "description", session.namevalue("parent_desc_var")
hope that helps