1 Reply Latest reply: May 25, 2012 8:53 AM by Abhishek Banerjee RSS

Problem in hiding subform

Aniket Dayama
Currently Being Moderated

Hi All,

 

I am trying to hide Subform based on value of flag from context. Please find below details.

 

Name of subform in VAT : it contains some texts and text fields.

Flag defined in context is G_VAT_FLG

 

If this flag is set i.e = 'X',  Subform VAT should not be displayed.


I have written below code for subform VAT in FormCalc for Form:ready event. But its not working.

 

if($record.G_VAT_FLG == "X" )

then

  this.presence = "hidden"

else

this.presence = "visible"

endif

 

Please let me know if any corrections or other options to do same.

 

Thanks in advance.

 

Regards,

Aniket Dayama

  • Re: Problem in hiding subform
    Abhishek Banerjee
    Currently Being Moderated

    Hello Aniket,

     

    The approach seems to be correct.!!!

     

    You have write the code in DocReady event/ Initialise event. And write it as JAVASCRIPT.

     

    For you reference write code in your Subform which you want to hide/unhide as:-

     

    if(this.G_VAT_FLG.rawValue == "X" )

    {

      this.presence = "hidden";

    }

    else

    {

    this.presence = "visible";

    }

     

    Pls Note: field G_VAT_FLG must exist in your Subform VAT.

     

    Let me know if it works..

     

    Regards,

    Abhishek