简体   繁体   English

Acumatica - BQL Select 表字段,其中等于字符串

[英]Acumatica - BQL Select table field where equals string

I would like to select any fields in my SQL table that are equal with the specified test string in my code.我想 select 我的 SQL 表中与我的代码中指定的测试字符串相等的任何字段。 I have seen this post: Translate SQL to BQL in Acumatica however, this is done via constants which is immutable.我看过这篇文章: Translate SQL to BQL in Acumatica然而,这是通过不可变的常量完成的。 Ideally, I would like to change the string via a combo box.理想情况下,我想通过组合框更改字符串。 This is what I have:这就是我所拥有的:

  public class TestOverview : PXGraph<TestOverview, TestOverview.MasterTable>
  {
       string test = "USA"

       public PXSelect<DemoCustomerBreakdown, 
       Where<DemoCustomerBreakdown.countryRegion,
       Equal<"I would like my string to go here">> CustomerCountry;
  }

Any ideas how I can achieve this without using a constant class?有什么想法可以在不使用恒定 class 的情况下实现这一目标吗? Thank you谢谢

If you want to bind this view to a form view, a constant is your only option.如果您想将此视图绑定到表单视图,则常量是您唯一的选择。 If on the other hand you want to use this view to select data from your code, you can use the Required<> operand and then pass the string when you select from this view:另一方面,如果您想将此视图用于代码中的 select 数据,则可以使用 Required<> 操作数,然后在 select 从此视图中传递字符串:

 PXSelect<DemoCustomerBreakdown, 
   Where<DemoCustomerBreakdown.countryRegion,
   Equal<Required<DemoCustomerBreakdown.countryRegion>>> CustomerCountry;

 var results = CustomerCountry.Select(this, “My string”);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM