Mass action to update field on row only for a specific group

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hello,

I'm trying to create a mass action, to update a field on all records from a specific group

Here's some details/example:

I have a model called Food, and another model (AGG) based on same object.
the AGG model has a group to separate "fruits" and "vegetables"

I created a table for those groups. So now the table contains 2 row

I want for example to be able to mass update a field on all records from group "fruits"

I tried creating a mass action to update row ,with  action framework, on AGG model, but nothing seems to happen,
then tried to update field on row on Food model,  but all it did is update all records from both group (even though i only selected group "fruits" for mass actions

I'm sure i'm missing something.

If anyone could point me in right direction I would appreciate

Thank you,
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
I have a model called Food, and another model (AGG) based on same object 
[Irvin] What does this mean?


the AGG model has a group to separate "fruits" and "vegetables"
[Irvin] Do you mean a picklist?

I want for example to be able to mass update a field on all records from group "fruits"
[Irvin] Huh?

Sorry, I am very slow and not following along.  For starters, can you post a few screenshots of your models?
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
K let's forget the food example, and go with my real case lol

I have 2 models based on same SF object

Model 1 Basic (based on SF object named bank_statement__c)
Model 2 Aggregate with a grouping based on field 'account number' (based on SF object named bank_statement__c)



Created a table based on model #2 (agg)

So now my table shows the 2 different groups I have for this test record



So now I want to apply a mass action (update field on row) only to the records from 1st group: Bank of america (this group contains 5 records)

How would I do that?

Whatever solutions I tried, either did nothing or updated all records (not only the ones from selected group)

Thx for your help :)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I've done similar things.  Here is a sketch. 

1. Add a condition to Model 1 on "account number" field.  Make it filterable default off. 
2. Add a row action to your Model 2 table that does the following action fwk sequence.
       - Activate condition and pass value.  Find model 1 and condition you made above.  Pass into it the alias of your grouped account number field
       - Requery model 1
       - Update field on rows on model 1 with whatever you want.

This will update all the rows remaining in Model 1,  which you have filtered down to an approprate subset. 
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi and ty Rob,

I was able to partially succeed but prob did a mistake on step 2, as it only updates the 1st group no matter which group i selected

Pass into it the alias of your grouped account number field
This is the part where i believe I did not understand fully

As well you said "add a row action", but i'm trying to do a mass action, in case in make any difference

So for the alias, I first tried to do an aggregation of account # (which resulted in error, as cannot agg a field used by the model's grouping).

Then tried to pas the alias name of the grouping itself on model 2{{accountNumberc}}, and that resulted in issue listed above



Am i missing or misunderstood something?
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Bump, in case Rob or anyone can help me out pls.
Still have not figured out issue I experienced with Rob's proposed method