web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Parameters

(0) ShareShare
ReportReport
Posted on by

I'm trying to pass a parameter from my Page to my code unit. 

I have declared the function 'SalesShipmentAssignaBatch' with the parameter (recSalesShipmentLine : Record "Sales Shipment Line"). I have passed the local variables into the function. 

How ever when I attempt to save the code I get this Error Message(see below) 

Any feedback would be appreciated. If you want any other information please ask

8562.8.PNG3386.5.PNG3386.6.PNG6011.7.PNG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hey Lewis,

    Its that you called a function which shouldn't have any parameters (a.k.a 0 parameters) but you have called it with parameters. So again, click OK on the error message and system will take you to the line which the error occured.

    Hope it helps.

  • Community Member Profile Picture
    on at

    Thank you for your help! One last thing haha I'm Getting this error now 
    1031.12.PNG

    I'm sorry for being stupid, It's one of those days 

  • Suggested answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    If you have the same naming convention then the error isn't from this line. If you click OK on the error message, the system takes you to the line which you have the error. Do check is it the same line?

    Your code seems fine.

    Hope it helps.

  • Community Member Profile Picture
    on at

    3808.11.PNGSorry that would of been me messing around. I currently do have them the same. 

  • Suggested answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    You have missed the spelling I guess.

    6242.4111.9.PNG

    6242.4111.9.PNG

    You created the function in the name of SalesShipmentAssignaBatch on codeunit and calling it as SalesShipmentLineAssignaBatch on the page. It's a clear mismatch. Rather than typing out the functions/variable, hit F5 and select from the C/AL Symbol Menu.

    Hope it helps.

  • Community Member Profile Picture
    on at

    1538.10.PNG

  • Community Member Profile Picture
    on at

    4111.9.PNG

  • Suggested answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    If you are consuming the codeunit in the page, you have to declare it in that page's C/AL Globals. Attach screenshot(s) of the error please if it still persists?

  • Community Member Profile Picture
    on at

    Oddly enough I have already done this. I'll try re adding it

  • Suggested answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    You have to declare the codeunit as a variable before using its function members.

    In your Development Environment,

    View -> C/AL Globals -> Variables Tab -> Click on a New line and Add the Codeunit.

    Name: As you want.

    DataType: Codeunit.

    SubType: Codeunit Object ID.

    Hope it helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans