call function from variable
ervaro
Member Posts: 17
Hi,
Is it possible to call a function from a variable.
Thanks in advance for any help.
Best regards,
Erik
Is it possible to call a function from a variable.
Thanks in advance for any help.
Best regards,
Erik
0
Comments
-
I don't think I understand your question. Could you explain what you are trying to do?0
-
In a table I have stored a number of actions together with a corresponding function.
When I choose an action I would like to execute the function from the table instead of hardcoded execution of a function.0 -
I think the closes you can get with CA/L is to create a CASE statement with the function name as the condition.
Another option is to use id numbers of codeunits and call CODEUNI.RUN(Number)0 -
Hi ervaro,
AFAIK, no. What you can do is following:
- Create a buffer table with all possible parameters as fields. You can add fields as the function set grows.
- For every function, create a codeunit which uses the buffer table on the OnRun trigger.
From your call table, call the respective Codeunit by number:
codeunit.run(<CodeunitNumber>,<BufferRec>)
Since the OnRun Trigger takes the record as VAR, you can pass results this way, too.
with best regards
Jens0 -
That is not possible, and honestly I don't know why you would do it in NAV. It definitely has it's uses in other languages, but why do you need to do it? IF and CASE statements should solve the issue just fine. Function names are meant to be hard coded.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


