Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/5.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,将日记账分录说明字段设置为必填字段,代码如下: 使用PX.Objects.CR; 使用PX.Data.EP using System; using System.Collections; using System.Collections.Generic; using System.Web; using System.Linq; using PX.Api; using PX.Data; using PX.Common; using PX.Objects.Common; using PX.Objec

将日记账分录说明字段设置为必填字段,代码如下: 使用PX.Objects.CR; 使用PX.Data.EP

using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Linq;
using PX.Api;
using PX.Data;
using PX.Common;
using PX.Objects.Common;
using PX.Objects.CS;
using PX.Objects.CM;
using PX.Objects.CA;
using PX.Objects.FA;
using PX.Objects.GL.JournalEntryState;
using PX.Objects.GL.JournalEntryState.PartiallyEditable;
using PX.Objects.GL.Overrides.PostGraph;
using PX.Objects.GL.Reclassification.UI;
using PX.Objects.PM;
using PX.Objects.TX;
using PX.Objects;
using PX.Objects.GL;

namespace PX.Objects.GL
{

  public class JournalEntry_Extension:PXGraphExtension<JournalEntry>
  {

    #region Event Handlers
    //start my code
    [PXDefault]
    [PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute), "Required", true)]
    //end my code

    [PXUIField(DisplayName = "Description", Visibility = PXUIVisibility.Visible)]
    [PXDBString(255, IsUnicode = true)]
    protected virtual void Batch_Description_CacheAttached(PXCache cache)
    {

    }





    #endregion

  }


}
使用系统;
使用系统集合;
使用System.Collections.Generic;
使用System.Web;
使用System.Linq;
使用PX.Api;
使用PX数据;
使用PX.Common;
使用PX.Objects.Common;
使用PX.Objects.CS;
使用PX.Objects.CM;
使用PX.Objects.CA;
使用PX.Objects.FA;
使用PX.Objects.GL.JournalEntryState;
使用PX.Objects.GL.JournalEntryState.partiallyEdit;
使用PX.Objects.GL.Overrides.PostGraph;
使用PX.Objects.GL.rescription.UI;
使用PX.Objects.PM;
使用PX.Objects.TX;
使用PX.Objects;
使用PX.Objects.GL;
命名空间PX.Objects.GL
{
公共类JournalEntry_扩展:pxGrapherExtension
{
#区域事件处理程序
//启动我的代码
[默认值]
[PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute),“必需”,true)]
//结束我的代码
[PXUIField(DisplayName=“Description”,Visibility=PXUIVisibility.Visible)]
[PXDBString(255,IsUnicode=true)]
受保护的虚拟无效批处理\u说明\u缓存已连接(PXCache缓存)
{
}
#端区
}
}
但是,我在浏览记录时收到一条错误消息,如下所示:

错误: 错误:处理字段说明时出错:无法将“System.Boolean”类型的对象强制转换为“System.String”类型

不知道我做错了什么
谢谢

您可以使用PXUIField属性将Required属性设置为True。请参见下面的示例(请注意,所需属性上没有引号):

公共类JournalEntry\u扩展名:pxGrapherExtension
{
#区域事件处理程序
[默认值]
[PXUIField(DisplayName=“Description”,可见性=PXUIVisibility.Visible,必需=true)]
[PXDBString(255,IsUnicode=true)]
受保护的虚拟无效批处理\u说明\u缓存已连接(PXCache缓存)
{
}
#端区
}

您可以使用PXUIField属性将Required属性设置为True。请参见下面的示例(请注意,所需属性上没有引号):

公共类JournalEntry\u扩展名:pxGrapherExtension
{
#区域事件处理程序
[默认值]
[PXUIField(DisplayName=“Description”,可见性=PXUIVisibility.Visible,必需=true)]
[PXDBString(255,IsUnicode=true)]
受保护的虚拟无效批处理\u说明\u缓存已连接(PXCache缓存)
{
}
#端区
}

非常感谢这项功能,但它也适用于从其他模块创建的所有日记账分录(当用户创建手动日记账时,我需要的只是图形级别或屏幕级别的块),如果您需要可选的,请查看PXUIRequired。下面是一个示例:[PXUIRequired(typeof(Where))]我的原始代码基于Acumatica帮助文件,并使用以下在图形级别[PXDefault][PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute),“Required”,true)]下定义的格式受保护的void DACName\u FieldPropertyName\u CacheAttached(PXCache cache){不确定为什么不能使用此选项使字段仅在一个屏幕上成为必填字段。虽然感谢BrendanThanks,了解条件必需选项很好,但它也适用于从其他模块创建的所有日记账分录(当用户创建手动日记账时,我需要的只是图形级或屏幕级块),如果您需要可选的必需项,请查看PXUIRequired。下面是一个示例:[PXUIRequired(typeof(Where))]我的原始代码基于Acumatica帮助文件,并使用以下在图形级别[PXDefault][PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute),“Required”,true)]下定义的格式受保护的void DACName\u FieldPropertyName\u CacheAttached(PXCache cache){不确定为什么不能使用此选项使字段仅在一个屏幕上成为必填字段。很高兴知道有条件的必需选项,不过谢谢Brendan
public class JournalEntry_Extension : PXGraphExtension<JournalEntry>
{

    #region Event Handlers
    [PXDefault]
    [PXUIField(DisplayName = "Description", Visibility = PXUIVisibility.Visible, Required = true)]
    [PXDBString(255, IsUnicode = true)]
    protected virtual void Batch_Description_CacheAttached(PXCache cache)
    {

    }
    #endregion
}