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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Intercompany Packing slip relation

(0) ShareShare
ReportReport
Posted on by 260

Hello all, 

I have a question that will be better explained with an example.

Example:

Legal Entity A 
Original Sales Order
Purchase Order

Legal Entity B 
Intercompany Sales Order
Release the order partially creating multiple shipments for the same SO


The whole process of packing the items to a container and posting the packing slip is done on the Entity B for each shipment using a custom form. Every time a packing slip is posted for each shipment it auto generates a packing slip on the Original Sales Order which is a standard process.
Meaning that we will have multiple packing slips for the same SO.

The client wants to update a custom field on CustPackingSlipJour for both packing slips generated on the Entity A and the Entity B. (Not all of them so I can't use the SO).
So if I have two shipments with the same SO it will generate two packing slips for the Intercompany SO, and two for the Original sales Order.

I can easily find the correct packing slip to be updated FOR the intercompany sales order since the shipment and all the info is on Entity B. However, how can I find the related Packing slip generated on the Original Sales Order?
The only way I can see is using the Intercompany PO/SO to find it, but in this case I'll have multiple packing slips I need a way to find a 1 to 1 relation between both packing slips.

Any ideas?

This code below is what I'm using at the moment, but it doesn't help.

                changecompany(salesTable.InterCompanyCompanyId)
                {
                    SalesTable intercompanySalesTable = SalesTable::find(salesTable.InterCompanyOriginalSalesId);

                    if (intercompanySalesTable.SalesId)
                    {
                        ttsbegin;
                        while select forupdate custPackingSlipJour
                            where custPackingSlipJour.SalesId == intercompanySalesTable.SalesId
                        {
                            custPackingSlipJour.customField = _customField;
                            custPackingSlipJour.doUpdate();
                        }
                        ttscommit;
                    }
                }


Thanks,

I have the same question (0)
  • Suggested answer
    greengrimms Profile Picture
    1,400 on at

    Hi,

    First of all, you're missing crosscompany syntax in your while select:

    docs.microsoft.com/.../cross-company-x-code-basics

    Second, I think if you filter by dataareaid, you should get the correct Packing Slip for your SO.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 658 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 632 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 570

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans