Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

cloning a parent form fields to new form without saving it

Aps1
Tera Expert

Hello Team,
I want to clone fields from the parent record to new record but without saving the new form user can mark submit to insert it.
and a field called parent should get the value from the parent record.

script:

var grTransitionNew=new GlideRecord("x_novrp_it_transition_cost_master_table");
grTransitionNew.initialize();
 
var copyFieldArray=["project_id","demand_id",'application','pqm','date_when_project_was_assigned','ste','deputy_ste','priority','implementation_vendor'];
for(var fieldName in current)
{
if(copyFieldArray.indexOf(fieldName)>-1)
   grTransitionNew.setValue(fieldName,current.getValue(fieldName));
   grTransitionNew.setValue('parent_st',current.sys_id);
   grTransitionNew.release =(current.release || 1) + 1;
 
}
grTransitionNew.insert();

action.setRedirectURL(grTransitionNew);
0 REPLIES 0