Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Smartform If statement

Former Member
0 Likes
718

I have created a work address field for an employee on my smartfrom.

None of the fields are mandatory so i would like my form to remove a line/carriage return if the field is blank.

I have tried to do it this way using the command option

IF NOT &P0006-STRAS& = ' '

&P0006-STRAS&

ENDIF

IF NOT &P0006-LOCAT& = ' '

&P0006-LOCAT&

ENDIF

Etc.....

Is there an simple way to do this or am i missing anything that may be causing this not to work?

5 REPLIES 5
Read only

Former Member
0 Likes
697

can't you use the conditional output for your requirement?

Read only

0 Likes
697

Can you elaborate on this ?

Read only

0 Likes
697

Hi

In smartforms, the text field have a 'Conditions' tab, you can set your condition there.

regards,

Archer

Read only

0 Likes
697

I have it set in the condition tab already, thats why im not sure why its not working

Read only

Former Member
0 Likes
697

i had same requirement and achieved by this logic:

IF &P0006-STRAS& NOT initial AND

   &P0006-LOCAT& NOT initial.

&P0006-STRAS& - &P0006-LOCAT&

ELSEIF &P0006-STRAS& NOT initial AND

   &P0006-LOCAT& IS initial.

&P0006-STRAS&

ELSEIF &P0006-STRAS& IS initial AND

   &P0006-LOCAT& NOT initial.

&P0006-LOCAT&

ENDIF

use condition tab of text element only. in 2nd and 3rd if condition there will not be any line feed.

Rgds