Hiding Buttons on Forms

madm
Member Posts: 92
On our goods receipt form we wish to hide the post/print button to prevent goods being posted. I have added a boolean in to show this trigger.
If the trigger = true then the post/print button needs to be replaced with just a print button.
I have created a test button called Print1, and put the following into several areas of the form but withouse success (in addition to this, i will need to set the print/post button to hide. I thought about laying the new button over the top of the current button to get it to swap?):
IF WhseActivityLines.BOOLEANFIELD = TRUE THEN
CurrForm.Print1.VISIBLE
ELSE
CurrForm.Print1.VISIBLE(FALSE);
(When receiving goods, we have 1order / whs avtivity header)
Am I able to set buttons to hide like i am with columns?
Thanks
If the trigger = true then the post/print button needs to be replaced with just a print button.
I have created a test button called Print1, and put the following into several areas of the form but withouse success (in addition to this, i will need to set the print/post button to hide. I thought about laying the new button over the top of the current button to get it to swap?):
IF WhseActivityLines.BOOLEANFIELD = TRUE THEN
CurrForm.Print1.VISIBLE
ELSE
CurrForm.Print1.VISIBLE(FALSE);
(When receiving goods, we have 1order / whs avtivity header)
Am I able to set buttons to hide like i am with columns?
Thanks

0
Comments
-
The trigger you're looking for is OnAfterGetCurrentRecord, but if you have a header/lines form it's not so easy, because the header is looking into a different table than the lines form. You'll have to program something to check the condition on the lines.0
-
The lines thing becomes more difficult.
Just to go off topic for a sec - since this post is about Hiding Buttons I figured I'd paste some doc's about Hiding Buttons incase somone in the future is looking.
http://savatage99.googlepages.com/HideButton.pdf
http://www.geocities.com/navision_attai ... uttons.doc0 -
thanks for your replies
The form i am working on looks at the warehouseactivityhdr, whereas the boolean is on the w.a lines, so I guess this is the tricky situation!
I have tried doing a get / find from the header to the line but to no avail, so any guidance would be appreciated.
Thanks0 -
Something like
MyLineRec.RESET; MyLineRec.SETRANGE(PrimaryKeyField,MyHeaderRec.PrimaryKeyField); MyLineRec.SETRANGE(TheBooleanField,TRUE); CurrForm.MyButton.VISIBLE(MyLineRec.ISEMPTY);
This is pseudocode, I have not tried this on an actual form.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions