Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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 如何获取自定义处理状态屏幕以显示处理的进度或记录_Acumatica - Fatal编程技术网

Acumatica 如何获取自定义处理状态屏幕以显示处理的进度或记录

Acumatica 如何获取自定义处理状态屏幕以显示处理的进度或记录,acumatica,Acumatica,我有一个定制的流程屏幕,它的工作原理与预期基本相同,只是在处理过程中弹出的状态/监视器屏幕没有显示进度,或者没有显示在其他库存处理屏幕上处理的记录 以下是股票处理弹出窗口的外观: 下面是我的自定义弹出窗口的外观。它不显示“剩余”,在完成之前,它看起来就像这样: 然后在完成时显示: 我是否需要在处理屏幕中添加一些内容以获得此功能 非常感谢…在处理方法中,您是否使用PXProcessing.SetCurrentItem(对象)设置当前处理项,然后使用PXProcessing.SetProces

我有一个定制的流程屏幕,它的工作原理与预期基本相同,只是在处理过程中弹出的状态/监视器屏幕没有显示进度,或者没有显示在其他库存处理屏幕上处理的记录

以下是股票处理弹出窗口的外观:

下面是我的自定义弹出窗口的外观。它不显示“剩余”,在完成之前,它看起来就像这样:

然后在完成时显示:

我是否需要在处理屏幕中添加一些内容以获得此功能


非常感谢…

在处理方法中,您是否使用PXProcessing.SetCurrentItem(对象)设置当前处理项,然后使用PXProcessing.SetProcessed()或PXProcessing.SetError(ExceptionObject)设置当前处理项的状态

例如:

public PXProcessing<SOLine> linesToBeProcessed;

protected virtual void ProcessOrderLines(List<SOLines> lines)
{
    foreach (SOLine line in lines)
    {
        PXProcessing<SOLine>.SetCurrentItem(line);
        try
        {
            //logic

            PXProcessing<SOLine>.SetProcessed();
        }
        catch (Exception ex)
        {
            PXProcessing<SOLine>.SetError(ex);
        } 
    }
}
待处理的公共PX处理行;
受保护的虚拟void ProcessOrderLines(列表行)
{
foreach(SOLine-line-in-line)
{
PXProcessing.SetCurrentItem(行);
尝试
{
//逻辑
PXProcessing.SetProcessed();
}
捕获(例外情况除外)
{
PXProcessing.SetError(ex);
} 
}
}

注意:这些方法中使用的DACNAME是声明的PXProcessing视图中使用的主DAC。

这是来自Acumatica Surveys项目的一段代码,描述了我们如何控制各种类型的消息传递。 注意SetInfo、SetWarning和SetError 让我知道这是否有用

/// <summary>
    /// This method will create a new collector record and invoke a notification on it.
    /// </summary>
    /// <param name="surveyUser"></param>
    /// <param name="graph"></param>
    /// <param name="surveyCurrent"></param>
    /// <param name="surveyUserList"></param>
    /// <param name="filter"></param>
    /// <remarks>
    /// </remarks>
    /// <returns>
    ///     Whether or not an error has occured within the process which is used by the main calling process to throw a final exception at the end of the process
    /// </returns>
    private static bool SendNew(SurveyUser surveyUser, SurveyCollectorMaint graph, Survey surveyCurrent, List<SurveyUser> surveyUserList, SurveyFilter filter) {
        bool errorOccurred = false;
        try {
            string sCollectorStatus = (surveyUser.UsingMobileApp.GetValueOrDefault(false)) ?
                                       SurveyResponseStatus.CollectorSent : SurveyResponseStatus.CollectorNew;
            graph.Clear();
            SurveyCollector surveyCollector = new SurveyCollector {
                CollectorName =
                    $"{surveyCurrent.SurveyName} {PXTimeZoneInfo.Now:yyyy-MM-dd hh:mm:ss}",
                SurveyID = surveyUser.SurveyID,
                UserID = surveyUser.UserID,
                CollectedDate = null,
                ExpirationDate = CalculateExpirationDate(filter.DurationTimeSpan),
                CollectorStatus = sCollectorStatus
            };
            surveyCollector = graph.Collector.Insert(surveyCollector);
            graph.Persist();
            SendNotification(surveyUser, surveyCollector);
            if (sCollectorStatus == SurveyResponseStatus.CollectorSent) {
                PXProcessing<SurveyUser>.SetInfo(surveyUserList.IndexOf(surveyUser), Messages.SurveySent);
            } else {
                PXProcessing<SurveyUser>.SetWarning(surveyUserList.IndexOf(surveyUser), Messages.NoDeviceError);
            }
        } catch (AggregateException ex) {
            errorOccurred = true;
            var message = string.Join(";", ex.InnerExceptions.Select(e => e.Message));
            PXProcessing<SurveyUser>.SetError(surveyUserList.IndexOf(surveyUser), message);
        } catch (Exception e) {
            errorOccurred = true;
            PXProcessing<SurveyUser>.SetError(surveyUserList.IndexOf(surveyUser), e);
        }
        return errorOccurred;
    }
//
///此方法将创建新的收集器记录并对其调用通知。
/// 
/// 
/// 
/// 
/// 
/// 
/// 
/// 
/// 
///主调用进程用于在进程结束时引发最终异常的进程内是否发生错误
/// 
私有静态bool SendNew(SurveyUser SurveyUser、SurveyCollectorMaint图、surveyCurrent、List surveyUserList、SurveyFilter筛选器){
bool erroroccurrent=false;
试一试{
字符串scoCollectorStatus=(surveyUser.UsingMobileApp.GetValueOrDefault(false))?
SurveyResponseStatus.CollectorSent:SurveyResponseStatus.CollectorNew;
graph.Clear();
SurveyCollector SurveyCollector=新的SurveyCollector{
收藏品名称=
$“{surveyCurrent.SurveyName}{PXTimeZoneInfo.Now:yyyy-MM-dd hh:MM:ss}”,
SurveyID=surveyUser.SurveyID,
UserID=surveyUser.UserID,
CollectedDate=null,
ExpirationDate=CalculateExpirationDate(filter.DurationTimeSpan),
CollectorStatus=sCollectorStatus
};
surveyCollector=graph.Collector.Insert(surveyCollector);
graph.Persist();
发送通知(surveyUser、surveyCollector);
if(SCOCollectorStatus==SurveyResponseStatus.CollectorSent){
PXProcessing.SetInfo(surveyUserList.IndexOf(surveyUser)、Messages.SurveySent);
}否则{
PXProcessing.SetWarning(surveyUserList.IndexOf(surveyUser)、Messages.NoDeviceError);
}
}捕获(聚合异常){
erroroccurrent=true;
var message=string.Join(;),ex.InnerExceptions.Select(e=>e.message));
PXProcessing.SetError(surveyUserList.IndexOf(surveyUser),message);
}捕获(例外e){
erroroccurrent=true;
PXProcessing.SetError(surveyUserList.IndexOf(surveyUser),e);
}
返回错误发生;
}

您是否有机会在此处查看日志:是的。事实上,这就是我在创建处理屏幕时使用的方法。没有提到状态监视器/弹出屏幕-因为它似乎是内置的…这就是我所缺少的。非常感谢,让·克劳德!。。。这很有帮助。非常感谢你,罗伯特;D