Skip to main content
Solved

Conditional PXRestrictor on Look up

  • February 9, 2024
  • 1 reply
  • 103 views

Hi,

 

I am looking for a solution where I have a Boolean value on the user, the value will state if all the warehoused should be available for the user when selecting the warehouse for the current branch.

if the bool is true then we I want to only show the current rows branch's warehouses and not all the warehouses in the system. but if the bool is false I don't want the where clause to be part of the PXRestrictor. 

 

I cant control a PXRestrictor with a bool and this is the problem i don't always want to apply the where clause to the look up field. 

 

Current Code

  #region SiteID  
  [PXMergeAttributes(Method = MergeMethod.Append)]
  [PXRestrictor(typeof(Where<INSite.branchID, Equal<Current<SOLine.branchID>>>), "", typeof(INSite.siteID))]

  public int? SiteID { get; set; }
  #endregion

 

I have a bool on the same DAC usrWarehouseLock and if this is true then apply the current PXRestrictor and is false ignore and just continue with the normal functionality. 

 

Any help will be amazing thanks. 

 

Best answer by darylbowman

Have you tried something like:

[PXRestrictor(typeof(Where<usrWarehouseLock.IsEqual<True>.
        And<INSite.branchID.IsEqual<SOLine.branchID.FromCurrent>>>),
        "", typeof(INSite.siteID))]

(this uses PX.Data.BQL.Fluent)

View original
Did this topic help you find an answer to your question?

1 reply

darylbowman
Captain II
Forum|alt.badge.img+13
  • 1712 replies
  • Answer
  • February 9, 2024

Have you tried something like:

[PXRestrictor(typeof(Where<usrWarehouseLock.IsEqual<True>.
        And<INSite.branchID.IsEqual<SOLine.branchID.FromCurrent>>>),
        "", typeof(INSite.siteID))]

(this uses PX.Data.BQL.Fluent)


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