PXException在网格中抛出错误而不是错误消息

时间:2015-04-23 22:48:30

标签: acumatica

我正在使用PXException,但是它没有在网格中显示错误消息,而是抛出了未处理的异常。

throw new PXException("Error message");

错误讯息 -

我遇到错误 -

错误:错误#145:尚未处理一个或多个项目。发送 提出时间:2015年4月24日下午2:38:55屏幕:ES.60.60.60命令:处理
   细节: 4/24/2015 2:38:55 PM错误: 错误#145:尚未处理一个或多个项目。

at PX.Data.PXProcessingBase 1.<>c__DisplayClass13 1.b__11(List 1 list) at PX.Data.PXProcessing 1.Process(PXAdapter adapter)    在PX.Data.PXAction 1.a(PXAdapter A_0) at PX.Data.PXAction 1.d__c.MoveNext()    在PX.Data.PXAction`1.d__c.MoveNext()    在PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName,String [] sortcolumns,Boolean [] descendings,Object [] search,Object [] parameters,PXFilterRow [] filters,DataSourceSelectArguments arguments,Boolean&amp; closeWindowRequired,Int32&amp; adapterStartRow, Int32&amp; adapterTotalRows)    在PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName,DataSourceSelectArguments arguments,PXDSSelectArguments pxarguments)

2 个答案:

答案 0 :(得分:2)

您可以使用此

$('document').ready(function(){
    var cartArray = JSON.parse(localStorage.getItem("cart"));
    console.log(cartArray);
    parseData(cartArray);
})

    function parseData(item){

        // grab a clone of the aside
        $copy = $('.cart-selection').clone();

        //loop through and append a clone with modified JSON information for each item in the cart array
        for(i=0; i<item.length; i++){
            console.log(i);
            $('h2', $copy).html(item[i].name);
            $('img', $copy).attr("src", item[i].url);
            $copy.appendTo($('product-list'));
        }           
    }

编辑语法:

throw new PXSetPropertyException("Message", PXErrorLevel.RowError);

在深入研究Acumatica源代码后,我发现了这个:

sender.RaiseExceptionHandling("fieldName", row, null, new PXSetPropertyException("Message", PXErrorLevel.RowError))

i - 您当前处理记录的索引; e - 例外

答案 1 :(得分:0)

我遇到了同样的问题,问题是我的网格指向了我的PXSelect<...>数据视图,而不是PXProcessing<...>数据视图。
我还在网格上设置了以下属性(与现有的工作处理窗口相同)。 AllowPaging = true
BatchUpdate = true
ID = grid
SkinID = PrimaryInquire
AllowSearch = True
NoteIndicator = True

现在就像其他屏幕一样工作。