Hi guys,
I'm trying to make use of class called "TaxRegulation"
TaxRegulationDetail taxRegulationDetail = TaxRegulation::newTaxRegulation(salesTotals.tax()); TmpTaxRegulation tmpTaxRegulationDetail = taxRegulationDetail.tmpTaxRegulationDetail();
but currently hit error like this :
The error as in the picture is hit on the 1sts line, may I know how to resolve this ?
The intention is to get TaxRegulation data based on sales line.
Thanks,
This is solved. After learning the class TaxRegulation already can handle the selection for TaxRegulationDetail based on AR - Parameters, Ledger & sales tax -> Enable tax adjustment in detailed mode.
When it is selected, TaxRegulation will be cast as TaxRegulationDetail.
Thanks,
Hi,
The SalesTotal have a buffer as well as TaxRegulation.
As in this screenshot :
But I think the "taxRegulationDetail" is not correct/working as it is still null.
I tried to take a look at class TaxRegulationDetail, and the remarks says it "manages tax adjustments at the invoice line detail level", does it means this class only handle data at Invoice level ?
As my process, Sales Order, is not invoiced yet.
For the class TaxRegulation itself actually also have method "taxRegulationDetail" but it is set to Null ->
How to get data per Sales Line exactly ?
Thanks,
Your code seems to be correct. This error comes when the object does not have any value. Can you check if salesTotals have a buffer and also in the tax regulation?
Hi Bharani,
Yes, sorry, I realized this just now, then I'm changing it to this :
TaxRegulation taxRegulation = TaxRegulation::newTaxRegulation(salesTotals.tax()); TaxRegulationDetail taxRegulationDetail = taxRegulation as TaxRegulationDetail; TmpTaxRegulation tmpTaxRegulationDetail = taxRegulationDetail.tmpTaxRegulationDetail();
But it looks it is not the correct way either, since I then have error on the 3rd line
Can you help me to understand the error and how to use it correctly ?
The TaxRegulationDetail is an extend class of TaxRegulation.
Thanks,
Here you have created the class object but you are calling a different class. It should be like,
ClassName classObj = ClassName::method name(param1);
Similarly for second line also. But can you tell us why you are calling another class here?
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156