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?