Related List: How to auto populate fields

ramandeepgarg6
Tera Expert

Hi Team,

If i have a form opened. This form contains a related list. In related list if i create a new form then its fields should be auto-populated from the current opened form. Please tell how to achieve this?

Capture.PNG

Regards

Ramandeep

1 ACCEPTED SOLUTION

Hi Ramandeep,



Only the field which refers to the parent table will be auto-populated if you want to populate some other field then some manipulation has to be done.


One thing you can do is have onLoad client script and since you already have a reference field to parent, using g_form.getReference() with callback you can auto-populate that.


you can try it out.




Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ramandeep,



This would occur if you have a field in below table which refers to current record. In this case that field would be automatically populated.


If this is already present can you check the form layout for the below table whether the field which refers to current record is present in the form layout or not.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

Hi Ankur,



That part is fine. For example i want to copy "Description" from the current record and want to auto populate it in "Description" of below "Issues" record then how this can be done?



Regards


Ramandeep


Hi Ramandeep,



Only the field which refers to the parent table will be auto-populated if you want to populate some other field then some manipulation has to be done.


One thing you can do is have onLoad client script and since you already have a reference field to parent, using g_form.getReference() with callback you can auto-populate that.


you can try it out.




Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

Hi Ankur,



Thank you! I will try your above idea and will try it tomorrow and it will work hopefully. Once done i will mark the question as Answered otherwise will ask further questions.



Regards


Ramandeep