Set value from Create New Module

kkaufmann
Tera Contributor

I am working with a scoped app and one of the requirements is to have two "Create New" modules.  

I have a field named "type".  One of the modules needs to open a new form with type set to "full_review".  The other needs to set the type field to "fast_track." Can I pass arguments in the Module to do this?

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

yes, you can pass in something like &sysparm_query=type=full_review

View solution in original post

5 REPLIES 5

gkishen84
Tera Contributor

Follow the below 3 steps, if only if you want to verify the "type" value alone..

1. Create 2 different View with same set of fields (taking one as it is as "Default" and naming other one as "Testing")

2. Create 2 modules 

  • Default Item 
  • Testing Item (set value for Arguments as - sysparm_view=Testing)

3. Have your below client script for onLoad()

function onLoad() {

var view = getView();
if (view == 'Testing'){ 
g_form.setValue('type','fast_track');
}else{

g_form.setValue('type','full_review');

}
}

Note : This process is not a good practice if your form falls on continuous modifications in future. Just posted as you asked