cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Default date and testing of date logic

Building Model Driven Apps in the Common Data Service.

 

@HSheild  and @v-xida-msft provided me with a great answer for filtering a lookup based upon a selection in another field.

 

https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/Cascading-filters-to-guide-foreign-...

 

However, when I come to try to do a similar thing with a date field I notice the same Display/Related Fields logic is not present.

 

1.  I want to default the selected date on opening of a date dialogue box not to the current date, but to the date set in a parent record. The use case is that having set the start date of a parent project I want the start date of a ProjectDetail entry to default to the project start date.

 

2.   I also want logic that tells me that the end date has been set prior to the start date.

 

I am guessing point 2 could be done with business rules?

 

Thanks

 

Ged

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Default date and testing of date logic

Hi @ghdunn ,

 

For point 1 you can use Relationship Mapping to default the date on the Project Detail to the Project start date.  You need to do this in the Classic Solution Explorer.  Find the 1:N Relationship between Project and Project Detail and open it.  On the left hand side you will see Mappings where you can define a new mapping.  See example screenshot below

Annotation 2020-02-10 173905.png

The Relationship Mapping works when you create a new Project Detail from within the Project record. i.e. Project Detail subgrid on the Project form.

 

For point 2, you can create a business rule to show an error message when the End Date is before the Start Date.

 

 

 

View solution in original post

1 REPLY 1
Highlighted

Re: Default date and testing of date logic

Hi @ghdunn ,

 

For point 1 you can use Relationship Mapping to default the date on the Project Detail to the Project start date.  You need to do this in the Classic Solution Explorer.  Find the 1:N Relationship between Project and Project Detail and open it.  On the left hand side you will see Mappings where you can define a new mapping.  See example screenshot below

Annotation 2020-02-10 173905.png

The Relationship Mapping works when you create a new Project Detail from within the Project record. i.e. Project Detail subgrid on the Project form.

 

For point 2, you can create a business rule to show an error message when the End Date is before the Start Date.

 

 

 

View solution in original post

Helpful resources

Announcements
secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,234)