Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Prepopulate the fields while creating child case

Manisha30
Tera Guru

Hi All,

 

We have a requirement to prepopulate the opened for with parent Assigned to field while trying to create a child HR case from HR Agent Workspace.

Tried creating a Business rule before insert, but it is happening after creating the case not while creating or while loading. 

 

Can someone provide your expertise over here?

 

Thanks in Advance!!!

Manisha

1 ACCEPTED SOLUTION

@Manisha30 

so on case creation page you want that to be auto-populated?

I doubt this is feasible as onLoad won't work on case creation

You might have to play with that case creation page by making a duplicate variant of it and then handle the auto population

Lot of customization, I will recommend to avoid and reduce the technical debt

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

18 REPLIES 18

@Manisha30 

so what's not working?

Ajax is not working?

For client script used in workspace, try to use getXMLAnswer()

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar prepopulation of assigned to from parent to child case is not happening upon loading but can see it is happening after form submission, observed that subject person is also getting changed to assigned to.

@Manisha30 

I already informed the approach, to get parent and then pass to Ajax and return the user

where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Yes, that is what I did - if you can see the script above,  we are able to get the parent and passing it to Ajax and returning the assigned to user. But somehow it is not working as expected(not prepopulating the opened for field of child case while creating)

@Manisha30 

so you got the assigned to user from script include but this line not working?

g_form.setValue('opened_for', answer);

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader