How to CODE, Called Object is Called from Which Object?
Ravi_Thakkar
Member Posts: 392
Hallo All,
I know, it is possible in NAV to know that, Called Object is Called from which Object.
E.G.
I am doing one Action in FORM 12. Which calls Codeunit X.
Also doing one Action in FORM 13 Which Calls Codeunit X.
My requirement is to write one Condition in Codeunit X that,
If X is Called from FORM 12 then Do TASK1
ELSE IF X is Called from FORM 13 then Do TASK2
But, no idea How to do that?
Any suggestion?
I know, it is possible in NAV to know that, Called Object is Called from which Object.
E.G.
I am doing one Action in FORM 12. Which calls Codeunit X.
Also doing one Action in FORM 13 Which Calls Codeunit X.
My requirement is to write one Condition in Codeunit X that,
If X is Called from FORM 12 then Do TASK1
ELSE IF X is Called from FORM 13 then Do TASK2
But, no idea How to do that?
Any suggestion?
0
Answers
-
hi,
you can write a code somwthing like,
if form.runmodal(Form::12) then
Codeunit1.run
else if form.runmodal(Form::13) then
Codeunit2.run;Regards,
Manish0 -
You could create a new function within your codeunit SetCalledByForm(FormID) and call this function each time right before you call your condition function."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
-
Thanks for your reply.manisharma31 wrote:hi,
you can write a code somwthing like,
if form.runmodal(Form::12) then
Codeunit1.run
else if form.runmodal(Form::13) then
Codeunit2.run;
Purpose solved.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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 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