admin管理员组文章数量:1287581
I want to disable (or) Hide the standard "Edit" Button on the View Mode of the Custom Record Type. Instead Of Standard Button i have used custom button to access the edit page of the record to particular users. So i want to disable the standard edit button.
My Code:
Script Version: Suite Script 2.0
Client Script
function pageInit(scriptContext) {
var approved = 3;
var currentRecord = scriptContext.currentRecord;
var status = currentRecord.getValue("custrecord_lst_ch_status");
//Hiding The Standard Edit Button When the Status Field is in Approved State
if (status == approved) {
document.getElementById("edit").disabled = true;
document.getElementsByName("edit")[0].disabled = true;
}
}
ERROR: I'm unable to get the ID of the "Edit" Button. It is getting the NULL value.
It is Possible to Disable (or) Hide on the view mode of the record using client script (or) User Event Script.
Thanks in advance.
I want to disable (or) Hide the standard "Edit" Button on the View Mode of the Custom Record Type. Instead Of Standard Button i have used custom button to access the edit page of the record to particular users. So i want to disable the standard edit button.
My Code:
Script Version: Suite Script 2.0
Client Script
function pageInit(scriptContext) {
var approved = 3;
var currentRecord = scriptContext.currentRecord;
var status = currentRecord.getValue("custrecord_lst_ch_status");
//Hiding The Standard Edit Button When the Status Field is in Approved State
if (status == approved) {
document.getElementById("edit").disabled = true;
document.getElementsByName("edit")[0].disabled = true;
}
}
ERROR: I'm unable to get the ID of the "Edit" Button. It is getting the NULL value.
It is Possible to Disable (or) Hide on the view mode of the record using client script (or) User Event Script.
Thanks in advance.
Share Improve this question asked Sep 22, 2016 at 5:07 Deepan MuruganDeepan Murugan 7713 gold badges22 silver badges42 bronze badges4 Answers
Reset to default 7Version: SuiteScript 2.0
USER Event Script Before Load Event:
if (context.type == context.UserEventType.VIEW) {
var form = scriptContext.form ;
form.removeButton({
id :'edit',
});
}
The only time I saw the Edit button dissappear is when the record is locked via workflow.
You can create a simple 1 state workflow to lock the record depending on the user role.When you lock the record edit button automatically disappear for the intended user roles.This would be less intrusive way of removing the edit button.
Maybe this is a little bit of late, but for others who want to know the answer. I used the below code to remove the button.
var form = context.form;
form.removeButton('edit');
本文标签:
版权声明:本文标题:javascript - Is there any way to Disable (or) Remove the Netsuite Standard Edit Button on the View Mode of the Custom Record - S 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741311379a2371669.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论