DIEF Issues: Discount Values Aren’t Importing Properly

By Tom Branca | June 1, 2017

DIEF Issue:

When we were trying to import sales and purchase lines with a discount amount or percentage tied to the Data Import Export Framework (DIEF), the values weren't importing. If you look at the stage to target mapping, it’s a direct mapping so you would think yourself “Boy – this should work, why isn't it bringing in the value?”

DIEF Resolution:

In reviewing the situation, what I found out is that it’s the sequence in which things happen that’s the problem. You probably don’t pay much attention to the “Sequence” in the “Map staging to target” form, but this is ultimately what was causing the issue.

There is a function called generateDefaultSalesLineData() which has the sequence value of 3. Basically, the fields we are focused on are:

  1. LineDisc
  2. LinePercent

Both these fields had a Sequence number of zero. This means they are brought in prior to the generateDefaultSalesLineData method is run. Since this is the sequence of events, it throws the values out of whack so all we to do is update LineDisc and LinePercent Sequence values to something greater than 3. I updated LineDisc and LinePercent to 4 as seen in the screenshot below and when I imported, the discount amounts started to show up for Sales Lines. I did the same thing for PurchLines as well, just on the appropriate entity.

discount-values-importing-tom-branca

NOTE: In later versions of AX 2012, this has been fixed. I believe the sequence number is 12.


Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.

Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!