Why is 'CustomerOrOrganizationInNoUpdateDocRestrictor' inaccessible in my Acumatica project?

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

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!

#region CustomerID
		public abstract class customerID : BqlInt.Field<customerID>
		{
			public class PreventEditBAccountCOrgBAccountID<TGraph> :
				PreventEditBAccountRestrictToBase<BAccount.cOrgBAccountID, TGraph, NXBOL,
					SelectFrom<NXBOL>
					.Where<NXBOL.bolType.IsNotEqual<NXBOLType.nonProductMovement>.
						And<NXBOL.customerID.IsEqual<BAccount.bAccountID.FromCurrent>>>>
				where TGraph : PXGraph
			{
				protected override string GetErrorMessage(BAccount baccount, NXBOL document, string documentBaseCurrency)
				{
					return PXMessages.LocalizeFormatNoPrefix(Messages.CannotChangeRestricToIfShipmentExists,
						documentBaseCurrency, baccount.AcctCD, document.BOLNbr);
				}
			}

			public class PreventEditBAccountCOrgBAccountIDOnVendorMaint : PreventEditBAccountCOrgBAccountID<VendorMaint>
			{
				public static bool IsActive()
					=> PXAccess.FeatureInstalled<FeaturesSet.multipleBaseCurrencies>();
			}

			public class PreventEditBAccountCOrgBAccountIDOnCustomerMaint : PreventEditBAccountCOrgBAccountID<CustomerMaint>
			{
				public static bool IsActive()
					=> PXAccess.FeatureInstalled<FeaturesSet.multipleBaseCurrencies>();
			}
		}
		protected Int32? _CustomerID;
		[CustomerActive(
			typeof(Search<BAccountR.bAccountID, Where<True, Equal<True>>>), // TODO: remove fake Where after AC-101187
			Visibility = PXUIVisibility.SelectorVisible, Required = true)]
		[CustomerOrOrganizationInNoUpdateDocRestrictor]
		[PXForeignReference(typeof(Field<NXBOL.customerID>.IsRelatedTo<BAccount.bAccountID>))]
		public virtual Int32? CustomerID
		{
			get
			{
				return this._CustomerID;
			}
			set
			{
				this._CustomerID = value;
			}
		}
		#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:

[PXRestrictor(
        typeof(Where&lt;Customer.type, IsNotNull, Or&lt;Current&lt;PX.Objects.SO.SOOrder.aRDocType&gt;,
            Equal&lt;ARDocType.noUpdate&gt;, And&lt;Current&lt;PX.Objects.SO.SOOrder.behavior&gt;, Equal&lt;SOBehavior.tR&gt;,
                And&lt;Where&lt;BAccountR.type, In3&lt;BAccountType.branchType, BAccountType.organizationType&gt;,
                    Or&lt;PX.Objects.CR.BAccount.isBranch, Equal&lt;True&gt;&gt;&gt;&gt;&gt;&gt;&gt;),
        &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:

确定