Hi Pavel and Matt I want to know if there is a work around on how to get a value of a formula field using you select query. I notice that formula fields cannot be selected as a field and cannot be use also in where clause.
Depending on your situation, you may be able to set up a trigger on create/update which copies the formula field's value to a new text field and reference the text field with the Select query.. I've had to do something similar to this before.
I just added the following disclaimer to Chapter 6 of documentation:
Important: only columns with input values (text, decimal, etc) can be used in SELECT API. Dependent fields, such as formulas or related fields, cannot be used in SELECT API. Relationship field can be used, but will bring up only id of first related record (not an array of all related records).
Hope that will help.
Yes I would second this approach if accessing the formula result is important via the query API or as a field in general.
Matt,
It will be really helpful if formula fields can be access using query. It will improve the developers coding because if we uses triggers, it will just add another process and triggers only run on certain conditions like after create or update. I have created several JS right now and I uses the rbv_api a lot and I encountered several times also on this circumstances where I need to get the value in my formula field. Aside from the triggers, I also need to add another field that will hold the value for my trigger (Field update). In other cloud technology such as Salesforce, our BA's is the one creating the formula's and triggers because they can easily understand that all fields in an object is accesible using a merge token but as for Rollbase, we can't let our BA's do that work because they will just cause as troubles fixing their formulas and triggers.
Pavel,
Does change in value of formula fields does not call triggers also? What will be the work around if I wanted to call my field update trigger once my value in a formula fields change?
Triggers do not invoke other triggers to avoid uncontrolled and unwanted chain reactions. If you want to update related field when base record is updated you can do so through specially designed triggers "Update related records".
Thanks Pavel, I'll try this one.
Hi again Pavel,
I look into the new setting you added and I'm not sure how this works but what I am looking for is to call a trigger after my formula field updates or changes.
If the alternative way to do this is call a trigger after a trigger, maybe I should determine which triggers should run after the trigger.
Now we have several ways to do that:
1. Explicitly invoke trigger on dependent record
2. Invoke all "On Update" triggers through new check box
3. Invoke dependent triggers through "Update Related" trigger
If this still not clear I suggest you wait for documentation on workflow. I'm currently working on extended Rollbase documentation.