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 :
Small and medium business | Business Central, N...
Suggested Answer

How can I set a variable as parameter of OnCreatePick function?

(0) ShareShare
ReportReport
Posted on by 25

Hi team, 

We are trying to call the native function OnCreatePickDocOnBeforeCreatePickDoc, which asks for the following parameters: (Rec, WhseShptLine, WhseShptHeader2, HideValidationDialog, IsHandled), we handle to pass most of these parameters, but not sure how to pass the Rec, because this Rec is the Warehouse Shipment Line where the function is supose to be run native, but we are running our development from Purchase Order, so the Rec is Purchase Order instead of Warehouse Shipment Line. We are trying to pass the Warehouse Shipment Line instead of Rec, but getting the following error:

pastedimage1681418093879v1.png

Any ideas that could help us?

Thank you in advanced.

I have the same question (0)
  • malte610 Profile Picture
    5 on at

    Hi Antea,

    I really hate to be this guy, but you should really look into the documentation. A record variable can represent just the structure of a table or contain data. The error you are receiving says basically you are trying to pass a simple data type into a complex. In other languages this would be like trying to pass in string where a class is expected. Furthermore, I am not completely, sure but I can't imagine situation where you want to create a Warehouse Shipment Line/Pick from a Purchase Order right now. Although I could be wrong. Usually Purchase Orders are associated with Warehouse Receipt Line and Put-Away.

    By the way: there are many free courses

    I hope this points you into the right direction.

    Malte

  • Suggested answer
    YUN ZHU Profile Picture
    98,421 Super User 2026 Season 1 on at

    Hi, You use Alt + Shift + E to search for OnCreatePickDocOnBeforeCreatePickDoc in VS Code, and when you add it, it will automatically display the variable name.

    For example,

    pastedimage1681429686942v1.png

    pastedimage1681429702601v2.png

    Also, you find the location of this event and you can see it.

    pastedimage1681429727370v3.png

    Hope this helps.

    Thanks.

    ZHU

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,850 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,045 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans