Announcements
No record found.
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
Hi,
Could you provide some more information like exactly what kind of rebates(custom/standard) are you looking for.
Thanks,
Chaitanya Golla
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.
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.
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CP04-islander 26
imran ul haq 8
André Arnaud de Cal... 4 Super User 2026 Season 1