I'd like to hide a button when a form opens and then unhide it when the add new record button is pressed.. Can you help with the best way to do this?
set the button to hide when $$_HIDEBUTTON.
Have a script trigger on the layout that sets $$_HIDEBUTTON = 1
Have the new record button create a new record and set $$_HIDEBUTTON = ""
Or you could have it hide based on there being data in the fields that all of your records generally have populated, so when a new record is made the fields are empty and the button unhides.
I created a script that says Set Variable put it on the On Layout Enter
Then created a script that says
New Record Request
Set Variable [ $$_HideButton;Value:""]
I put it on the button
It doesn't seem to work. I'm a newbie here I'm sure I missed something.
Did you put a hide condition on the button? Also the on Layout Enter will only fire if you come to that form from another layout. If you need it to happen on every record you could set it to OnRecordLoad.
It all depends on your work flow I guess.
What is exactly that the button does and why do you need it to hide?
You'd need "Refresh Window", or if you add object name to the button "Refresh Object" is better.
Not sure how to put a hide condition on the button. Thru the inspector? or conditional formatting?
So it's an order entry form that is also used to edit orders. When you click on the button it brings up the customer's list. When it's a new order I want to select a customer. When the order is going to be edited I don't want to be able to see the button. I don't want the user to be able to select a different customer by mistake. When the layout opens I want to hide the button so essentially you're in edit mode. When you click on new order you're going to create a new order and need to select a customer.
Thanks for taking your time to help.
True, the hide condition is set in the inspector. And don't forget what user19752 added about a Refresh.
Hide Conditions are entered in the Hide Object When calculation window on the Data tab of the inspector.
Looking at your work flow I think the first option I outlined will work and definitely will need what the other guys said about the Refresh object step.
I'm not sure what to put in the hide object when ..... in the inspector. Can you help me?
>I'm not sure what to put in the hide object when ..... in the inspector. Can you help me?
What exactly are you trying to achieve? Why does the button need to hide when a form opens -- what form, and what do you mean by "when it opens"?
BTW just making a global variable $$hide_button is naive because it assumes there will only ever be one window open displaying that screen.
Is it naive to assume that only one window would be open on the same layout?
I have never seen anyone wanting two windows of the same layout before. Especially with record locking and the like.
But anyway John, you would but in $$_HIDEBUTTON if you were doing it the way I suggested in the first reply.
But there are always a multitude of ways to accomplish these things.
Retrieving data ...