Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Sorting issue while importing data using data entity.

(0) ShareShare
ReportReport
Posted on by 110

Hi experts,

We have extended EcoResReleasedProductV2Entity and made customized Data Entity to upload Items based on defined Item Group in Data Entity. As 'ItemNumber' is a mandatory field, we have to provide some distinct values in 'ItemNumber' column in data entity.  

We have added custom code in 'postGetStagingData()' to manipulate the records and updating 'Item Numbers' based on given groups before inserting to target table.

Issue- 

If we have next value for 'RM' (Raw Materials) item group as RM0001 and we are uploading below items along with other details -

ITEMNUMBER INVENTORYUNITSYMBOL
PRODUCTGROUPID
PRODUCTDESCRIPTION
Item-6 Pcs. RM Item-6
Item-7 Kg RM Item-7
Item-8 Pcs. RM Item-8
Item-9 Kg RM Item-9
Item-10 Kg RM Item-10

While importing the data in dev environment and Testing01 (Tier 2) environment, our result is coming as expected - 

ITEMNUMBER INVENTORYUNITSYMBOL ITEMMODELGROUPID PRODUCTDESCRIPTION
RM0001  Pcs. RM Item-6
RM0002 Kg RM Item-7
RM0003 Pcs. RM Item-8
RM0004 Kg RM Item-9
RM0005 Kg RM Item-10

but when importing data in UAT (Tier2) environment, the results are coming as -

ITEMNUMBER INVENTORYUNITSYMBOL ITEMMODELGROUPID PRODUCTDESCRIPTION
RM0001  Pcs. RM Item-10
RM0002 Kg RM Item-6
RM0003 Pcs. RM Item-7
RM0004 Kg RM Item-8
RM0005 Kg RM Item-9

Requesting the help / opinion / advice on why in certain environment Item-10 is being considered at first then others and assigned first number sequence whereas it should be Item-6 as RM0001. 

  • No sorting applied on data.
  • Product version and platform version and code is same across all the platforms. Product version: 10.0.30, Platform version: Update54
  • Using same MS Office version to import to all environment. 
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,031 Super User 2025 Season 1 on at
    RE: Sorting issue while importing data using data entity.

    Hi Piyush,

    The inventory unit symbol seems to be mixed up as well. I would suggest reviewing the customization or share the coding with us.

    Have you also considered providing the new item number already in the source file?

  • piyush004 Profile Picture
    piyush004 110 on at
    RE: Sorting issue while importing data using data entity.

    Hi Experts,

    Ludwig Reinhard , goshoom , Andre Arnaud de Calavon, nmaenpaa

    Please advise.

  • piyush004 Profile Picture
    piyush004 110 on at
    RE: Sorting issue while importing data using data entity.

    Hi Mohit,

    Thank you so much for responding.

    We doubt the same thing first but we believe that's not the case. We have written our logic to modify the data after getting into Staging table in postGetStagingData method.

    We are not able to regenerate the same issue in other testing environment except one. We also debugged by linking UAT DB to Dev environment. In that way only we found that data itself is coming in wrong sorting order to staging table.

    Thanks.

  • piyush004 Profile Picture
    piyush004 110 on at
    RE: Sorting issue while importing data using data entity.

    Hi Martin,

    Thanks for responding. Big fan of your work and contributions.

    Yes Martin, we are still getting the same results after keeping Import task count as 1. 

    There are more findings as below- 

    • If we keep the 'ItemNumber' in excel as Item-06 (not Item-6), the number sequence assignment is proper as long as number wont exceed from Item-99 to Item-100.
    • If we sort the 'ItemNumber' column in excel, the numbers are getting sorted in similar way as they are getting inserted in staging table 
      • Item-10
        Item-6
        Item-7
        Item-8
        Item-9

    Eventually we found the solution which is to keep the number of digits same.

    Let say if we have 100 items to upload, we have to give 'ItemNumber' in excel like Item-001. With series of Item-001, Item-002..Item-999, we can import upto 999 items at once. But the moment we will use Item-1000 along with series of Item-0001, Item-1000 will be assigned to number sequence first thenItem-001, Item-002..Item-999

    Not sure why it is happening, we are considering this as workaround but still have to provide RCA for this issue. 

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Sorting issue while importing data using data entity.

    Hi Piyush, As you mentioned you have extended postGetStagingData method to manipulate Item Number so i am assuming it might be occuring due to that code and probably existing data. Can you share the code and also try importing UAT database in your Devbox so can you can debug why Item-10 is considered first.

  • Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    RE: Sorting issue while importing data using data entity.

    Will you get the same result if you set Import task count for the entity to one (in Entity import execution parameters)?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans