Regarding Update Alert script
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
02-09-2024 09:56 AM
I found Simultaneous Update Alert script my instance, but this did not work on custom application.(Global application has supported it)
How can I use this script on custom application ?
// Warn when two users are editing the same record
function onSubmit() {
var updatedOn = gel('onLoad_sys_updated_on').value;
if (!updatedOn)
return;
var gr = new GlideRecord(g_form.getTableName());
if (!gr.get(g_form.getUniqueValue()))
return;
var dbUpdatedOn = gr.sys_updated_on + '';
var dbUpdatedBy = gr.sys_updated_by + '';
if (updatedOn != dbUpdatedOn)
return confirm(new GwtMessage().getMessage("{0} updated this record since you opened it - overwrite with your changes? Additional comments and Work notes will not be overwritten.", dbUpdatedBy));
}
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
02-09-2024 10:02 AM
Hi,
You should not do this in an onsubmit client script.
Use of gel or GlideRecord form client script is against the best practices.
What are you trying to achieve here? What logic you are truing to implement?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
02-09-2024 10:27 AM
@Anurag Tripathi I want to avoid multiple users updating the same record.
This script met my requirements but I can't use it, so I would like to know how to meet it somehow