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
*This post is locked for comments
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.
Thank you for your help! One last thing haha I'm Getting this error now
I'm sorry for being stupid, It's one of those days
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.
Sorry that would of been me messing around. I currently do have them the same.
Hi,
You have missed the spelling I guess.
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.
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?
Oddly enough I have already done this. I'll try re adding it
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156