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

Default field based on Form / PowerApp selected?

(0) ShareShare
ReportReport
Posted on by 10

Just starting to foray into the world of Model Driven Apps / D365 Sales in general, so apologies if this is in the wrong spot.

Essentially, we're using D365 sales for both Contract sales and Service sales. We have one business flow that forks depending on if the user selects "Contract" or "Service" when they create the opportunity. However, if I create a separate Model Driven App for Contract and Sales instead, would there be a way to default that field depending on the app they are in? i.e. if they're in the Contract app and they go to create a new opportunity, it automatically defaults that field to Contract, and vice-versa. Or is there a way to do that on the form level, so like I have one app default to a Contract form, which automatically defaults that in?

Thanks for the help!

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    While setting up Model driven app you can define particular form for your entity, so just like in the below app designer you can see I have selected only one form for account so in this model driven app user will be able to see this particular form only not other, similarly for the other app you can select different form, Further you can have script/business rules on the form to set default field accordingly.

    appdesinger.jpg

  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    You can write JS code on load of javascript and use client api to get current model driven app name.

    docs.microsoft.com/.../getcurrentappname

    And based on app name you set the field value.

    Please mark my answer verified if i were helpful

  • Verified answer
    LuHao Profile Picture
    40,892 on at

    Hi mick,

    If you want to do this with no code, then you can select individual forms in different app designers to make users to only access specific forms when they are within a specific app. This way, users will only see the Contract form and Contract fields within the Contract app, and the Service form and Service fields within the Service app.

    pastedimage1602229021346v1.png

    pastedimage1602229058903v2.png

    However, currently D365 has a bug where if there is only one form for an entity in an app designer, then when you select a record from the view and go to its form in the app, only the default form is displayed, not the form that was selected in the app designer.

    Please refer to https://community.dynamics.com/365/sales/f/dynamics-365-for-sales-forum/404007/issue-with-form-refresh-in-uci

    So we have to select at least two forms for Opportunity in the Contract app and Service app.

    In the Contract app designer, one form is Contract form, another is an unrelated form A, Contract form need to be set at the top of form order.

    In the Service app designer, one form is Service formanother is an unrelated form A, Service form need to be set at the top of form order.

    In other words, Form A may be at the bottom.

    pastedimage1602227926398v1.png

  • mick_swartz Profile Picture
    10 on at

    This is perfect, thanks everyone for the help! Bug workaround worked as well.

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 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans