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

Announcements

No record found.

News and Announcements icon
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)
  • Suggested answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    On your SalesShipmentAssignaBatch() function in your Codeunit,

    instead of,

    recSerialNoInformation2."Shipment No." := "Document No.";

    recSerialNoInformation2."Shipment Line No." := "Line No.";

    use,

    recSerialNoInformation2."Shipment No." := recSalesShipmentLine."Document No.";

    recSerialNoInformation2."Shipment Line No." := recSalesShipmentLine."Line No.";

    Check other errors like this.

    Hope it helps.

  • Community Member Profile Picture
    on at

    Thankyou. New error however when I attempt to save the Page Im getting an error saying "SalesShipmentLineAssignaBatch" Define the variable under 'GLobal C/AL symbols". How do I deal with this?

  • 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.

  • 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,

    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

    4111.9.PNG

  • Community Member Profile Picture
    on at

    1538.10.PNG

  • 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

    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,

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
TAHER_El_Mehdi Profile Picture

TAHER_El_Mehdi 2

#1
sliderxb Profile Picture

sliderxb 2

#1
broberts Profile Picture

broberts 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans