Why is 'CustomerOrOrganizationInNoUpdateDocRestrictor' inaccessible in my Acumatica project?

huangapple go评论85阅读模式
英文:

Why is 'CustomerOrOrganizationInNoUpdateDocRestrictor' inaccessible in my Acumatica project?

问题

早上好!在表格 DAC 中,我包含了一个客户 ID 字段。我希望这个选择器的操作方式与销售订单表单中的客户 ID 字段完全相同。我使用了销售订单中的所有相关 DAC 代码来创建我的自定义屏幕中的字段;然而,当我尝试使用相同的限制属性时,无法访问以下属性。我已经在项目中包含了所有必要的引用(PX.Objects.AR)。非常感谢您对这个问题的任何帮助或解决方法。谢谢!

似乎无法访问 [CustomerOrOrganizationInNoUpdateDocRestrictor]。项目将无法构建并收到以下错误:

错误 CS0122:'CustomerOrOrganizationInNoUpdateDocRestrictor' 由于其保护级别而无法访问。

我已经尝试操纵引用,我期望在我的项目中,与 PX.Objects.SO 中定义的属性一样能够正常工作。

英文:

Good morning! I have a customer ID field included in the table DAC. I would like for this selector to operate identically to the customer ID field in the sales order form. I used all pertinent DAC code from the sales order to create the field in my custom screen; however, when I attempt to use all the same attributes for the restrictor, the following attribute cannot be accessed. I have all the appropriate references included in the project(PX.Objects.AR). Any assistance or work around for this issue would be greatly appreciated. Thank you!

  1. #region CustomerID
  2. public abstract class customerID : BqlInt.Field<customerID>
  3. {
  4. public class PreventEditBAccountCOrgBAccountID<TGraph> :
  5. PreventEditBAccountRestrictToBase<BAccount.cOrgBAccountID, TGraph, NXBOL,
  6. SelectFrom<NXBOL>
  7. .Where<NXBOL.bolType.IsNotEqual<NXBOLType.nonProductMovement>.
  8. And<NXBOL.customerID.IsEqual<BAccount.bAccountID.FromCurrent>>>>
  9. where TGraph : PXGraph
  10. {
  11. protected override string GetErrorMessage(BAccount baccount, NXBOL document, string documentBaseCurrency)
  12. {
  13. return PXMessages.LocalizeFormatNoPrefix(Messages.CannotChangeRestricToIfShipmentExists,
  14. documentBaseCurrency, baccount.AcctCD, document.BOLNbr);
  15. }
  16. }
  17. public class PreventEditBAccountCOrgBAccountIDOnVendorMaint : PreventEditBAccountCOrgBAccountID<VendorMaint>
  18. {
  19. public static bool IsActive()
  20. => PXAccess.FeatureInstalled<FeaturesSet.multipleBaseCurrencies>();
  21. }
  22. public class PreventEditBAccountCOrgBAccountIDOnCustomerMaint : PreventEditBAccountCOrgBAccountID<CustomerMaint>
  23. {
  24. public static bool IsActive()
  25. => PXAccess.FeatureInstalled<FeaturesSet.multipleBaseCurrencies>();
  26. }
  27. }
  28. protected Int32? _CustomerID;
  29. [CustomerActive(
  30. typeof(Search<BAccountR.bAccountID, Where<True, Equal<True>>>), // TODO: remove fake Where after AC-101187
  31. Visibility = PXUIVisibility.SelectorVisible, Required = true)]
  32. [CustomerOrOrganizationInNoUpdateDocRestrictor]
  33. [PXForeignReference(typeof(Field<NXBOL.customerID>.IsRelatedTo<BAccount.bAccountID>))]
  34. public virtual Int32? CustomerID
  35. {
  36. get
  37. {
  38. return this._CustomerID;
  39. }
  40. set
  41. {
  42. this._CustomerID = value;
  43. }
  44. }
  45. #endregion

It appears that the [CustomerOrOrganizationInNoUpdateDocRestrictor] is not accessible. The project will not build and receive the following error:

Error CS0122 'CustomerOrOrganizationInNoUpdateDocRestrictor' is inaccessible due to its protection level

I have tried manipulating references, I would expect the attribute which is defined in PX.Objects.AR to work the same in my project as the PX.Objects.SO.

答案1

得分: 0

CustomerOrOrganizationInNoUpdateDocRestrictor 是一个内部类,所以您无法访问它。

您可以使用以下限制器代替:

[PXRestrictor(
typeof(Where<Customer.type, IsNotNull, Or<Current<PX.Objects.SO.SOOrder.aRDocType>,
Equal<ARDocType.noUpdate>, And<Current<PX.Objects.SO.SOOrder.behavior>, Equal<SOBehavior.tR>,
And<Where<BAccountR.type, In3<BAccountType.branchType, BAccountType.organizationType>>,
Or<PX.Objects.CR.BAccount.isBranch, Equal>>>>>),
"只能指定客户或公司业务账户。")]

英文:

CustomerOrOrganizationInNoUpdateDocRestrictor is an internal class, so you can't access it.

You can use this restrictor instead:

  1. [PXRestrictor(
  2. typeof(Where&lt;Customer.type, IsNotNull, Or&lt;Current&lt;PX.Objects.SO.SOOrder.aRDocType&gt;,
  3. Equal&lt;ARDocType.noUpdate&gt;, And&lt;Current&lt;PX.Objects.SO.SOOrder.behavior&gt;, Equal&lt;SOBehavior.tR&gt;,
  4. And&lt;Where&lt;BAccountR.type, In3&lt;BAccountType.branchType, BAccountType.organizationType&gt;,
  5. Or&lt;PX.Objects.CR.BAccount.isBranch, Equal&lt;True&gt;&gt;&gt;&gt;&gt;&gt;&gt;),
  6. &quot;Only a customer or company business account can be specified.&quot;)]

huangapple
  • 本文由 发表于 2023年6月2日 01:11:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/76384224.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定