cancel
Showing results for 
Search instead for 
Did you mean: 

How to reference a portion of a field in Scripting

0 Kudos

Hello,

I have a task where I need to print a field in bold, if the first letter of the field has a certain value.

I've tried to obtain this by using this scripting code, but it does not work:

data.#pageSet[0].FirstPage.HeaderSection.Information.RightColumn.CustNo.TEXT038::initialize - (FormCalc, client)

var FieldPos1 = Substr($.rawValue,1)

if ( FieldPos1 eq "C" ) then

$.font.weight = "bold"

endif

I also tried this simpler way which does not work either, does anybody have an idea how this can be done?

if ( $.rawValue(1) eq "C" ) then

$.font.weight = "bold"

endif

Kind regards,

Claus Christensen

Accepted Solutions (1)

Accepted Solutions (1)

rakesh_m2
Contributor
0 Kudos

Hello Claus,

Syntax you have used above is wrong. Please use this syntax.

var FieldPos1 = Substr($.rawValue,1, 1);

if ( FieldPos1 eq "C" ) then

$.font.weight = "bold";

endif

Thanks,

Rakesh

Edited by: rakhi966 on Oct 7, 2011 3:05 PM

0 Kudos

Thank you Rakesh, that solved my problem

Answers (0)