I want to HIDE the Sales Order Line Commissions Tab, but I only want the Tab Hidden for a Specific Role. Is this possible?
相关问题
- How to add a memo / formatted text field ala Cases
- Create Case with Activity through Rest API
- Acumatica dynamic dropdown
- How to create an ad-hoc email and send it using Ac
- How to include a dialog for file upload
相关文章
- Cannot load a reference assembly for execution
- Adding additional filter field on process shipment
- Create custom User Control for Acumatica
- Sales Price Updating Every Other Time
- Import Amount Paid in screen Bill And Adjusment us
- Acumatica Configuration Wizard error: Can't ge
- How to properly sort Tasks having multi-level Task
- Prevent update of note/files on disabled views
Option #1: Using PXTabItem VisibleExp property
This approach works perfectly with fairly simple declarative conditions, which utilize input control values from a particular container (PXForm is most commonly used for this scenario).
For example, to hide the Sales Order Commissions tab for orders of the TR type, you should compose VisibleExp as follows:
A quick overview of the 3 PXTabItem properties used in the code snippet above:
Option #2: In code hide all controls placed inside PXTabItem
Without a doubt, this approach is a step forward in terms of flexibility comparing to PXTabItem VisibleExp property. It allows you to compose way more complex conditions inside business logic and do not rely on a webpage.
To hide the Sales Order Commissions tab, you should subscribe to the RowSelected handler for SOOrder as follows:
With AllowSelect property set to false, the SalesPerTran data view will automatically hide every PXGrid, whose DataMember property is set to SalesPerTran. Since the Sales Order Commissions tab also contains Default Salesperson lookup, we need to additionally set Visible property to false for the PXUIFieldAttribute decorating SOOrder SalesPersonID field. PXTabItem automatically hides when it contains no visible controls.
Please be advised, similar to PXTabItem VisibleExp property, in order for this approach to function properly, you have to always set RepaintOnDemand to false for the PXTabItem you conditionally hide. For this particular example, we can skip this step, because RepaintOnDemand is set to false in the original SO301000.aspx file distributed by Acumatica.