Stuart Taylor Posted June 6, 2006 Posted June 6, 2006 Is it possible to return the value of the field name of the field the calculation is in. eg: Field name: "MyField" Calculation,Text Result: Get(CurrentFieldName) Result: "MyField"
mz123 Posted June 6, 2006 Posted June 6, 2006 Hey there! You can use the function: Get ( ActiveFieldName )
Stuart Taylor Posted June 6, 2006 Author Posted June 6, 2006 I think this will only work if you will call it from a script and the field is selected... was wondering if it was possible to get result from a straight calc calling on the name of the field the calc is in...
Lee Smith Posted June 7, 2006 Posted June 7, 2006 (edited) Hi comment, I'm guessing that this would be for some kind of Audit, or Field Modification file. Hi Stuart, If this is what you are after, do a search for Audit and you will find a lot of different example files for Version 6. If not, then perhaps a description of what you need will help us help you. HTH Lee Edited June 7, 2006 by Guest
Stuart Taylor Posted June 10, 2006 Author Posted June 10, 2006 (edited) Hi guys, Know I am pushing the envelope with this one but was just scouting to see if anyone had achieved this. Thanks for your great feed back. My little idea was to try and simulate an excel spread sheet, for no other reason than to see if it could be done... I now think this is possible if scripted. I have just been welcomed to the beautiful world of Custom Functions and Custom Menus ... a dream come true!!! I originally thought about using 2 fields per record 1. "Evaluation" 2. "Result" Evaluation would contain a custom function GetAsExcel() which would probably have some kind of nested loop in it. This would contain GetField() / Evaluate() based calc returning the result The Get(CurrentField) would allow a dynamic way of locating the calculation field I now think this is still possible with a simple database containing fields A, B, C, D..... drawing on the record numbers The location can be gained by a pop up window script ... think this would be quite a good tool. gonna do it. Edited June 10, 2006 by Guest
Razumovsky Posted June 10, 2006 Posted June 10, 2006 Still not quite sure what you are getting at here, but it sounds kind of familiar. A workaround I have used for having a calcfield identify itself is just encasing the calc in a let statement and hardcoding the fieldname into a variable in each different field so that it can be handled via the same calc text for many different fields: CalcField1: Let([vFName="CalcField1"]; globalcalctext) CalcField2: Let([vFName="CalcField2"]; globalcalctext) CalcField3: Let([vFName="CalcField3"]; globalcalctext) Another approach is to use a portal with a single calc field and a global list of calcs evaluate(getvalue(gList; get(recordNumber))) This way brings about more refreshing issues however. Also, keep your eye on performance. I remember encountering some serious slowdowns trying to get too fancy with getfield and evaluate. have fun...
comment Posted June 10, 2006 Posted June 10, 2006 I am not sure what you mean. You can enter a formula into a text field. You can have it evaluated either by the text field itself (using auto-entered calculation), or by a another field (a calculation, using Evaluate (textfield)). In the first case, you would lose the formula as soon as you have entered it - it will be converted to whatever the evaluation returns. In both cases, the location of the formula is known and fixed, so there's no need for a function that would look for it.
Recommended Posts
This topic is 6803 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