Hi,
I would like to create some Summary type column that shows total number of Quotes for example. This would be done on both the Contacts Table and the Account Table. This column would also be used in a view.
For example I could add a Quote then go the Accounts view and as I scroll down the Accounts view, it would add an extra 1 to the number of Quotes related to the specific Account.
Key is that data would need to be current all the time.
Wondering what the best approach would be?
To my knowledge, a Rollup Column would only update every 12 hours? Would a flow be a better approach that could fire every time a new record is added to the Quote table, therefore only doing updates to effected Accounts?
Is a formula column the better option but would it be effective as I scroll down my Accounts view?
Thanks in advance for any assistance
Todd
@Tango hello,
Here is what rollup column configuration looks like:
In my case I used aggregation over contacts because my test environment is "CDS" one so it doesn't have quotes but it should be straightforward on how to build the Rollups over quotes.
Hi @Tango
So for now I recommend doing it with a consolidated field although keep in mind that it will be deprecated.
Then to force the calculation you can use power automate, since there is another way to force it but using JS and you need to enter the form for it to be executed.
The other option is to do it with Power Automate, but depending on the volume it will take more or less.
What you would have to do is first obtain all the accounts and then use those accounts to obtain the list of appointments associated with that account, use the length expression to count and with that value that you have obtained update the field of the accounts table.
You must say this if you program it once a day or every few hours and you must be careful with making an infinite loop
With Power FX you won't be able to.
Thanks @Jmanriquerios but this column will be in the list view and not the form view
Hi @Tango
There are several ways to do it, what you propose about Calculated Columns is an option but it will soon be deprecated, the Power FX option does not support it for now, since they are polyform columns.
The other Power Automate option, there is a lot of material on how to do it, but I would stick with the traditional process for now. Using a JS that counts the appointments associated with an account or a contact, I would place a view in the subgrid that shows all the rows of appointments associated with that account or contact and then count the rows.
function Onload(executionContext)
{
var formContext = executionContext.getFormContext();
var gridDocumentos = formContext.getControl("Subgrid_new_1");
if(gridDocumentos != null)
{
let countDocumentos = async function () {
var countviewDocumentos = gridDocumentos.getGrid().getTotalRecordCount();
var totalDocumentos = parseInt(countviewDocumentos);
formContext.getAttribute("enc_ndedocumentos").setValue(totalDocumentos);
formContext.data.entity.save(true);
};
gridDocumentos.addOnLoad(countDocumentos);
formContext.data.refresh(true);
}
}
}
I show you a code that you can adjust to count the appointments.
Then I suggest you use the new views functionality where you can use groupings and totalizations to count the total, I'll give you an article that I wrote
https://www.linkedin.com/in/jonathan-manrique-rios/recent-activity/articles/
stampcoin
15
ankit_singhal
11
Super User 2025 Season 1
mmbr1606
9
Super User 2025 Season 1