UI Page Unique ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2016 09:36 PM
Hi All,
Am having a UI page where users can attach the attachment and that attachment will go for validation and processing. Previously i was attached the UI page in a record producer to display it.
Reocrd producer is having Unique ID which i can get it by using this code in UI page
<button onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'u_import_bulk_update')">Upload Template</button>
</j:jelly>
as "sysparm_itm_guid" gives unique ID each and every time i was able to give the attachment sys id as unique,
Now am not using record producer anymore so i couldnt generate a unique ID for the attachements. Unique ID is must because i dont want to show the previous attachment attched by the user when is attaching again.
Please help me to generate unique ID for ui page.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2016 11:01 PM
UI page also have a unique ID, you can get the ID from UI page URL parameter, from URL parameter you can reterive the sys_id of that page.
Thanks,
Param
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 12:34 AM
Hi Sergiu and Paramveer.
I hope the guid and sys id is different. Please correct me if am wrong.
I tried with the sys ID, As i have given the sys ID of the UI page
<button id="add_attachment" onclick="saveAttachment('sys_data_source', '${sys_id}')">Upload Template</button> --> The attachment will be stored in sys_attachment table with table sys id as ${sys_id} (sysID of UI page) and table "sys_data_source".
After attaching it, am not gonna process the attachment, am leaving my page and again am coming to attach another file. At that time the already attached file with sysiD will be there in attachment popup. I need to manually remove the attachment and should attach another file, which i dont want to do.
Thats why if its possible to pass unique IDs in the sysID parameter of attachment, each attachment will save in table with unique IDs not with sysID of UI page.
So whenever am clicking "Upload template"it would be a fresh attachment popup where i can upload my attachment.
I hope that i said my issue clearly, Please forgive me if am still confusing you guys.
Thanks for your wonderful reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 12:23 AM
Hi Joshwa,
Each record in ServiceNow has a unique sys_id field, and that includes UI pages as mentioned by paramveer
When editing the UI page, if you use right click context menu you can Copy Sys_id, see example below:
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2016 12:34 AM
Hi Sergiu and Paramveer.
I hope the guid and sys id is different. Please correct me if am wrong.
I tried with the sys ID, As i have given the sys ID of the UI page
<button id="add_attachment" onclick="saveAttachment('sys_data_source', '${sys_id}')">Upload Template</button> --> The attachment will be stored in sys_attachment table with table sys id as ${sys_id} (sysID of UI page) and table "sys_data_source".
After attaching it, am not gonna process the attachment, am leaving my page and again am coming to attach another file. At that time the already attached file with sysiD will be there in attachment popup. I need to manually remove the attachment and should attach another file, which i dont want to do.
Thats why if its possible to pass unique IDs in the sysID parameter of attachment, each attachment will save in table with unique IDs not with sysID of UI page.
So whenever am clicking "Upload template"it would be a fresh attachment popup where i can upload my attachment.
I hope that i said my issue clearly, Please forgive me if am still confusing you guys.
Thanks for your wonderful reply.