- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 02:47 AM
I have created a UI action to display a GlideModalForm once clicked. This all works as expected but when I try to use either the addParm or setPreference options to preset a field to certain value it continues to remain blank.
I have included my script below:
The Modal is displayed but the description field remains empty
Appreciate any assistance here as the addParm or setPreference options are not working to achieve this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 06:03 AM
Totally my bad, I misunderstood the requirements.
What you need has nothing to do with any UI Page or UI Macro.
What you need is to use parameter named sysparm_query; e.g:
var gmf = new GlideModalForm('Create Purchase Order', 'x_icaew_work_items_purchase_order');
gmf.setPreference('sysparm_query', 'description=Some description');
gmf.setPreference('sys_id', '-1');
gmf.render();Basically that is the parameter that forms will look at to set initial values.
I'm assuming x_icaew_work_items_purchase_order is the name of the table containing Purchase Order records that you want to create.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2024 04:09 PM
You're welcome and thanks for marking the correct answer! 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2024 05:08 AM
Hi Kilo,
I to have same requirement but in my case i need attachment and worknote from enhancement to this dialog (create Story).
Can you give me some input how we can have attachment and worknote as well ?
Thanks
Pramod Pandey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 08:48 AM
@Pramod Pandey2 can you describe the full requirements?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 03:39 AM
Let's try the below, it should do the trick.
How to pass value in GlideModal setPreference UI macro
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 04:20 AM
Hi @Tai Vu
Thank you for your response. I have tried this but this is not working either.
I am initiating the GlideModalForm from a UI action so am unsure how the UI Macro is meant to interact with the rendered GlideModalForm.
The example provided was for a GlideModal so not sure if the API interacts differently.
Thank you for your input.
Kind regards
