有没有办法动态地在Acumatica中构建查找?有点像你可以使用视图委托做网格。基本上我需要能够在INLotSerialStatus表上运行一些计算,它显示了批量。根据这些计算,我想显示正确的批次和更新的数量。
到目前为止,我这样做的方法是创建一个临时表和一个DAC,以便从某个地方填充它(不知道从哪个地方做到这一点)并使用这个临时表作为查找。我看到了各种各样的问题,例如多个用户正确更新了这个查找,即使我在这个临时表中有用户ID和库存ID。
答案 0 :(得分:2)
还为 PXCustomSelectorAttribute 实现了与数据视图委托相同的概念。您应该继承 PXCustomSelectorAttribute 并声明 GetRecords()方法返回 IEnumerable :
public class PXWeekSelectorAttribute : PXCustomSelectorAttribute
{
...
protected IEnumerable GetRecords()
{
...
var cache = _Graph.Caches[_CacheType];
var startDate = cache.GetValue(cache.Current, _startDateOrdinal);
return GetRecordsByDate((DateTime?)startDate);
}
...
public static IEnumerable GetRecordsByDate(DateTime? startDate)
{
if (startDate == null) yield break;
var date = (DateTime)startDate;
var dateWeek = PX.Data.EP.PXDateTimeInfo.GetWeekNumber(date);
var utcDate = PXTimeZoneInfo.ConvertTimeToUtc(date, LocaleInfo.GetTimeZone());
var utcDateWeek = PX.Data.EP.PXDateTimeInfo.GetWeekNumber(utcDate);
if (dateWeek != utcDateWeek)
{
if (date > utcDate)
{
yield return new EPWeek { WeekID = utcDate.Year * 100 + utcDateWeek };
yield return new EPWeek { WeekID = date.Year * 100 + dateWeek };
}
else
{
yield return new EPWeek { WeekID = date.Year * 100 + dateWeek };
yield return new EPWeek { WeekID = utcDate.Year * 100 + utcDateWeek };
}
}
else
yield return new EPWeek { WeekID = date.Year * 100 + dateWeek };
}
...
}