I have a Client script that creates a Sales Order ...
# suitescript
j
I have a Client script that creates a Sales Order once a button is clicked:
Copy code
let soCreation = record.create({
                type: record.Type.SALES_ORDER,
                isDynamic: true,
                defaultValues : {
                    entity: customer,
                    cf: 133
                }
            });
    
            soCreation.selectNewLine({
                sublistId: 'item'
            });
    
            soCreation.setCurrentSublistValue({
                sublistId: 'item',
                fieldId: 'item',
                value: 12554,
                ignoreFieldChange: false
            });
    
            soCreation.commitLine({
                sublistId: 'item'
            })
    
            let finishedSO = soCreation.save();
This button will be clicked by a user using a custom Customer Center role. I have set the Sales Order permission on the Customer Center role to 'Edit.' However, I keep getting the following error: "Permission Violation: You need a higher level of the 'Transactions -> Sales Order' permission to access this page. Please contact your account administrator." Any insight?
e
If you have a user event script on the sales order you might get more info about the error.
Also check that the Customer Center role is active...
j
Thanks. The role is active and able to do a bunch of other stuff. Not sure why this wasn't working. I can access Sales Orders with a direct link just fine. Either way, I did end up going the UE script route instead.