I have a Add page. I have several Virtual fields that are used to calculate nine different pretty complex calculations based on different table values and data field selections (SEX, AGE, WEIGHT, HEIGHT, LIFESTYLE, LIFEGOAL, etc). Whenever any one of these values change, the calculations recalculates. This works.
Example Virtual3 for ProteinGoal:
CASE
/* Value Based */
WHEN [@cbParamVirtual15] ="1" THEN (SELECT DietProtein FROM Diet WHERE DietID = [@field:Diet])
/* Percent Based - table field entered as integer */
WHEN [@cbParamVirtual15] ="2" THEN [@cbParamVirtual11] * ((SELECT DietProtein FROM Diet WHERE DietID = [@field:Diet])/100)
/* Weight Based */
WHEN [@cbParamVirtual15] ="3" THEN (Cast(([@field:Weight])AS int)/2.2)*(SELECT DietProtein FROM Diet WHERE DietID = [@field:Diet])
END
The final nine virtual fields have been validated for correctness. Now I just need to assign the value to the data field (ProteinGoal).
The end user will either accept each value or over write the value with their own value. The data values will be stored in the table.
I am NOT a java programmer. I am hoping that there is a Caspio solution to my situation.
I have tried... setting the Default Value to the virtual value on load, but all that gives me is a one time load of Null (Not what I want or need)
I have tried... making the data field a calc field and placing the final calc in the calculation, but the field is not modifiable. Not to specification.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Lynda
I am new to Caspio.
I have a Add page. I have several Virtual fields that are used to calculate nine different pretty complex calculations based on different table values and data field selections (SEX, AGE, WEIGHT, HEIGHT, LIFESTYLE, LIFEGOAL, etc). Whenever any one of these values change, the calculations recalculates. This works.
Example Virtual3 for ProteinGoal:
CASE
/* Value Based */
WHEN [@cbParamVirtual15] ="1" THEN (SELECT DietProtein FROM Diet WHERE DietID = [@field:Diet])
/* Percent Based - table field entered as integer */
WHEN [@cbParamVirtual15] ="2" THEN [@cbParamVirtual11] * ((SELECT DietProtein FROM Diet WHERE DietID = [@field:Diet])/100)
/* Weight Based */
WHEN [@cbParamVirtual15] ="3" THEN (Cast(([@field:Weight])AS int)/2.2)*(SELECT DietProtein FROM Diet WHERE DietID = [@field:Diet])
END
The final nine virtual fields have been validated for correctness. Now I just need to assign the value to the data field (ProteinGoal).
The end user will either accept each value or over write the value with their own value. The data values will be stored in the table.
I am NOT a java programmer. I am hoping that there is a Caspio solution to my situation.
I have tried... setting the Default Value to the virtual value on load, but all that gives me is a one time load of Null (Not what I want or need)
I have tried... making the data field a calc field and placing the final calc in the calculation, but the field is not modifiable. Not to specification.
Can someone please help me?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.