Skip to main content
Question

Two views use same object - Field Visibility


Good morning, Fellow Developers!

I have a custom screen that uses the same object for address sections of my screen.  Note graph below:

 

Note that the views Billing_Address and Transfer_Address use the same ACM DAC object ‘Address’.  When using the RowSelected event, it does in fact set the visibility; however, it affects BOTH Billing_Address and Transfer_Address.  Is there a way to only set the visibility for the specific view?  I only want to hide the Transfer_Address view, but the above code is not working.  Any thoughts from the gurus?  Thank you in advance for any assistance!

4 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1206 replies
  • January 4, 2023

@kwillman15 

have you tried [PXHidden] before the view you want to hide?


  • Author
  • Freshman I
  • 3 replies
  • January 4, 2023

@aaghaei Thank you for your reply!  The problem is that I want to dynamically show/hide the controls during the RowSelected event handler.  When I use the code above, it removes both fields from the screen.  Billing_Address and Transfer_Address.  I ALWAYS need to see on the screen the Billing_Address, but conditionally hide the Transfer_Address fields from the screen.  Depending on master document value.  Does that make sense?  Thank you! 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • 1206 replies
  • January 4, 2023

@kwillman15 

in your code try YourView.AllowSelect = true/false to show/hide the view dynamically


  • Author
  • Freshman I
  • 3 replies
  • January 4, 2023

Thanks, again!  I tried that, and the controls remained visible on the screen.  I attempted using:

 

protected void xnxBOLHeader_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            xnxBOLHeader row = (xnxBOLHeader)e.Row;

            if (row != null)
            {
                if (row.SOOrderNbr == null)
                {
                         Transfer_Address.AllowSelect = false;              
                }

            }
        }

 

Nothing seemed to change on the screen.  Everything remains visible.  I am not sure why?  Thank you!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings