where am i going wrong? i just want to create a bu...
# general
r
where am i going wrong? i just want to create a button at view and disable at edit in beforeload?
k
Try #C29HQS63G
e
Just uploaded your code and Print 1 only seen on view mode. When I click edit, button disappears
r
Exactly
I don't know why
k
Why would you want a button on the screen while in edit?
r
I am asking, what's is wrong I don't get..why isn't it working
k
Not a developer here - but is there some reason you are doing the same thing twice instead of making your criteria "view or edit"
That said - the way you have it structured looks to me like you have it adding the button, but this section only applies to View
Copy code
var mybutton = formObj.getButton({
          id: "custpage_print1",
        });
Also - wouldn't your second if need to be an
else if
?
b
pay closer attention to what your block of code for view does that edit doesnt
or pay closer attention to your error logs
if you dont see any logs, you need to change the log level on the deployment
r
@KevinJ of Kansas that was it! i just found the silly error and it worked