Skip to main content

Notifications

Power Pages - Customize & Extend
Suggested answer

Filter Lookup bases on N:N relationship

(0) ShareShare
ReportReport
Posted on by 2
HEllo , 

I have a 4 tables :
Product table (virtual table from SAP)
Contact table (standart table)
Contact-Product  (Contains the contact and product information as I cannot create N:N relationship for virtual tables)


In another table called Item I have a lookup to Product , so it shows all the products, 

I want to filter this lookup to show only the product the user have access to based on the Contact-product table

How I acheive that, I dont want to create relationship between Contact-product and Item , because  the contact product it's not used in the  SAP, 


 
Categories:
  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 1,827 on at
    Filter Lookup bases on N:N relationship
    Pls try the following:
     
    In your Item lookup's View definition, use FetchXML to filter products based on the current user's access:
    <fetch>
      <entity name="product">
        <attribute name="productid" />
        <link-entity name="contact_product" from="productid" to="productid" link-type="inner">
          <filter>
            <condition attribute="contactid" operator="eq" value="@UserId" />
          </filter>
        </link-entity>
      </entity>
    </fetch>
     

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard

Featured topics