AnsweredAssumed Answered

If Script Step when using "and" in the test

Question asked by jdevans on Jun 28, 2016
Latest reply on Jun 28, 2016 by jdevans

I have a script that sets two variables, one each for the contents of two global fields....

 

Then I have a IF,...., ELSE IF setup.

Here's the code..

Set Variable [ $x_drawing_type ; Value:Drawing_Numbers::x_drawing_type ]

Set Variable [ $x_drawing_subtype ; Value:Drawing_Numbers::x_drawing_subtype ]

If [ $x_drawing_type = "Flight Hardware (F)" and

$x_drawing_subtype = "Integration / Final Assembly" ]

Go to Layout [ “Drawing_Numbers_Detail” (Drawing_Numbers) ]

Set Variable [ $next_value ; Value:GetAsNumber ( Drawing_Numbers::flt_final_max )+1 ]

New Record/Request

Set Field [ Drawing_Numbers::flt_final_num ; $next_value ]

 

Else If [ $x_drawing_type = "Flight Hardware (F)" and

$x_drawing_subtype = "Mechanical" ]

Go to Layout [ “Drawing_Numbers_Detail” (Drawing_Numbers) ]

Set Variable [ $next_value ; Value:GetAsNumber ( Drawing_Numbers::flt_mech_max )+1 ]

New Record/Request

Set Field [ Drawing_Numbers::flt_mech_num ; $next_value ]

End If

I have my Data Viewer open verifying that the second condtion is true, meaning $x_drawing_tye = "Flight Hardware (F)" and at the same time $x_drawing_subtype = "Mechanical". However using the debugger, it skips both the If and the Else If, bypassing the code to run when true.

 

Is there something wrong with the use of the "and" inside the If/ElseIf test?

Outcomes