Page 1 of 1

function visualvalue for String/Alpha fields

Posted: September 14th, 2018, 5:22 am
by Yass
Hi Cspro Team,

I will like to use the function visualvalue to check if there exist a text in a field before sysparm to populate. It works with numeric
which the Help indicate, what is the alternative for string. I had this :

preproc

Code: Select all

if visualvalue($) = " " then
if sysparm("HeadHousehold") <> " " then
    $ = sysparm("HeadHousehold");
endif;
endif
I get the error below:

ERROR: Invalid variable type - numeric variable expected near line 2 in S3Q8A procedure

Re: function visualvalue for String/Alpha fields

Posted: September 14th, 2018, 11:12 am
by Gregory Martin
When querying the value of a string field, you will always get the "visual value." So you can just do:
if $ = "" and sysparm("HeadHousehold") <> "" then
    $ = sysparm("HeadHousehold");
endif;