Skip to main content
Dynamics 365 general forum
Suggested answer

Rollup filter where activity owner is account owner

editSubscribe (0) ShareShare
ReportReport
Posted on by 240

Hello, 

I have a rollup of activity on account table. And these rollups are for viewing last and next activity on the account form. Is there anyway to filter the rollup to only those activities where the activity owner = Account owner. 

I am thinking if I can create a boolean field on all activity tables - phone call/task/appointment etc which would toggle to Yes by a workflow when the activity owner is equal to the account owner (which would be the regarding field) - But I don't know if it would be possible to carry these Yes toggles to the activity pointer since that is the related table on the rollup calculation. 

Any ideas?

Thank you. 

  • Suggested answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,317 on at
    RE: Rollup filter where activity owner is account owner

    Hi,

    Thank you for your query.

    As per my understanding, this is a hard problem.

    If you add a two-options field on the Activity, it is almost impossible to update (toggle) this using a workflow / flow or even a plugin. You cannot trigger any process or plugin on the activity table.

    If you add this flag in underlined activity (like Task, Phone Call, Email, etc.), you cannot role it up on Activity Level.

    So my suggestion would be:

    • Instead of using Roll-up, write your own logic using a plugin.
    • Let this plugin execute on create/update of:
      • Task
      • Phone Call
      • Email
      • Appointment

    (or whatever activities are being used)

    • Get reference of Regarding Account.
    • Retrieve Multiple - All Activities related to this account and get the Last and Next activity date (aggregations).
    • Update these fields on Account (simple fields not roll-up).
  • Aneeqa Pervaiz Profile Picture
    Aneeqa Pervaiz 240 on at
    RE: Rollup filter where activity owner is account owner

    Hey Lu Hao.

    I need to add a filter somehow that only those activities are included where the activity owner = Account owner. 

    Which brings me to the first part of the question, How do I add a filter to the activity pointer somehow. I was thinking I could add a toggle (Y/N) on all activities (My client uses only 4 - so that is okay) - Once the created activity owner = regarding account owner, then that toggle would set to Yes. But how can I set this toggle in activity pointer itself so that I can add a filter in rollup. 

    Looking forward to your reply. 

    Thanks.

  • LuHao Profile Picture
    LuHao 40,832 on at
    RE: Rollup filter where activity owner is account owner

    Hi Aneeqa,

    Can you elaborate on "But I don't know if it would be possible to carry these Yes toggles to the activity pointer since that is the related table on the rollup calculation"?

    In addition, in order to better understand your needs, can you tell me how the rollup of activity in the Account form is created?

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans