English 中文(简体)
Error in PXSelect for Acumatica 2022 R2 but not 2021 R2 on Custom Table
原标题:
  • 时间:2023-06-13 02:44:06
  •  标签:
  • c#
  • acumatica

I have an SQL database shown here:

SELECT [CompanyID]
      ,[ScreenID]
      ,[BaseUrl]
      ,[UrlNumber]
      ,[DACNameList]
      ,[ParamList]
      ,[UrlVariableList]
      ,[Status]
      ,[NoteID]
      ,[PKID]
  FROM [DoorForms]

I used the ERP to generate a DAC from it like this:

using System;
using PX.Data;

namespace DoorForms
{
  [Serializable]
  [PXCacheName("DoorForms")]
  public class DoorForms : IBqlTable
  {
    #region ScreenID
    [PXDBString(40, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "Screen ID")]
    public virtual string ScreenID { get; set; }
    public abstract class screenID : PX.Data.BQL.BqlString.Field<screenID> { }
    #endregion

    #region BaseUrl
    [PXDBString(40, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "Base Url")]
    public virtual string BaseUrl { get; set; }
    public abstract class baseUrl : PX.Data.BQL.BqlString.Field<baseUrl> { }
    #endregion

    #region UrlNumber
    [PXDBString(40, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "Url Number")]
    public virtual string UrlNumber { get; set; }
    public abstract class urlNumber : PX.Data.BQL.BqlString.Field<urlNumber> { }
    #endregion

    #region DACNameList
    [PXDBString(120, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "DACName List")]
    public virtual string DACNameList { get; set; }
    public abstract class dACNameList : PX.Data.BQL.BqlString.Field<dACNameList> { }
    #endregion

    #region ParamList
    [PXDBString(120, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "Param List")]
    public virtual string ParamList { get; set; }
    public abstract class paramList : PX.Data.BQL.BqlString.Field<paramList> { }
    #endregion

    #region UrlVariableList
    [PXDBString(120, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "Url Variable List")]
    public virtual string UrlVariableList { get; set; }
    public abstract class urlVariableList : PX.Data.BQL.BqlString.Field<urlVariableList> { }
    #endregion

    #region Status
    [PXDBString(10, IsUnicode = true, InputMask = "")]
    [PXUIField(DisplayName = "Status")]
    public virtual string Status { get; set; }
    public abstract class status : PX.Data.BQL.BqlString.Field<status> { }
    #endregion

    #region Noteid
    [PXNote()]
    public virtual Guid? Noteid { get; set; }
    public abstract class noteid : PX.Data.BQL.BqlGuid.Field<noteid> { }
    #endregion
  }
}

And I have code that works in 2021 R2 to select it:

internal bool CheckForDoorFormsOnScreen()
{
    var ApptFormInfo = SelectFrom<DoorForms>
        .Where<DoorForms.screenID.IsEqual<@P.AsString>>
        .View.Select(Base, AppointmentScreenID);

    if (ApptFormInfo == null)
        return false;
    try
    {
        DoorForms ApptFormSetup = ApptFormInfo.TopFirst;
...

Everything works fine in 2021 R2. But when I run the same code in 2022 R2, it gives me an error.

EDIT: I even have tried removing the WHERE clause like this:

        var ApptFormInfo = SelectFrom<DoorForms>               
            .View.Select(Base);

And still no rows are selected.

Stepping through the breakpoints, I see it runs the line of:

ApptFormInfo != null.

But there are no rows selected -- and there should be.

So, the line for: DoorForms ApptFormSetup = ApptFormInfo.TopFirst;

sets the variable ApptFormSetup to null.

I copied the database file exactly. The code is the same. And it is workign in 2021 R2, but not 2022 R2.

Is this an anomaly in the upgrade?

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签