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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model driven app onloa...
Power Apps
Unanswered

Model driven app onload event to create ID directly through the New button

(0) ShareShare
ReportReport
Posted on by

Hi guys, I'm currently on Dataverse and building a Model Driven App (MDA). Let's say I have a table named Customer Feedback and the primary column is Feedback ID with Autonumber data type, and already properly configured into a MDA.

By default, the homepage will be the View page. Whenever the user wants to create a new record, the user will have to click on New button on the View page which leads to the main form. The user will then fill up the form and click on Save. A new record is then created and a new Feedback ID being generated after clicking on the Save button.

 

The question is: Can I create a new record and generate a new Feedback ID right after I click on the New button? Without having to click on the Save button.

 

I'm thinking of using the Onload Event Handler in form configuration by bringing in javascript. If this is a feasible way can any one of you help to provide the javascript code to perform this action? Thanks.

 

I have the same question (0)
  • Verified answer
    ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @Anonymous,

     

    The AutoNumber column won't show its generated value until the record is saved. You can use JavaScript to save OnLoad using formContext.data.entity.save() ., or you could create a custom Command Button and use a PowerFX formula to create the new record then Navigate to the form.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • Bipin D365 Profile Picture
    971 on at

    Hi, 

     

    Auto number column value generated on Save because it runs server side. 

     

    I don't think using javascript you will be able to generate this field value unless you write your own code to generate the Sequence using Cutom action c# code and call Custom action from Javascript onload. However OOB Auto number column value  it will be difficult to retrieve/generate using javascript.

     

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: https://xrmdynamicscrm.wordpress.com/

  • Community Power Platform Member Profile Picture
    on at

    Hi @ChrisPiasecki,

     

    Thanks for the solution. I have tested the Javascript method and it works. However, it has some interference with another OnSave function that I have. 

    Can you show me the PowerFX formula to achieve the said objective? 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard