Hi can anyone explain why in a user event beforeLo...
# suitescript
r
Hi can anyone explain why in a user event beforeLoad form.addSubmitButton({ label: 'Testing 123' }) puts two buttons on form
e
Show code please
r
Copy code
I did 
 var beforeLoad = function (context) {
        try {
            var form = context.form, type = context.type, UserEventType = context.UserEventType, newRecord = context.newRecord;
var button = form.addSubmitButton({
                    label: 'Testing 123'
                });
p
to rule out the possibility that another script or workflow is creating the additional button - in your UE change the label to Testing ABC and see if both buttons have the same name. I have had dupe buttons where I had 1 script creating a button not realizing i already had a workflow that created the same button.
👍 2
e
or maybe you accidentally created 2 deployments for the same script and record type
r
its a user event script with one script record and one deployment and i changed the label name still gives two buttons
c
I would say there are two deployments or there is a loop somewhere.
p
try clearing browser cache?
r
i deleted cache and deleted the one deployment and recreated it, still same issue
r
Can you just inactive that one script or just uncheck the deploy checkbox and see if one button is still coming ?
There is a chance that there are 2 script record using the same javascript file from your filecabinet. So even if you update the js, the script gets updated for both the scripted record.
b
the record you are deploying to already has a submit button hence two
in general, adding submit buttons is for suitelets, not user event scripts
☝🏻 1
☝️ 1