- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 03:46 AM
Hi,
I need help on the below scenario.
I am trying to create an incident with use of UI page( can't use a record producer), where i need a custom attachment button.
For the same, i am using the saveAttachment('incident','incident_sysId') method where we need to populate table name and sysid of the current record.
The problem which i am facing is that i need sys_id of the new record which i am going to create with UI page. But then, record is not yet created so i don't have sys_id with me to append in the saveattchment method. So i figured out a way how record producer works, it generates a new GUID everytime and create a record in attachment table with same table sys_id
And then when user submits the Record producer, it captures the same table sys_id and create new record in Incident table with same sys_id.
To replicate same behavior through UI page, we can use gs.generateGUID() method which gives unique key every time, and then once attachment is added, we can create a record with same new sysId, My concern is whether gs.generateGUID() will always give me unique key and it would never be as same as any of already created records in incident table because this could lead to a chaos in my case.
Please help in this case if you have any knowledge on it or a better way to implement the same scenario.
Thanks
Gaurav Bajaj
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 04:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 04:55 AM
Let me know if that answered your question. If so, please mark it as correct so that others with the same question can find it quickly in the future and that it gets removed from the Unanswered list. Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 04:45 AM
Hi Gaurav,
gs.generateGUID will give you always a unique key.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 04:50 AM
Hi Sergiu,
Thanks for the reply.
My concern is that it shouldn't match the already created records or the records going to be created by other means because i am going to create new incident record with it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 04:53 AM
Every time you call gs.generateGUID you will get a unique key, so from that point of view you should not problems.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2023 02:05 AM
Hi Gaurav,
I have the similar situation, How can I assign GUID to the sys_id of the record which is yet to be created.
Please help me in this scenario.
Thanks
Jayanth
