cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SteveCampbell
New Member

Accounts and Contacts in Dynamics 365

EDIT: Found the error was the row limit. I had more contacts than the 500 / 2000 max limit. It pulls all the data in, then filters. Is there any way to push the query to limit the incoming data in dynamics?

Hi all,

 

New to dynamics. 

Requirements:

  • User selects an account
  • Contact are disaplyed for this account, and all linked accounts

I only need to go 1 level deep, i.e. accounts linked directly to the selected account

 

I have this code that lists all accountid that I'm interested in

ClearCollect(
ListConnections,
{_record1id_value: GUID(SelectedID)}
);
Collect(
ListConnections,
Filter(
Connections_1,
_record2id_value = GUID(SelectedID)
)._record1id_value
)

that returns a collection of all accounts and immediate related accounts.

I'm trying to return contacts.

 

 

Filter( Contacts_1,  GUID(_parentcustomerid_value)
 in ListConnections._record1id_value )

Somthing like this, but it never returns anything. I can see the _parentcustomerid_value and _record1id_value match, but it will not join correctly.

 

Thank you!

2 REPLIES 2
caburk
Power Apps
Power Apps

Have you tried using CDS views? This delegates the query to the server.

https://powerapps.microsoft.com/en-us/blog/preview-for-improve-data-source-experience-and-common-dat...

v-xida-msft
Community Support
Community Support

Hi @SteveCampbell ,

I found that you have posted similar issue within this forum already, please check my response within the following thread:

https://powerusers.microsoft.com/t5/Creating-Apps/Filter-contacts-from-Dynamics-365/td-p/365468

 

Based on the formula you provided, I think there is something wrong with it. Actually, the 'Company Name' (parentcustomerid) column is a Polymorphic lookup field in CDS Entity, which could references records from Accounts Entity or Contacts Entity, please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-references#show-the-fields...

 

In addition, the 'in' operator is not delegable within Common Data Service connector within PowerApps. If you use 'in' operator in your formula, you would face a Delegation warning issue.

Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/commondataservice/#powerapps-delegable-functions-and-ope...

If you faced a Delegation warning issue with your formula, you could not delegate the data process to your data source, instead, you could only process your data locally. In default, you could only process 500 records locally at most. You could change the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app, then you could process 2000 records locally at most.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (4,208)