I cannot remove Last Sales Activity off the custom...
# ask-stanley-ai
a
I cannot remove Last Sales Activity off the customer record: custpage_lsa_vis is the ID. Do I have to script this on beforeLoad to field.updatedisplaytype to hidden? Or easier way?
c
AI generated answer (using internal Slack threads):
To remove the Last Sales Activity off the customer record with the ID
custpage_lsa_vis
, you can indeed use a
beforeLoad
user event script to set the field's display type to hidden. This is done by using the
field.updateDisplayType
method in SuiteScript. Here is a sample code snippet:
Copy code
javascript
function beforeLoad(context) {
    if (context.type !== context.UserEventType.VIEW)
        return;

    var form = context.form;
    var field = form.getField({
        id: 'custpage_lsa_vis'
    });

    if (field) {
        field.updateDisplayType({
            displayType: serverWidget.FieldDisplayType.HIDDEN
        });
    }
}
This script will hide the field when the record is viewed. Please note that this will not remove the field from the record, it will just hide it from the user interface. ****** 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.822829187
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821186602
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818217635
Please provide your feedback on this answer.