cancel
Showing results for 
Search instead for 
Did you mean: 

Hide a Page in Adobe Forms with JavaScript

Former Member
0 Kudos

Hello community,

I would like to hide a page during the generation of a PDF document related to a value in a field.

Example:

On page FIRST I have the field GS_FIELDS-DOCUTYPE.

If the Value is equal "AE" the page ANNOUNCE should be hide and not produced.

This must not be interactive (out from an entry of the user) it's just a printing document.

So how can I control that the pate ANNOUNCE will not produced?

If this will work only with formcalc, also no problem 😉

For your help thanks in advance.

So long

Markus

Accepted Solutions (0)

Answers (2)

Answers (2)

pavan_prabhu
Active Participant
0 Kudos

The easiest way to achieve this is, if you have a design view(body page for this master page) then wrap all contents of the content area in a sub form. Then drag the field GS_FIELDS-DOCUTYPE from data view into this sub form and hide this field by writing the below code on your main sub form.

if ( this.DOCUTYPE.rawvalue == "AE" )

{

      this.presence = "hidden";

}

If you don't have a body page for this master page then insert sub form in the design view and repeat the above steps.

When the content area contains a main subform and if this main subform is hidden(i.e no data left to show), the adobe framework hides the master page and all its instances 🙂

cpz
Explorer
0 Kudos

Hi Pavan,

Appreciate it if you have any advice to offer on hiding a blank master page - see this link:

https://answers.sap.com/answers/13458954/view.html

thanks,

Con.

manoj4
Discoverer
0 Kudos

Hello Markus,

Sorry for late replay...!

The hiding of the page is possible in two languages 1) Form calc and 2) Java script

If it is Form calc use the below code.


1) Drag and drop the field "GS_FIELDS-DOCUTYPE" onto the layout from "Data view" on which you want to validate.

2) Go to the properties and hide "GS_FIELDS-DOCUTYPE"

3) Write the below code in "Form read" event with language "Form Calc"

if $.parent.GS_FIELDS-DOCUTYPE == "AE" then

$.presence = "visible"

else

$.presence = "hidden"

endif

I think it will help you...

Regards,

Manoj

Former Member
0 Kudos

Hello Markus,

If it is Java Script use the below code.

if (data.sb1.TextField1 == ' AE' )

{

data.sb1.TextField1.presence = "visible";

}

else

{

data.sb1.TextField1.presence = "hidden";

}

Best Regards,

Praveen PVR.