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 :
Customer experience | Sales, Customer Insights,...
Answered

Best practice to create an order, how to pre-fill the "name" in custom entity

(0) ShareShare
ReportReport
Posted on by 15

I am adapting a Access database application, that is an internal order system.

I have the following tables:

Products

ProductId ProductName
1 Product1
2 Product2

Orders

OrderId Owner
1 User1
2 User1

OrderItems

OrderId ProductId Quantity
1 1 10
1 2 10

So, I created a custom entity for these, set up the 1:N relationship between the orders and orderitems, and a lookup that reads the products in an orderitem. This is a direct conversion from the database, not sure, if this is the best approach. Suggestions welcome.

I have problems with the default "Name" primary column as I do not really need this for the orders and orderitems, at least not filled by the end users. The best would be if I could pre-fill this field with the primary key. I am trying to as much out of the box functionality, and I didn't find any way to do this. Tried to use rules, but I cannot select the Id field, because it is number. I also tried to change the primary field column data type, but there's no other possibility than text. I can see that I can make it optional, but this would make other operations like search and lookup difficult.

Can someone please point me to the right direction?

I have the same question (0)
  • Suggested answer
    Ankit Sabharwal Profile Picture
    on at

    Hy,

    Hope you are doing well and safe.

    IF the requirement is to prefill the name attribute, you can use the auto number feature. You can select the format as well for this which suits your requirement.

    Thanks,

    Ankit Sabharwal

  • vilmarci Profile Picture
    15 on at

    I think you mean this:

    1. Create an autonumber field
    2. Create a rule to set the Name column default value to this autonumber field

    Am I right? Will this work, won't there by an issue with the data type?

    I found this document docs.microsoft.com/.../create-auto-number-attributes to create an autonumber field, is this really the only way?

  • Verified answer
    Ankit Sabharwal Profile Picture
    on at

    I believe you can set the autonumber feature to the name field only. Regarding the data format, auto number can be applied to single line of text field and it should work.

    This is the approach which I can think about which uses OOB functionality and also supported in nature.

    You can use Auto Number Manager plugin of Xrm toolBox  : https://jonasr.app/2019/02/anm-existing/ 

    Hope this helps.

    Best regards,

    Ankit

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    vilmarci Profile Picture
    15 on at

    Thank you, this tool is awesome :)

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans