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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

Post packing slip using shipment through x++ in Dynamics AX 2012

(0) ShareShare
ReportReport
Posted on by

Hello,

I am trying to post a single packing slip for multiple sales orders through code using wmsshipment.

If I only use this line of code:

     SalesFormLetter.update(wmsShipment,systemDateGet(), SalesUpdate::DeliverNow, AccountOrder::Account);

Instead of posting packing slip for one specified shipment, it includes lines from all sales orders that are ready to to pack slip posted.


But if I do this:

    Set shipmentsToPostSet = new Set(Types::String);  
    WMSShipment wmsShipment = WMSShipment::find('SHP0000034');

    shipmentsToPostSet.add(wmsShipment.shipmentId);  
    salesFormLetter.parmLineIdSet(shipmentsToPostSet.pack());  
    SalesFormLetter.update(wmsShipment,systemDateGet(), SalesUpdate::DeliverNow, AccountOrder::Account);

It posts packing slips only for sales orders associated with the shipment but creates separate packing slips for each sales order.

I want to get it to consolidate the packing slip.

Can anybody please help with this issue if you have any information?

Thanks,

Charu Jadhav

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Have a look at the PackingType on the wmsShipment record you're passing.  If it's set to WMSPackingType::Order then your AccountOrder is going to be ignored and set to AccountOrder::None.  See the SalesFormletterParmDataPackingslip.chooseLinesFromWMSShipmentSet() method call for where it's probably happening.

  • Community Member Profile Picture
    on at

    Thanks Justin! This is exactly what I was looking for, that solved my problem after days of research!

    Charu

  • BAuza Profile Picture
    5 on at

    Did you ever resolve this issue?

    thanks

    B. Auza

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans