Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Calculate sales totals for partial quantity in X++

(0) ShareShare
ReportReport
Posted on by 2,015

Hi Techies,

We have a requirement where we need to get sales invoice totals from 'Totals' form of Sales orders. But here we need to modify the quantity and take the amount only for modified quantity in logic.

salesTotals = SalesTotals::construct(salesTable, SalesUpdate::All);
salesTotals.calc();

For instance - Suppose There is sales order having 2 sales lines with total sales qty 20 and each line is having 10 sales qty.  Standard will show invoice amount on Sales totals form based on total qty of Sales order i.e., 20. But in our case , Out of 10 qty of first sales line , if we are doing work creation of partial 4 qty then invoice amount should be calculated based on 4 qty of first sales line and that amount to be shown up on new customize report before doing actual invoicing.

pastedimage1661922454956v1.png

Can anyone guide on this please.

Thanks in advance.

Sangram

  • Reliable Profile Picture
    2,015 on at
    RE: Calculate sales totals for partial quantity in X++

    Thank you for reply Judy.

    I guess we have found the solution.

    We've populated SalesParmTable and SalesParmLine tables with Sales order details and updated SalesParmLine.DeliverNow quantity as load line quantity, which we are looking for.

    Now constructed SalesTotals with salesParmTable with document status as confirmation.

    salesTotals = SalesTotals::construct(salesParmTable, SalesUpdate::All, AccountOrder::None, salesParmTable.ParmId, salesParmTable.SalesId, DocumentStatus::Confirmation);
    salesTotals.calc();

    This code worked with modified quantity (load line quantity) and given the expected result.

  • huijij Profile Picture
    19,801 on at
    RE: Calculate sales totals for partial quantity in X++

    Hi Sangram,

    What have you done so far and have you encountered any challenges?

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Jahanvi Profile Picture

Jahanvi 34

#2
PJ JohnPaul Profile Picture

PJ JohnPaul 5

#3
SudhanshuMSID Profile Picture

SudhanshuMSID 1

Overall leaderboard

Product updates

Dynamics 365 release plans