Implementing formulas for custom fields in an on-demand database
First Claim
1. A method of evaluating a formula in a database system, the method comprising:
- receiving, at the database system, a formula defined to access data stored in one or more rows of a database table of the database system, wherein the formula is an expression that receives the accessed data as input and provides a result that is different than the input data;
evaluating, with the database system, the formula to obtain a first result based on first values of the input data stored in the one or more rows of the database table;
receiving, at the database system, a change in a first value of at least one of the input data stored in the one or more rows;
obtaining, with the database system, an updated result of the formula by;
determining whether the formula accesses input data from only one row of a the database table; and
synchronously evaluating the formula to obtain the updated result when the formula accesses input data from only one row of the database table; and
otherwisedeciding whether to evaluate the formula synchronously or asynchronously to obtain the updated result when the formula accesses input data from at least two rows of the database table, wherein the formula accesses input data from multiple rows of the database table, further comprising synchronously evaluating the multiple-row formula to obtain the updated result when the updated result of the multiple-row formula is computable with a delta value combined with the first result of the multiple-row formula.
1 Assignment
0 Petitions
Accused Products
Abstract
The efficiency and versatility for the implementation of formulas in an on-demand database is improved. Formulas are categorized. Based at least partly on the categorization, formulas are evaluated synchronously or asynchronously. An asynchronous evaluation may be performed if a certain set of criteria is not satisfied. Asynchronous evaluations may be performed using a queue. During an asynchronous update of an object, a counter field and/or an estimate field may be used respectively for indicating the consistency of values of the object and a time when the values were consistent. The versatility of formulas is enhanced by using a formula to create a default value for a custom field when it is created and to determine whether an action is to be performed, and is enhanced by having an action define when a formula is to be updated.
89 Citations
35 Claims
-
1. A method of evaluating a formula in a database system, the method comprising:
-
receiving, at the database system, a formula defined to access data stored in one or more rows of a database table of the database system, wherein the formula is an expression that receives the accessed data as input and provides a result that is different than the input data; evaluating, with the database system, the formula to obtain a first result based on first values of the input data stored in the one or more rows of the database table; receiving, at the database system, a change in a first value of at least one of the input data stored in the one or more rows; obtaining, with the database system, an updated result of the formula by; determining whether the formula accesses input data from only one row of a the database table; and synchronously evaluating the formula to obtain the updated result when the formula accesses input data from only one row of the database table; and
otherwisedeciding whether to evaluate the formula synchronously or asynchronously to obtain the updated result when the formula accesses input data from at least two rows of the database table, wherein the formula accesses input data from multiple rows of the database table, further comprising synchronously evaluating the multiple-row formula to obtain the updated result when the updated result of the multiple-row formula is computable with a delta value combined with the first result of the multiple-row formula. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 34, 35)
-
-
12. A computer readable medium storing program code for controlling a processor to perform an operation for evaluating a formula in the database system, the program code comprising code for:
-
receiving a formula defined to access data stored in one or more rows of a database table of the database system, wherein the formula is an expression that receives the accessed data as input and provides a result that is different than the input data; evaluating the formula to obtain a first result based on first values of the input data stored in the one or more rows of the database table; receiving a change in a first value of at least one of the input data stored in the one or more rows; determining whether the formula accesses input data from only one row of the database table; and synchronously evaluating the formula to obtain the updated result when the formula accesses input data from only one row of the database table; and
otherwisedeciding whether to evaluate the formula synchronously or asynchronously to obtain the updated result when the formula accesses input data from at least two rows of the database table, wherein the formula accesses input data from multiple rows of the database table, and wherein the program code further code for synchronously evaluating the multiple-row formula to obtain the second result of the multiple-row formula when the second result is computable with a delta value combined with the first result of the multiple-row formula. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
-
-
23. A system comprising:
- a database;
at least one processor coupled with the database, the processor configured to;receive a formula defined to access data stored in one or more rows of a database table of the database system, wherein the formula is an expression that receives the accessed data as input and provides a result that is different than the input data; evaluate the formula to obtain a first result based on first values of the input data stored in the one or more rows of the database table; receive a change in a first value of at least one of the input data stored in the one or more rows determine whether the formula accesses input data from only one row of the database table; and synchronously evaluate the formula to obtain a second result when the formula accesses input data from only one row of the database table; and
otherwisedecide whether to evaluate the formula synchronously or asynchronously to obtain a second result when the formula accesses input data from at least two rows o5 the database table, wherein the formula accesses input data from multiple rows of the database table, and wherein the processor is further configured to synchronously evaluate the multiple-row formula to obtain the second result of the multiple-row formula when the second result is computable with a delta value combined with the first result of the multiple-row formula. - View Dependent Claims (24, 25, 26, 27, 28, 29, 30, 31, 32, 33)
- a database;
Specification