printdrive Posted October 13, 2009 Posted October 13, 2009 Hi everybody i've trying to apply a script trigger to a calculation field that should start when the value of the calculation is not equal to another field. I think that i'm wrong but nothing happens with the script when the condition is true. Thank you in advance for any suggestion. Maybe the script trigger is not applicable to the calculation field?
mr_vodka Posted October 13, 2009 Posted October 13, 2009 Not natively. You can look for plugin alternatives.
Vaughan Posted October 13, 2009 Posted October 13, 2009 Why not trigger the script when the "other" field is not equal to the value? (IOW forget the calculation field.)
printdrive Posted October 14, 2009 Author Posted October 14, 2009 thank you, maybe this could be usefull in a future upgrade... thank you anyway
printdrive Posted October 14, 2009 Author Posted October 14, 2009 Why not trigger the script when the "other" field is not equal to the value? (IOW forget the calculation field.) sorry i've forgotten to mention that both fields ar calculated... so i think that's impossible to do. In a few words what i wanna do is that an alert advice me when one of the two calculated fields is not equal to the other, every time in that record one of the values changes. Many thanx
comment Posted October 14, 2009 Posted October 14, 2009 Attach the script trigger to the layout (OnRecordCommit) or to the individual value fields.
LaRetta Posted October 14, 2009 Posted October 14, 2009 thank you, maybe this could be usefull in a future upgrade... thank you anyway You show vs. 9. But script triggers are only in vs. 10. :qwery: If vs. 9, as indicated, you will need a plug-in but know that script firing on calculation change is an advanced use which can be difficult to control. Another option might be: You can combine the formulas inside each of the two calculations, into a new calculation and place THAT on your layouts. It will display whenever the values change or (if related values are used, when screen is refreshed). For instance, if calc1 is Customers::MaxInvoices and calc2 is Count (Invoices::CustomerID) then create new calc in Customers with: Case ( MaxInvoices :notequal: Count ( Invoices::CustomerID ) ; "Different Totals!!" ) It can be in large red lettering which you place on your layout. YOu can also have the calculation evaluate to boolean 1 as: MaxInvoices :notequal: Count ( Invoices::CustomerID ) Then, at layout level, format the number as boolean and type "Wrong!" in the yes box (it is limited to 7 characters). :wink2:
printdrive Posted October 14, 2009 Author Posted October 14, 2009 Ok it seems to be solved... I've copied, in a new field, the value of the first calculated field via a script. I've applied the trigger to this field that activate a dialog when the value in the triggered field is different from the value of the calculated field. hope that this could be usefull for somebody else. BTW thanx to everybody :thanks:
Oyseka Posted July 30, 2011 Posted July 30, 2011 Thank you for this thread, even if is old. It has just solved my problem anyway. i did not realise you could not trigger a script from a calculation field (RTFM).
Recommended Posts
This topic is 5138 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 accountSign in
Already have an account? Sign in here.
Sign In Now