How to configure a derived columns in the table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2013 08:43 AM
I would like to have derived columns in a table. the value of the column is depending on the other column value. (Example , age which is derived from the data of birth column). please adivse me how to populate the value for the derived column. Thanks in advance..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2013 02:28 PM
You could use a business rule to calculate the value of the derived column.
The business rule should have the "before insert" and "before update" boxes checked.
This assumes you have added fields called "Birthdate" and "Age":
do_calculate_field_values();
function do_calculate_field_values() {
var x = current.u_birthdate;
var y = f(x);
current.u_age = y;
}
function f(x) {
// your function goes here
}
I hope this helps!
Cheers,
Geoff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2013 06:26 AM
Geoff,
Thanks a lot for your quick response and advise. Can I have the business rule while genarating the report. I believe if we write the business rule before insert and before update. after few months/years, the age will vary. I would like to have this while genarating the report. is it possible to have this business rule while genarating the report.
I found that, Report can be genarated based on the fileds which are available in the table. please advise. thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2013 07:25 AM
You make a really good point. And I think you can achieve what you want by making the business rule a "Before Query" rule instead of before update. I haven't tested it, but the documentation makes it seem that this rule should be executed on records before the report is generated from query data.
Another alternative is using "calculated" fields, but I have had marginal success with them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2013 08:15 AM
Many Thanks Geoff