Calling a procedure from a codeunit on action button

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?
when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.

Best Answer

  • CryptonicCryptonic Posts: 11
    edited 2019-02-04 Accepted Answer
    .
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.

Answers

  • Slawek_GuzekSlawek_Guzek Posts: 1,684Member
    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-03
  • CryptonicCryptonic Posts: 11Member
    So what's the correct form to do it ?
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • JuhlJuhl Posts: 670Member
    Depends on you want to run your own function or the OnRun function.
    Follow me on my blog juhl.blog
  • CryptonicCryptonic Posts: 11Member
    I want to run one of the functions in the codeunit
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • JuhlJuhl Posts: 670Member
    Then Slaweks first line
    Follow me on my blog juhl.blog
  • CryptonicCryptonic Posts: 11Member
    I tried it and it didn't work when i click on the button nothing happen
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • CryptonicCryptonic Posts: 11Member
    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 SHUSH
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • CryptonicCryptonic Posts: 11Member
    edited 2019-02-04 Accepted Answer
    .
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • CryptonicCryptonic Posts: 11Member
    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.
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • lubostlubost Posts: 555Member
    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.
  • CryptonicCryptonic Posts: 11Member
    > @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.
    when you don't create things, you become defined by your tastes rather than ability. your tastes only narrow & exclude people. so create.
  • lubostlubost Posts: 555Member
    If you want to use code, you should use it in activities page contained in role center page.
Sign In or Register to comment.