Afternoon Michael.
Thank you very much for your assistance. The second option is definitely more suited to meet my requirement. I wonder if you could assist with a few answers as I am not following the logic of the statements (even though most of it is working).
1. I have added the following logic to the supplied code:
function make_child()
{
make_copy("","KEEP.make_child_for_pid=$args.persistent_id","KEEP.make_child_for_ref_num=$args.ref_num","KEEP.make_child_customer_id=$args.customer.id","KEEP.make_child_customer_name=$args.customer.combo_name");
}
function init_child()
{
if (_dtl.edit && "$args.KEEP.make_child_for_pid" != "" && "$args.KEEP.make_child_for_ref_num" != "")
{
document.main_form.elements["SET.parent"].value="$args.KEEP.make_child_for_pid";
document.main_form.elements["KEY.parent"].value="$args.KEEP.make_child_for_ref_num";
document.main_form.elements["SET.description"].value=<PDM_FMT ESC_STYLE=JS2>"$args.description (created from Incident $args.KEEP.make_child_for_ref_num)"</PDM_FMT>
document.main_form.elements["SET.requested_by"].value="$args.KEEP.make_child_customer_id";
document.main_form.elements["KEY.requested_by"].value="$args.KEEP.make_child_customer.name";
document.main_form.elements["SET.customer"].value="$cst.id";
document.main_form.elements["KEY.customer"].value="$cst.combo_name"
}
2. I have had no success in getting the Customer value of the parent to populate through to the Requestor Field on the Child. I have tried adding the following line at the end of the function but to no avail:
<input type="hidden" name="SET.requested_by" value="$args.customer">
3. When I interrogate the created child form through IE Developer tools, I am able to see that the correct values for $cst.id and $cst.combo_name are correct, but they will not populate into the customer field and I am unable to see any values that are necessary to populate the requested by field. I have tried outputting it to the Console Log as well but I am having very little joy.
I am not asking you to write all the code for me, but if you could tell me what I am doing incorrectly or point me in the right direction, I might be able to battle through this and meet the requirements.
Much appreciated.
chris