Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

To remove the packing slip which have the returned lines

(0) ShareShare
ReportReport
Posted on by 1,479
hi 
i am working on report which brings all the packing slips but i want to remove the packing which have the return lines i.e where the quantity or amount is zero , as therecan be multiple lines for one packing slip so how can i get this done without getting the report execution slow and with proper output , what join i have to use in below query so i can get the desired output . my code is below in comments.
 
thanks ,
regards ,
Dinesh
  • Martin Dráb Profile Picture
    Martin Dráb 230,966 Most Valuable Professional on at
    To remove the packing slip which have the returned lines
    As I said, I would start by fixing the known bug. You want to relate multiple packings slips for an order but your code may fail to find some or all of them. Even if you designed a flawless solution, it would fail when with such incomplete inputs.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,479 on at
    To remove the packing slip which have the returned lines
    hi ,
    martin 
    thanks for reply ,
     is it possible to use CUSTPACKINGSLIPTRANS i am also getting quantity  and amount here , i have made the select query plz have look on it plz let me know if i can use it .
    select custPackingSlipJour.SalesId,custPackingSlipJour.PACKINGSLIPID
            from  custPackingSlipJour
    join  salesTable
          on  salesTable.SalesId = custPackingSlipJour.SalesId
    join CUSTPACKINGSLIPTRANS  
         on CUSTPACKINGSLIPTRANS.PACKINGSLIPID =  custPackingSlipJour.PACKINGSLIPID
         and  custPackingSlipJour.inventLocationId = 'W03'
         --and  custPackingSlipJour.DeliveryDate >= '2023-1-1'
         --and  custPackingSlipJour.DeliveryDate <= '2023-8-31'
    	 where CUSTPACKINGSLIPTRANS.QTY >= 0
    	  and  CUSTPACKINGSLIPTRANS.VALUEMST >= 0 
    	 group by 
    	 custPackingSlipJour.PACKINGSLIPID,custPackingSlipJour.SalesId
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,966 Most Valuable Professional on at
    To remove the packing slip which have the returned lines
    Your code still ignores the fact that a single packing slip can contain several orders. You should use CustPackingSlipSalesLink for the relation between sales orders and packing slips. I recommend you fix this bug before building more features on top of your solution.
  • Dineshkarlekar Profile Picture
    Dineshkarlekar 1,479 on at
    To remove the packing slip which have the returned lines
    hi ,
    here is my code 
       else if(LocationId != "" && salesPoolIdFilter == "")
            {
                insert_recordset dtPODReportTmp(SalesId,OrderAccount,PackingSlipId,DTDeliveryRequestId,PackingSlipDate,PackingSlipRecId,Company,inventLocationId,ShipCarrierWaybill,PlateNum, DlvMode,ShipCarrierPhone,WorkerSalesTaker)
                        select SalesId,OrderAccount,PackingSlipId,DeliveryRequestId,DeliveryDate,RecId,DataAreaId,inventLocationId,ShipCarrierWaybill,PlateNum, DlvMode,ShipCarrierPhone from  custPackingSlipJour
                    join WorkerSalesResponsible from salesTable
                        where salesTable.SalesId == custPackingSlipJour.SalesId
                        &&    custPackingSlipJour.inventLocationId == LocationId
                        &&  custPackingSlipJour.DeliveryDate >= fromDateFilter
                        &&  custPackingSlipJour.DeliveryDate <= toDateFilter;
            }
    thnaks ,
    Dinesh

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans