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 :
Finance | Project Operations, Human Resources, ...
Answered

Data entity import (insert)

(0) ShareShare
ReportReport
Posted on by 901

hello guys,

This is just a 'long shot', just wondering, when we created Data Entity, and it will be used for import data from other platform (not F&O), how can we handle the number sequence that setup in one of the field ? I mean when we insert data into this entity, while this field is put as mandatory, but we don't have the new number sequence yet, and we don't know what is the next number sequence for this particular field, but still it is mandatory and need to be inserted.

Thanks,

I have the same question (0)
  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You have two options. Either numbers are set from outside. Or your entity will assign them automatically.

    It sounds like you want the latter case, but you didn't actually implement it yet. Is that correct?

  • Suggested answer
    Luke Sha Profile Picture
    on at

    if this is custom entity.  you may not setup this field as mandatory but keep it mandatory in the target table. Then you import data to staging table first with specific logic to generate NS based on setup.  Be aware this kind of design will slow down the performance and cause conflict issue in parallel thread importing.

  • Tony zhong Profile Picture
    901 on at

    Hi Martin,

    You're right, I expect the later, number sequence is still handled by F&O. And yes, haven't implement yet, it is on design step, then I realized this is quite unclear how to handle.

    How the entity will assign automatically then ? Should I create stuff like Set based entity whereby upon inserting we will execute the NumberSeq function ?

    Based on Luke's comments, means, for example SalesOrder entity, in the entity it self, Sales Id will put as non mandatory, but in SalesTable of F&O, of course it is still mandatory. And as my other platform is actually a CDS Virtual entity, over there I will put Sales Id as "Optional", is it something like that?

    Thanks,

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    If you want to use SalesOrder as an example, simply look at how it's done there. This is what you'll find in initValue() method of SalesOrderHeaderV2Entity:

    public void initValue()
    {
        if (!this.skipNumberSequenceCheck())
        {
            NumberSeqRecordFieldHandler::enableNumberSequenceControlForField(
                this, fieldNum(SalesOrderHeaderV2Entity, SalesOrderNumber), SalesParameters::numRefSalesId());
        }
    
        super();
    }

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You can do it without any development.

    In the import file, provide an empty salesId: <SalesId />. In the data project mapping, set this field to be Auto generated.

    Now it should assign sales ids from the number sequence during the import.

  • Tony zhong Profile Picture
    901 on at

    Oh I just realized this. but where to set skipNumberSequenceCheck() in a data entity ? I tried to "Go to definition" but it is not direct me to anywhere else.

    Also the checking is when !skip, means for my import case, I supposed I should  set to skip, right ? then it will go to super(),  for data entity, what is the super() go to ? to the underlying table initValue()

    I'm sorry, I'm still quite 'blur' on this and it will be more saving time if I do not need to do trial and error.

    Thanks,

  • Tony zhong Profile Picture
    901 on at

    Hi,

    I'm so sorry, it is also quite misleading with the "import" thing, because it is not import like in DIXF. My platform that will transfer data to F&O is actually from CDS, and we want to try to use Virtual entity. Only as mentioned before, it is not yet implemented, but I guess it will not an import but insert activity from PowerApps through CDS Virtual Entity.

    Thanks.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    No, you shouldn't skip the logic for number sequence, because it's exactly the logic you want. If you wanted to always skip it, you wouldn't have to bother adding it to initValue() at all.

  • Tony zhong Profile Picture
    901 on at

    Is there actually any document or guidance to do all this ? Sorry about the title mistakes, it is actually not about import, and definitely not about DIXF, but insert data through CDS Virtual entity, using Power Apps. Anyway this virtual entity in CDS does a usual Entity in F&O.

    And one of the concern or confuse is how to handle the number sequence when we insert the new data from that PowerApps to F&O.

    Thanks,

  • Suggested answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    I'm sorry, but I can't solve your problem if you don't tell us what problem you have.

    Dataverse virtual entities communicate with F&O via OData. If you didn't try my solution because you believe that it won't work with OData services, then you should leave this assumption. It works both with data management and OData.

    If you tried it but you have a problem with it, you should explain the problem. Maybe you didn't implement it correctly, maybe the number sequence isn't set up correctly, maybe you don't test in the right way... We can't know.

    I don't think you'll find much more information than I already gave you, but you can always use your favourite search engine to try it. For example, here is the same same solution, but explicitly used via OData: Generate number sequence values from REST services and OData.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans