The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
NavBar popup
Posted: 15 Aug 08 7:27 AM
|
Hiya,
I've created a navbar button and want to display a popup on it so I can add the option of 'Insert New Item'
can anyone give me some advice
Thanks |
|
|
|
Re: NavBar popup
Posted: 17 Aug 08 5:40 PM
|
If you mean a right-click option ...
Add a Popup Menu attribute to the Navbar button - call it Items NavMenu (or whatever).
Then edit the Standard Menus toolbar and add Items NavMenu there - check how the other NavMenus have been done and you should work it out.
Phil
|
|
|
|
Re: NavBar popup
Posted: 08 Sep 08 7:32 AM
|
Thanks Phil,
I've got that bit working with your help but when I click the to show a form I'm getting an error which seems to be related to the form I'm trying to open not having a current ID. How do I get the form to be displayed and set the ID for it, from the menu command ?
Do I have to call a script, rather than the actual for ? |
|
|
|
Re: NavBar popup
Posted: 09 Sep 08 2:40 AM
|
Hi Carl,
If, when opening a form like this, you get an error about an ID, then it is because you are opening a data-bound form and the system doesn't know what record you want to display.
Generally, if you need to open a data bound form then you will write a piece of script to get the ID that you want and then call
ShowViewForRecord "TABLENAME", "Family:Name_of_Form", ID
or
rVal - ShowViewForRecord ("TABLENAME", "Family:Name_of_Form", ID) if rVal = mrOK then ...
Stephen
|
|
|
|
Re: NavBar popup
Posted: 09 Sep 08 3:15 AM
|
Hiya Stephen,
Thanks for the reply. I had a feeling I had to write some code to get the ID and open the form.
I'm just not totally sure where I need to add the code and once I've written it what action do I use to call it from the menu strip?
Thanks
Carl |
|
|
|
Re: NavBar popup
Posted: 09 Sep 08 1:21 PM
|
Hi Carl,
Well, first you will need to create a new VBScipt in Archtect.
In this, you will get the ID that you want and call Application.BasicFunctions.ShowViewForRecord
Save the VBScript and record the name and family because you will need them to use as the thing that your NavBar button calls. Your button can call lots of things, not just Forms, and VB Scripts are one of them.
Hope that this helps. If you are new at this, I could recommend a good book 
Stephen
|
|
|
|