TryinHard2Learn
Technical User
I am an intermediately capable FileMaker coder. I have a solution I created for an activity at work which recently broke in a critical part of a reporting process.
Does anyone know if the function ValueListItems() was broken with the 11.0v4 update? It was working fine before that and I cannot think of anything that touched that part of the code.
In places where possible, I prefer making code dynamic, rather than hard-coding items. One case in point is that as part of a report I build, I look at a value list and create temporary counting variables for each item in that value list. It's a bit slower, but the resulting code won't break if a value list is modified. So, borrowing some code from FM forums, I created the following method for creating the counting variables, which I add to as I loop through records, looking for the occurrence of these items. Make sense? Has worked well over many months of use. Until now.
In the code below, the second Set Var used to create a list of the items in that value list. Now, nothing is returned.
Does anyone know of anything or heard of anything that changed or broke with this function?
Thank you in advance for any help or suggestions.
- Kevin
#Create Vars from Value List "VL_Family_Role"
Set Variable [ $VL1_Name; Value:"VL_Family_Role" ]
Set Variable [ $VL1_Items; Value:ValueListItems(Individuals::gThisVersion;$VL1_Name) ]
Set Variable [ $VL1_Item_Count; Value:ValueCount ( $VL1_Items ) ]
#Loop thru current Value List and create all variables for that list
Set Variable [ $Loop_Count; Value:0 ]
Loop
Set Variable [ $Loop_Count; Value:$Loop_Count + 1 ]
Exit Loop If [ $Loop_Count > $VL1_Item_Count ]
Set Variable [ $varName; Value:Filter ( "$" & GetValue( $VL1_Items; $Loop_Count) ; "$AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ) & "_Count" ]
Set Variable [ $varValue; Value:0 ]
Set Variable [ $whatever; Value:Let ( [ variableName = $varName ; variableValue = $varValue ; formula = "Let ( variableName = variableValue ; \"\" )" ] ; Evaluate ( Substitute ( formula ; [ "variableName" ; variableName ] ; [ "variableValue" ; Quote(variableValue) ] ) //close Substitute ) // close Evaluate ) //close Let ]
If [ $Loop_Count = 1 ]
Set Variable [ $VL1_ListOfVars; Value:$varName ]
Else
Set Variable [ $VL1_ListOfVars; Value:$VL1_ListOfVars & ¶ & $varName ]
End If
End Loop
Does anyone know if the function ValueListItems() was broken with the 11.0v4 update? It was working fine before that and I cannot think of anything that touched that part of the code.
In places where possible, I prefer making code dynamic, rather than hard-coding items. One case in point is that as part of a report I build, I look at a value list and create temporary counting variables for each item in that value list. It's a bit slower, but the resulting code won't break if a value list is modified. So, borrowing some code from FM forums, I created the following method for creating the counting variables, which I add to as I loop through records, looking for the occurrence of these items. Make sense? Has worked well over many months of use. Until now.
In the code below, the second Set Var used to create a list of the items in that value list. Now, nothing is returned.
Does anyone know of anything or heard of anything that changed or broke with this function?
Thank you in advance for any help or suggestions.
- Kevin
#Create Vars from Value List "VL_Family_Role"
Set Variable [ $VL1_Name; Value:"VL_Family_Role" ]
Set Variable [ $VL1_Items; Value:ValueListItems(Individuals::gThisVersion;$VL1_Name) ]
Set Variable [ $VL1_Item_Count; Value:ValueCount ( $VL1_Items ) ]
#Loop thru current Value List and create all variables for that list
Set Variable [ $Loop_Count; Value:0 ]
Loop
Set Variable [ $Loop_Count; Value:$Loop_Count + 1 ]
Exit Loop If [ $Loop_Count > $VL1_Item_Count ]
Set Variable [ $varName; Value:Filter ( "$" & GetValue( $VL1_Items; $Loop_Count) ; "$AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz" ) & "_Count" ]
Set Variable [ $varValue; Value:0 ]
Set Variable [ $whatever; Value:Let ( [ variableName = $varName ; variableValue = $varValue ; formula = "Let ( variableName = variableValue ; \"\" )" ] ; Evaluate ( Substitute ( formula ; [ "variableName" ; variableName ] ; [ "variableValue" ; Quote(variableValue) ] ) //close Substitute ) // close Evaluate ) //close Let ]
If [ $Loop_Count = 1 ]
Set Variable [ $VL1_ListOfVars; Value:$varName ]
Else
Set Variable [ $VL1_ListOfVars; Value:$VL1_ListOfVars & ¶ & $varName ]
End If
End Loop