Way to update a dataset and trigger onCellEdited programtically?

I have two tables, one called DetailedView which has it’s data bound to a custom property initialData which is bound to a named query, and another called Overview who’s data property is calculated via expression on the DetailView's data property.

I implemented a lot of logic in the onCellEdited extension function of the Overview table that modifies the DetailedView data. This works nicely, I modify the underlying dataset and Overview updates correctly.

Now though I have a few buttons that the user will also take up some of the functionality. I thought via the buttons I would do a system.dataset.updateRow() on the Overview but I just found out that does not trigger the onCellEdited extension function. Is there a way to update the data of a table programatically that does trigger the onCellEdited extension function of the table?

I could make a function, but for some reason power tables use self instead of event.source so its a bit more work than it would be otherwise hence why I want to first just try to funnel the changes to the already existing onCellEdited script.

This is your mistake. Move the logic to a script module function, taking the parameters you need. I usually use comp for the component in question, passing either self or event.source depending on the calling scope.

Yea I ended up doing by feeding both tables to a function. Originally the spec was just editing the table directly, so cellEdited made sense, then the idea for a few buttons doing it came into being and I ran into this. I got it working. It is a lot of parameters as I need both tables and other info but it works.

But I guess to my question - no it’s not possible to trigger onCellEdited via a script.