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 :
Microsoft Dynamics AX (Archived)

Link Rebate Value to SalesLine or Header

(0) ShareShare
ReportReport
Posted on by

How do I link the rebate value to a particular sales line? I'm trying to find the rebates that link to a specific sales order. 

Looking for the tables and relations. Thanks!

*This post is locked for comments

I have the same question (0)
  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Could you provide some more information like exactly what kind of rebates(custom/standard) are you looking for.

    Thanks,

    Chaitanya Golla

  • JoeSeroski Profile Picture
    on at

    Customer rebates or item rebates that would be related to a sales order. So, I suppose anything tied to a rebate agreement? For example, we have a SalesLine and customer rebate groups and item rebate groups. I've found PdsRebate, PdsRebateTable, but I am unsure what to be looking for. What I want to figure out is on a particular sales order, we got, for example, $1000 in revenue. Of that $1,000 we gave away $200 in rebates. I'm wondering if there is a way to find the rebate value by Sales Order or if the Rebate value would be related via Invoice number.

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    You can either check the view PdsRebateExpanded or use the below job to find rebates for a given invoice

    static void Rebate(Args _args)

    {

       PdsRebateTable pdsRebateTable;

       PdsRebateTrans pdsRebateTrans;

       CustInvoiceJour custInvoiceJour;

       CustInvoiceTrans custInvoiceTrans;

       SalesLine        salesline;

       PdsRebateAgreement  pdsRebateAgreement;

       

       while select pdsRebateTable

       where pdsRebateTable.SalesId == "SalesId1" && pdsRebateTable.SalesInvoiceId == "XYZ"      

       join pdsRebateTrans

       where pdsRebateTrans.PdsRebateId == pdsRebateTable.PdsRebateId

       join custInvoiceJour

       where custInvoiceJour.InvoiceId == pdsRebateTable.SalesInvoiceId    

       join custInvoiceTrans

       where custInvoiceTrans.SalesId == custInvoiceJour.SalesId

       && custInvoiceTrans.InvoiceId == custInvoiceJour.InvoiceId

       && custInvoiceTrans.InvoiceDate == custInvoiceJour.InvoiceDate

       outer join salesline

       where SalesLine.RecId == pdsRebateTable.SalesLineRefRecId        

       outer join pdsRebateAgreement

       where pdsRebateAgreement.RecId == pdsRebateTable.RebateAgreementLineRefRecId

       {

           info(strFmt("%1, %2", pdsRebateTable.SalesId, pdsRebateTable.SalesInvoiceId));

       }

    }

    Hope this information helps you.

    Thanks,

    Chaitanya Golla

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans