Application Development 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: 

IF statement in SMARTFORMS

dp_prasad
Participant
0 Kudos

Hi ,

My IF statement dosnt seems to work in smartforms.I have the following code in window-text element .

if &adrc-name1& ne ' '.

&adrc-name1&

endif.

if &adrc-name2 ne ' '.

&adrc-name2&

endif

...

But still its creating the blank lines on script output.I cannot use the Condition tab as im using much code inside this text element. Any suggestion on How to use the IF condition INSIDE the Smartforms to avoid the blank lines of address to be generated on the output.

Thanks for your augegstion.

Rgds

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

GOOD

YOU HAVE TO GIVE THIS CODE BY CREATING A PROGRAM LINE NODE IN THE TEXT ELEMENT.

IF YOU GIVE THIS IN THE TEXT ELEMENT IT WONT WORK.

THANKS

MRUTYUN

10 REPLIES 10

Former Member
0 Kudos

HI

GOOD

YOU HAVE TO GIVE THIS CODE BY CREATING A PROGRAM LINE NODE IN THE TEXT ELEMENT.

IF YOU GIVE THIS IN THE TEXT ELEMENT IT WONT WORK.

THANKS

MRUTYUN

0 Kudos

Thanks for the Reply. How can i restrict a field from generating a blank line in the program lines.? ( i have already tried this ...i have around 12 fields to be cheked for blank values...if they have a blank value i dont want to print those blank lines on the output.).

..

0 Kudos

In SMART Forms you should use the ADDRESS OBJECT, rather than trying to print the address manually. It will take care of the blank lines.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

If you do not want to use ADDRESS..

you can use CONDITION tab of the text..

Create 2 texts.. ADD1-> one which contains NAME1 but not NAME2 and the other one ADD2 which contains NAME2 but not NAME1 ...

Now.. click on the text ADD1 .. Go to conditions tab.. give the fieldname as NAME2 Choose '=' in the Relational Operator.. SPACE

DO the same for the second text also..

former_member480923
Active Contributor
0 Kudos

When ur writing the test elemnent in the condition give the initial condition check, this will work similar to the IF statemnet as u have designed.

Hope it helps

Anirban

0 Kudos

Is there any option 'NO-BLANK lines allowed' tied to pARAGRAPH FORMAT..? I saw this this in the dispaly mode.But i couldnt see this in the smart styles..?

0 Kudos

I don't think there is any such option.

did you try using the address object that I mentioned?

Regards,

Ravi

0 Kudos

I tried but it prints in the standard format. but i want only few columns .is there any way to cutomise this address options..?( i selected organization address).

0 Kudos

Hi,

In the Address object did you try specifying the no. of lines of address to be specified. The field is a part of the Additional Address specifications.

Regards,

Ravi

P.S: Please mark all the helpful answers

Former Member
0 Kudos

Hi,

Inside the Address Window-> create->Flowlogic->Alternative.

Alternative:ADRC

Description: <>SPACE?

General Attributes:

Field name

ADRC-NAME1 notequal to SPACE.

In the true condition:

&adrc-name1&

In the false condition:

&adrc-name2&

I am not sure if this is your requirement. Let me know if this works fine.

You can also use programming lines to put in your code.

Regards,

Anjali