Execute a subform programmatically

thibault
Member Posts: 6
Hello,
I have the following issue :
I would like to execute a subform (included in a tab of a form), only if a boolean is true. If it is false, I want it not to be executed.
After having intialized the three properties (Visible, Enabled, Editable) of my subform "lSubForm" to 'No', I tried the following code in the OnActivateForm() trigger :
It does work, but the problem is, that my subform is not in the same range that my main form, and my customers won't automatically have the permission to execute the subform with their license. That's why I wanted to execute it, depending of a setup boolean.
Thanks for your help
I have the following issue :
I would like to execute a subform (included in a tab of a form), only if a boolean is true. If it is false, I want it not to be executed.
After having intialized the three properties (Visible, Enabled, Editable) of my subform "lSubForm" to 'No', I tried the following code in the OnActivateForm() trigger :
IF gBool THEN BEGIN CurrForm.lSubForm.ENABLED:=TRUE; CurrForm. lSubForm.VISIBLE:=TRUE; CurrForm. lSubForm.FORM.EDITABLE:=TRUE; END;
It does work, but the problem is, that my subform is not in the same range that my main form, and my customers won't automatically have the permission to execute the subform with their license. That's why I wanted to execute it, depending of a setup boolean.
Thanks for your help
0
Comments
-
I don't understand the problem. Your customer is out of forms? They don't want to buy more? You want a way to get around licensing?
It's something ridiculously cheap to buy a form, like $20 in the US if I remember right.0 -
That's not the problem.
The thing is, that if one of my customer buy the right granule, they will have access to additionnal functionnalities, and one of those functionnalities is a tab (containing a subform) of a common form. But if he's not interested in this layer, I don't want his NAV to fail, as each of my customers will have the same version.
Anyway, if the customer has the right granule, I want it to execute the form and its subform, but if he has not it, I don't want the subform to be executed because he will get an error.
Thanks0 -
Use the Permission Range table: 2000000044
You'll find all of the objects that can be executed and more.0 -
Sorry but I have not this table in my range on database.0
-
It's a System table. You can see it through a Variable or a New Form based on it...0
-
Yeah, you won't see it in Object Designer. Just type in the number for your record variable when you define it.0
-
Thank you, I didn't know anything about this table and how to use it.
However, I cannot see how it can resolve my problem. I can see if an object can be executed in my license, so that's cool. But if my object is not in this table, I would like dynamically not to execute it.
Thanks a lot0 -
You cannot do it with a subform, because when you call a form, subform of the form will always be executed regardless of it's "visible", "editable" etc properties.
Use separate form, which user would call by pressing a button on the form.0 -
Ok, thanks, that what I was afraid.
Thank you0
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