Calling a procedure from a codeunit on action button

Cryptonic
Member Posts: 11
I've have multiple procedures in a codeunit and i want to call a certain procedure OnAction button in a page.
trigger OnAction();
var
<Var> : CodeUnit <CodeunitName>
begin
<Var>.<FunctionName>;
<Var>.Run;
end;
what I'm it doing wrong?
trigger OnAction();
var
<Var> : CodeUnit <CodeunitName>
begin
<Var>.<FunctionName>;
<Var>.Run;
end;
what I'm it doing wrong?
0
Best Answer
-
.0
Answers
-
Statement <Var>.<FunctionName>; calls function FunctionName
Statement <Var>.RUN; calls OnRun trigger of the <Var> codeunit
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-031 -
So what's the correct form to do it ?
0 -
I want to run one of the functions in the codeunit0
-
I tried it and it didn't work when i click on the button nothing happen0
-
BlackTiger wrote: »Just open and read NAV development tutorials. Or quit NAV development for good. Don't thing software development is a right choice for you.
How about if you have something helpful to say go ahead and say it if you don't just SHUSH0 -
.0
-
Btw the problem was related to nav cannot execute al code on role center it cancel the modifications on runtime soi thought i was doing something wrong and you don't have to be and ass about it.0
-
You asked about calling function in codeunit from OnAction trigger. This does not interfere with page type. If you don't remember basic calling procedure, you should ask programmer to do it before data damage by wrong code.0
-
> @lubost said:
> You asked about calling function in codeunit from OnAction trigger. This does not interfere with page type. If you don't remember basic calling procedure, you should ask programmer to do it before data damage by wrong code.
My code was right if you check the first post but if you open Microsoft nav forum you can see their comment about addig al code to role center page.0 -
If you want to use code, you should use it in activities page contained in role center page.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