Auto populate fields through UI Action

srinathpatel
Kilo Contributor

Parent Table parameters passing to child table through   UI Action(Without Child Record Insert passing through   URL ).

  • Test Plan (Parent table) 2 fields Short description and instructions are Auto   Map to Defects (Child table)   fields Short description and description.

UI Action:

Name:My Defect

Table:Test Plan[tm_test_plan]

Form Button:True

On click:open_defect();

Script:

function open_defect(){

var shortdesc = g_form.getValue("short_description");

var instructions = g_form.getValue("instructions");

var URL = "/nav_to.do?uri=rm_defect.do?sys_id=-1%26sysparm_query=short_description="+shortdesc+"^description="+instructions;

top.location.href= URL;

}

find_real_file.png

  • If click on my defect button   its Auto populate   2 fields to without Insert child record .

find_real_file.png

Thanks,

Srinath Patel

5 REPLIES 5

Good answer Kunal. Just a minor note for those that may not be aware...

The difference between your method and putting the sysparm_query in the URL is your method creates the record first, then redirects. That creation may trigger business rules, workflows, etc..

The sysparm_query method takes you to a pre-populated form which can then be continued BEFORE triggering any logic.