Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Can I access code unit as a field on an exisiting page ?

Posted on by 50

I am very new to NAV and have few questions.

I created a page which is pointing to a table and have corresponding fields. I have an existing code unit , that take 2 input parameter, which I can get from the fields of the table.

Can I use the output of the code unit as one of the field of page and fields of page as input to codeunit? If possible then can anyone please give me directions ?

Thank you so much !!

*This post is locked for comments

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Can I access code unit as a field on an exisiting page ?

    You need to open View-->Cal Globals

    Give a proper Name(ex: X) and Data type as Codeunit and Subtype as codeunit name or ID

    Then in the Sourceexp propertie, click F5

    Select Codeunit Name X and in the right side you will see all function names

  • kdynamics Profile Picture
    kdynamics 50 on at
    RE: Can I access code unit as a field on an exisiting page ?

    Thank you so much Mohana,

    Please correct me. So far what I did, was

    > added a field to a page. (other fields are pointing to a table)

    > right click on field , select properties.

    > selected sourceExpr:  > CODEUNIT > Codeunits > "Name of code unit"

    when I select that codeunit Name , this is where I was wondering if I can plug one of the field to  codeunit methods. If not then how should I achive the same task ?

    Really appreciate your help!

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Can I access code unit as a field on an exisiting page ?

    Yes, did you try by adding below statement in SourceExpr of field in page

    Codeunitname.Functionname(Parameter1,Parameter2);

    Codeunitname is a variable declared as codeunit

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans