Skip to main content

Notifications

Dynamics 365 Community / Forums / Sales forum / Rollup field filter on...
Sales forum
Answered

Rollup field filter on top source entity

Posted on by 22

Hi there,

I have an issue where I want to build a conditional rollup field on the Opportunity with the filter field is a Lookup on the Opportunity Product. I understand you can't use a Lookup field as a filter on the rollup field formula, but i wanted to know if there were any workarounds?

I thought creating a field on OpportunityProduct and using a workflow to push the data from the Lookup field to a Text field (which would be used as the filter in the rollup formula) might work, but the workflow builder doesnt allow me to push data from two fields on the OpportunityProduct entity?

Also, I keep reading that a rollup formula can filter on the source entity just like it can on the target entity - I cannot seem to get it to access the source entity (Opportunity) field as filter fields, only the OpportunityProduct. Is this true?

Any thoughts greatly appreciated.

Thanks,

Andrew

  • Suggested answer
    ba365guy Profile Picture
    ba365guy 2,944 on at
    RE: Rollup field filter on top source entity

    Hi

    Please use the parameter called "Scope".

    When we select the scope as Organization, then the flow will trigger for all users of D365.

    When we select the scope as Parent: Child Business Units, then the flow will trigger only for the Users who are under the subordinate business units of the Flow execution context User’s Business Unit.

    When we select scope as Business Unit, the Flow would trigger for all users of the same business unit. Same business unit means, the Flow execution context Users’ Business Unit.

    When we select scope as User, it would trigger Flow only for a single user who is Flow execution context User.

  • ba365guy Profile Picture
    ba365guy 2,944 on at
    RE: Rollup field filter on top source entity

    Can you initiate a new thread please.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Rollup field filter on top source entity

    Thanks ba365guy. I have created these flows in PowerAutomate under 'My flows' with scope set to 'Organisation'. Does this mean that I have created a personal flow which impacts on all users? This does not seem right to me.

    If not, if I want to roll these out across all users, do I need to recreate these under 'My Teams'?

  • Suggested answer
    ba365guy Profile Picture
    ba365guy 2,944 on at
    RE: Rollup field filter on top source entity

    Hi Andrew,

    Workflow is not supported for such functionality. 

    Only Power Automate can do. 

    Otherwise you need to go ahead with custom plug-in (C# coding) or Javascript coding

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Rollup field filter on top source entity

    Hi ba365guy,

    While we have this working (which is great) and I'm keen to implement across the organisation, I just wanted to know if there were any other means of making this work (taking a copy of the text label of the value in the Lookup field and moving it to a simple text field), perhaps via D365 workflow?

    Thanks

  • Andrew Stone Profile Picture
    Andrew Stone 22 on at
    RE: Rollup field filter on top source entity

    I'll start a new thread, thanks

    My understanding of the video/information is that CDS looks for the status of the record as a filter (If status of record = resolved, then update).

  • Suggested answer
    ba365guy Profile Picture
    ba365guy 2,944 on at
    RE: Rollup field filter on top source entity

    May i know why are you looking for statecode

    Based on my previous understanding, you should be looking for existing product (or product id)

    If it for a new doubt.... Would you mind starting a new thread (only for new doubt, else ignore)

  • Andrew Stone Profile Picture
    Andrew Stone 22 on at
    RE: Rollup field filter on top source entity

    The drop down mentioned above does not contain any 'statecode' equivalent as far as I can see?  Looking at the D365 information on the OpportunityProduct, the relevant field seems to be 'Opportunitystatecode' but this is not available? 

    pastedimage1578278933427v1.png

  • Suggested answer
    ba365guy Profile Picture
    ba365guy 2,944 on at
    RE: Rollup field filter on top source entity

    Click on "Use rich formatting"

    You can paste images.

  • Andrew Stone Profile Picture
    Andrew Stone 22 on at
    RE: Rollup field filter on top source entity

    Thanks ba365guy.

    I've read through the article/video in the link regarding the UPDATE using CDS. I dont believe there is an equivalent 'statecode' field in on the OpportunityProduct entity I can use to replicate the logic?

    I have created a new flow, triggered by the CDS 'when a record is updated' trigger, with entity name = opportunity products and Scope = org. The attribute filters item field does not contain any such status field?

    The rest of the flow uses D365 steps in the original (working) flow.

    Not sure if there is a workaround?

    How can I paste screenshots into these text boxes?

    Thanks

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans