Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

New to Lifecycle - need direction on if... then... else

Avatar

Level 1

First off; i hope this is the correct place to ask this question, so if not, please let me know where to post.

I am using LC designer 8, and having an issue with the if... then... else. statement

i am writting a script using FormCal --> calculate the code below is what i need to do.  The issue that i am running into is that the code only performs one (1) of the actions under the then/else statement, is there a seceret to having more than one statement under the then / else -

This code is behind a barCode field if that makes a difference, seems if i comment out the presence statements the values are set correctly, but not the presence.

if

  (Text2.rawValue == 0)

then

   $.presence = "invisible"

   $.rawValue

= Text2.rawValue

else

   $.presence = "visible"

   $.rawValue

= Text2.rawValue

endif

thanks for your help.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Save your form as a dynamic form and it will work.

Paul

View solution in original post

6 Replies

Avatar

Level 1

Attaching file w/ only the two fileds affected; since the last post, i have played around with the print only options of the presence; but the issue with this is that the logic doesnt seem to work all the time; sometime the value will show and other time is does not.

Avatar

Level 10

Seems to work fine for me. Which version of Acrobat are you testing with?

Paul

Avatar

Level 1

I am using the "preview" tab and the viewer {version 8] to text. from what i see the setting of the values work with no issue, but the presence does not. - i can see this when i comment out the , BC.relevant = "+print" line of code.

When i first bring it up, the value is SS_text null - thus the barcode should not be visable on the screen, when i populate the SS_text, the barcode should be shown; but it does not appear for me, is it working for you that way ?    should i be doing somthing like the code below instead of the way i was,  i still cant get the barcode to show with it either.

if

(SS_Text

<> null)

  then

    BC.presence

= "visible"

    BC

= SS_Text

else 

//is null

   BC.presence 

= "hidden"

   0

endif

Avatar

Correct answer by
Level 10

Save your form as a dynamic form and it will work.

Paul

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now