Auto populate field value while clicking on new button in reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2023 11:16 PM
Hi All,
There is one requirement to auto populate field value while creating new record from reference fields in the form.
There is one application called demand and in this form one reference field called "Project".
My requirement is that while I clicked the reference icon in the "Project" field and try to create a new record from there some field value should be pass from "Demand" record to project form .
Can you please provide any solution how it can be achieved.
Thanks,
Abhisek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2023 11:38 PM
@abhsekpramanik3 When a user tries to create a new record from the reference field, as shown in your screenshots in the original post. ServiceNow framework will automatically pass the sys_id of the newly created record to the original screen where the lookup was initiated. Which means the newly created record will be automatically selected in the reference field.
I would recommend you to write an on change client script which should call a Server Side script (script include) through an AJAX call and retrieve the required values from the table and set those values in the client script.
Hope this helps.
Please mark the appropriate response as correct answer and helpful.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 12:00 AM
Hi Arun,
My requirement is to pass the field values and sys_id from original form to newly created reference record to auto populate . Can you please suggest how to retrieve the field values and sysid in the newly created record.
Thanks,
Abhisek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 12:08 AM
@abhsekpramanik3 I got the requirement incorrect earlier, thanks for clarifying. Will check for possible options.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 05:11 AM
Hi Arun,
Did you find any solution of this?
Abhisek