我们正在考虑进行自定义 SalesLineType_Sales,我们需要在下面的“pdsMRCCheckRestricted”方法中为“SalesQty”添加验证。
现在,我们知道自定义不受欢迎,因此寻找任何建议或最佳实践以适当地完成它。
1- 我们可以自定义“SalesLineType_Sales” - 但这是 Dynamics 365 for Operations 的最佳做法吗?2-还有其他可能的选择吗?
任何意见将不胜感激!
public boolean pdsMRCCheckRestricted()
{
boolean isRestricted = false;
AddressCountryRegionId deliveryCountryId;
AddressStateId deliveryStateId;
deliveryCountryId = salesLine.deliveryAddress().CountryRegionId ?
salesLine.deliveryAddress().CountryRegionId : salesTable.deliveryAddress().CountryRegionId;
deliveryStateId = salesLine.deliveryAddress().State ?
salesLine.deliveryAddress().State : salesTable.deliveryAddress().State;
if (salesLine.SalesQty > 0)
{
isRestricted = PdsMRCRestrictedListByItem::checkItemRestrictedForState(
deliveryCountryId,
deliveryStateId,
salesLine.ItemId);
if (!isRestricted)
{
isRestricted =
PdsMRCRestrictedListByItem::checkItemRestrictedForCountry(
deliveryCountryId,
salesLine.ItemId);
}
if (isRestricted)
{
error(strFmt("@PDS908", salesLine.ItemId));
}
}
return isRestricted;
}