cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional display of subform

Former Member
0 Kudos

Hi,

I have a subform which should be displayed only in the last page and the page numbers are determined in runtime as there is table that grows depends on the data from database,i am trying this script but still the subform is seen in all pages,

var totpage = subform.pagecount.rawvalue

var currpage= subform.currentpage.rawvalue

if ( totpage == currpage ){

subform.prescene = ' Visible'

}

else

{

subform.prescene = 'invisible'

}

I have this subform inside master page.

Please let me know how can i hide this subform.

Thanks and Regards,

Siva

Accepted Solutions (0)

Answers (1)

Answers (1)

aakash_neelaperumal2
Active Participant
0 Kudos

Hi,

in the Form Ready event

Just put

Subform.presence = "Hidden". >>>> not Invisible

Former Member
0 Kudos

Thanks Akash,i tried that too,but it is still not going invisible.is there any Form Calc script available for this,i have this subform (Total values) inside my Master page as i have tables that flow in body page.this is almost like a footer but need to be displayed only at last page.

Regards,

Siva

Former Member
0 Kudos

Siva,

If the code which you have mentioned is the same from script editor then there is a spelling mistake for presence:

if ( totpage == currpage ){

subform.prescene = ' Visible'

}

it should be like this:

subform.presence = "hidden";

subform.presence = "visible";

It might be the reason.

Regards,

Ravi

Former Member
0 Kudos

Hi,

Thanks for your reply. I have tried that ,when i declare presence = 'visible' or invisible outside the IF loop it's working fine ,but if i place it inside the IF loop its not working.i have checked the IF loop by putting alert messages inside ,thats working fine.

I have this subform inside the masterpage ,do i need to put this subform inside the body page?.

i can't put the subform inside body page as there is some layout issues.

whats the difference between Hidden and Invisible?

Thanks and Regards,

Siva