cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

CDS Forms - Gallery relationship

Hi 

 

I created a Screen with Form1 and Gellery1

 

Form 1 has basic information like VoucherNo, Create Date, Amount and Description. Datasource - Commission

Gallery1 is a repeating with fields Salesperson, Commission etc. - Datasource - CommissionDetails - collection

 

Below is the sample of my submit button. As you can see I was trying to get the DocID and VoucherNo to get a key relationship. This code works on SQL but not on CDS.

 

On CDS I created two entities Commissions and CommissionDetails thereby Commission is the Main Header for my Form and Gallery respectively.

 

I need to establish a relationship between these two entities so far it's been unsuccessful. I would appreciate some help. 

 

Patch(Commissions,Defaults(Commissions),
{cr684_amount:Value(DataCardValue7.Text),
cr684_description:DataCardValue5.Text,
cr684_comments:DataCardValue25.Text
});

ForAll(CommissionDetails,Patch('Commission Details',Defaults('Commission Details'),
{cr684_employeeid:EmployeeID,
cr684_salescommission:Commission,
cr684_commissiontype:CommissionType,
cr684_salesrep:SalesPerson,
cr684_description:DataCardValue5.Text,
DocID:'New Voucher'.LastSubmit.'Voucher No'}));
Navigate(Application_Portal,Cover);Navigate('Launch Screen', ScreenTransition.Cover)

 

Thanks

Dickson

1 REPLY 1
Highlighted
Microsoft
Microsoft

Re: CDS Forms - Gallery relationship

Hi Dickson, 

 

In this document you can see an entity relationships overview.

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/create-edit-entity-relationship...

 

I hope it helps you.

Javi.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,800)