Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Acumatica 在查找字段上抛出PXSetPropertyException仅显示ID_Acumatica - Fatal编程技术网

Acumatica 在查找字段上抛出PXSetPropertyException仅显示ID

Acumatica 在查找字段上抛出PXSetPropertyException仅显示ID,acumatica,Acumatica,当我在作为查找字段的网格字段的FieldVerification或FieldUpdate事件处理程序中抛出错误时,它仅以红色显示查找值的ID,而不是描述 错误抛出非常简单(见下文)。TField是通过泛型提供给我的方法的IBqlField throw new PXSetPropertyException<TField>(Message.WarehouseDoesntMatchShipTo, PXErrorLevel.Error); 抛出新的PXSetPropertyExcepti

当我在作为查找字段的网格字段的FieldVerification或FieldUpdate事件处理程序中抛出错误时,它仅以红色显示查找值的ID,而不是描述

错误抛出非常简单(见下文)。TField是通过泛型提供给我的方法的IBqlField

throw new PXSetPropertyException<TField>(Message.WarehouseDoesntMatchShipTo, PXErrorLevel.Error);
抛出新的PXSetPropertyException(Message.WarehouseDoesntMatchShipTo,PXErrorLevel.Error);

有没有办法让它以红色显示描述?

在引发异常之前,尝试将新值设置为仓库CD字符串值。需要在示例中插入查询

如果需要旧仓库CD值(用户尝试更改之前的值),只需将PXSelect中使用的值更改为row.SiteID

protected virtual void SOLine_SiteID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
{
    var row = (SOLine)e.Row;
    if (row == null)
    {
        return;
    }

    INSite inSite = PXSelect<INSite, Where<INSite.siteID, Equal<Required<INSite.siteID>>>>.Select(this, e.NewValue);
    e.NewValue = inSite?.SiteCD;
    throw new PXSetPropertyException($"Invalid Warehouse {inSite?.SiteCD}", PXErrorLevel.Error);
}
protected virtual void SOLine\u SiteID\u FieldVerifying(PXCache发送方,PXFieldVerifyingEventArgs e)
{
var行=(SOLine)e.row;
if(行==null)
{
返回;
}
INSite INSite=PXSelect.Select(这个,例如NewValue);
e、 NewValue=inSite?.SiteCD;
抛出新的PXSetPropertyException($“无效仓库{inSite?.SiteCD}”,PXErrorLevel.Error);
}