web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to get the shipping charge amount?

(0) ShareShare
ReportReport
Posted on by

I added a shipping charge to a delivery mode, and when I click the totals button, the charge appears on the display screen. In order for AX to display this charge amount, it must be grabbing the charge I set from somewhere. How to I grab this information? I provided a screenshot for the information that I want to grab below. Note that the total charges is the shipping charge that I set for the item. If there were other charges, I assume this value would be the sum of those charges. I only need to acquire the shipping charge, which in this case would be the $88.88.   Is there some sort of getter for this info? Something along the lines of  table.fieldName. I passed the instance of the SalesCalcTax_Sales instance into my post event handler, from this I found the recID of the salesTable. Can I use any these to help me get to the charge amount. I cant find a field in the salesTable or any of the salesLines that hold a shipping charge

7120.Capture.PNG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi vfrasheri,

    You need to look at MarkupTrans it holds charge amounts. Maybe this blog post could help you, there is an example how to join salesLine with markupTrans daxonline.org/1516-how-to-calculate-charge-markuptrans-amount-from-code.html

    Or you can simple debug totals class to see how it's get calculated.

  • Community Member Profile Picture
    on at

    Thank you Ievgen,

    By using the salesLine recID I obtained the markupTrans line that had information on charges. However, I'm not entirely sure what this amount means. I pull the information from the "value" field in markupTrans. It states that value is "value attached to the charges category." There wasn't a specific field for shipping charge. Since the only charge I added to the order was a shipping charge, it pulled the correct amount. However, could there be another type of charge that could be added to a sales order that would cause "value" to change. For example, instead of being just shipping charge, could "value" represent (shipping charge + some other charge + a third charge)? If so how do I isolate the shipping charge? (Prefer not to do math. For example take the value amount and subtract the other charges to get the shipping charge. If math is the only way then I can resort to it, but I'd rather pull a field)

    The only other place that I know I can add charges is the "sales charges" in the sales order page under "line details> Price and discounts" when I am creating the order.  This added to the lineAmount field in the salesLine, not the "value" field in markupTrans.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi vfrasheri,

    Each markup trans has a code(MarkupCode field). When you do a setup of shipping charges you specify this code. Now you need to select only those trans that have shipping code. Also please don't use value directly, as you can see from that blog post there is a method to calculate a value with some logic.

  • Community Member Profile Picture
    on at

    Dear Ievgan,

    I added an extra line to my code to pull only the markupTrans whose MarkupCode == "SHIPPING" and now I pull only the shipping charge. I'm running into another issue however. In my auto charges, the shipping charge I set is with a specific mode of delivery code and mode of delivery relation. When I change the mode of delivery relation, the shipping charge still gets applied to my order. I created 2 sales orders, each were exactly the same, except the mode of delivery relation. Only one of the orders should have the charge applied. (This has nothing to do with my code. AX displays the shipping charge for both on the display screen after "totals" is clicked). How can I make the shipping charge apply only to sales orders with a specific mode of delivery relation?

    I'm going to make a separate post with this same question and mark this as answered, since my original question was answered. But feel free to respond to this post here, if you have the solution to this issue. Thank you for all your help so far.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans