Jump to content
Server Maintenance This Week. ×

How to replace an unstored calculation via script?


This topic is 536 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've seen quite frequently how having a lot of fields with unstored calculations may result in sluggish database performance. Most articles and forum posts I've found suggest using a script to set values instead of using a calculation field. The idea makes sense to me, but I'm a bit at a loss when it comes to how to implement such a change. I humbly request assistance with one of my simplest applications:

  • There are two tables: Product List, Issues
  • In a portal for the product list, I want to count the number of open issues per product.

As it stands now, I have a calculated field on the product list to count open issues on the Issues table. Because it's counting a related value, the calculation is unable to be stored. How would I convert this to a script or otherwise change the count to a stored value?

Link to comment
Share on other sites

You control any action that would require the field to be updated and script the change. Usually, this leads to the need for a transactional update because you are editing two records and you want to make sure that both edits happen successfully or it all rolls back. The classic video 

 

  • Like 1
Link to comment
Share on other sites

This topic is 536 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.