I fixed the $$VarID to be correct and it is now $$VLID.
Still does not show anything in portal.
1 of 1 people found this helpful
I use this simple list building expression:
Set Variable [ $Variable ; value: List ( $Variable ; "new data here" ) ]
It's a bit simpler, but not the source of your trouble.
Question is: are the variables getting data or is it that the virtual list fields are not getting data from the variable?
Or is the portal failing to show any records?
Each issue produces an empty portal, but the causes are different.
I forgot to create the number of records in the VL list/reset rows to a number! Simple, but important.
I'm always looking to be more efficient though.
So instead of:
Set Variable [ $$VLName ; Value: If ( not IsEmpty ( $$VLName ) ; $$VLName & ¶ Contacts:: first_name & " " & Contacts::last_name ]
You would recommend:
Set Variable [ $VLName ; Value: List ( $VLName ; Contacts:: first_name & " " & Contacts::last_name ) ]
Set Variable [ $$VLName ; Value: List ( $$VLName ; Contacts:: first_name & " " & Contacts::last_name ) ]
It makes very little difference in terms of performance, but notice that the expression is simpler and that can make it easier to modify at a future date if the need arises.
Just to clarify, YES, you would use either of the above alternates or one of them in particular?
I was only responding to the use of List in the expression.
Whether I used a global variable ($$) or a script variable ($) would depend on whether I need the value in the variable to persist once the script that created the variable completes execution. If I need the value to persist, I'd use the global. If I don't, I use the script variable.
For Virtual Lists, do you use just a script variable? In addition, if so, you do not need the clear global variables step. That would save a step.
There's more than one way to implement this. Look at your own implementation and answer this question:
Do I need this variable anywhere but inside the script that creates it?
If the answer is yes, use a global variable. If it is no, don't.