how to hide item cost in the cost record from cert...
# ask-stanley-ai
y
how to hide item cost in the cost record from certain role
c
AI generated answer (using internal Slack threads):
To hide the item cost in the cost record from certain roles, you can use a combination of form customization and scripting. Here are the steps: 1. Form Customization: Create a copy of your current form and hide the cost field. Then, set this new form as the preferred form for the specified roles. This will ensure that when users with these roles access the form, they will not see the cost field. 2. Scripting: You can use a beforeLoad User Event script to set the cost field to "hidden". This will ensure that the field is not visible on the form. Here is a sample code snippet in SuiteScript:
Copy code
javascript
function beforeLoad(context) {
    if (context.type !== context.UserEventType.VIEW) return;
    var form = context.form;
    var field = form.getField('cost');
    if (field) {
        field.updateDisplayType({displayType:'hidden'});
    }
}
This script checks if the form is being viewed, and if so, it gets the cost field and sets its display type to 'hidden'. 3. Workflow: You can also use a workflow to hide the field. However, the specific steps would depend on your exact requirements and the current setup of your NetSuite account. Please note that these methods only hide the field from the form. If a user has access to view items, they will have access to view all fields on it via search even if you controlled the UI with a form change. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831489444
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816720307
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800088584
Please provide your feedback on this answer.