How to resolve a Result set index too big on Custom Field?
Hi all,
This is a custom screen with a custom DAC and table.
I keep getting an error after I have inserted a row on a custom field.
Error: An error occurred during processing of the field RawMaterial: Result set index too big..
I have a few decimal fields on the DAC:
#region LabourQty >PXDBDecimal()] >PXDefault(TypeCode.Decimal,"0.0")] >PXUIField(DisplayName = "LabourQty", Enabled = false)] public virtual Decimal? LabourQty { get; set; } public abstract class labourQty : PX.Data.BQL.BqlDecimal.Field<labourQty> { } #endregion
#region RawMaterial >PXDBDecimal()] >PXDefault(TypeCode.Decimal,"0.0")] >PXUIField(DisplayName = "RawMaterial", Enabled = false)] public virtual Decimal? RawMaterial { get; set; } public abstract class rawMaterial : PX.Data.BQL.BqlDecimal.Field<rawMaterial> { } #endregion
But for some reason I only get the error on the RawMaterial field every time after a row is inserted.
The actual value is either 0.00 or 1.0 which wouldn’t normally throw such an exception.
I have also tried changing the the field type from Decimal(26,6) to Decimal(9,2) but still the same result.
Any help would be greatly appreciated.
Page 1 / 1
The error sounds to me like it would be a problem with the view. Can you detail how you're inserting?
Hi Daryl,
Currently, I only use the PXSAVE / PXInsert standard functionality.
I added an Entry graph when I created the screen and only added the following:
// Standard public PXSave<LTFGHeader> Save; public PXCancel<LTFGHeader> Cancel; public PXInsert<LTFGHeader> Insert; public PXDelete<LTFGHeader> Delete; public PXCopyPasteAction<LTFGHeader> CopyPaste; public PXFirst<LTFGHeader> First; public PXPrevious<LTFGHeader> Prev; public PXNext<LTFGHeader> Next; public PXLast<LTFGHeader> Last;
// Selection public SelectFrom<LTFGHeader>.View FinishedGoods;
Then the LTFGHeader DAC:
using System; using PX.Data; using PX.Objects.CS; using PX.Objects.IN; using PX.Objects.GL; using PX.Data.ReferentialIntegrity.Attributes;
namespace MALTFinishedGoods { Serializable] PXCacheName("LTFGHeader")] public class LTFGHeader : IBqlTable { //public class PK : PrimaryKeyOf<LTFGHeader>.By<batchNbr> //{ // public static LTFGHeader Find(PXGraph graph, int? batchNbr) => FindBy(graph, batchNbr); //}
#region FinGoodsID PXDBIdentity(IsKey = true)] public virtual int? FinGoodsID { get; set; } public abstract class finGoodsID : PX.Data.BQL.BqlInt.Field<finGoodsID> { } #endregion
#region FinGoodsCD PXDBString(45, IsUnicode = true, InputMask = "")] PXUIField(DisplayName = "Description")] public virtual string FinGoodsCD { get; set; } public abstract class finGoodsCD : PX.Data.BQL.BqlString.Field<finGoodsCD> { } #endregion
#region CreatedByID PXDBCreatedByID()] PXUIField(DisplayName = "Created By ID")] public virtual Guid? CreatedByID { get; set; } public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { } #endregion
#region CreatedByScreenID PXDBCreatedByScreenID()] PXUIField(DisplayName = "Created By Screen ID")] public virtual string CreatedByScreenID { get; set; } public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { } #endregion
#region CreatedDateTime PXDBCreatedDateTime()] public virtual DateTime? CreatedDateTime { get; set; } public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { } #endregion
#region LastModifiedByID PXDBLastModifiedByID()] PXUIField(DisplayName = "Last Modified By ID")] public virtual Guid? LastModifiedByID { get; set; } public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { } #endregion
#region LastModifiedByScreenID PXDBLastModifiedByScreenID()] PXUIField(DisplayName = "Last Modified By Screen ID")] public virtual string LastModifiedByScreenID { get; set; } public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { } #endregion
#region LastModifiedDateTime PXDBLastModifiedDateTime()] public virtual DateTime? LastModifiedDateTime { get; set; } public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { } #endregion
#region OutItemAmt PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "Amount", Enabled = false)] public virtual Decimal? OutItemAmt { get; set; } public abstract class outItemAmt : PX.Data.BQL.BqlDecimal.Field<outItemAmt> { } #endregion
#region OutItemQty PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "OutItemQty", Enabled = false)] public virtual Decimal? OutItemQty { get; set; } public abstract class outItemQty : PX.Data.BQL.BqlDecimal.Field<outItemQty> { } #endregion
#region MaterialAmt PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "Amount", Enabled = false)] public virtual Decimal? MaterialAmt { get; set; } public abstract class materialAmt : PX.Data.BQL.BqlDecimal.Field<materialAmt> { } #endregion
#region MaterialQty PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "MaterialQty", Enabled = false)] public virtual Decimal? MaterialQty { get; set; } public abstract class materialQty : PX.Data.BQL.BqlDecimal.Field<materialQty> { } #endregion
#region LabourAmt PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "Amount", Enabled = false)] public virtual Decimal? LabourAmt { get; set; } public abstract class labourAmt : PX.Data.BQL.BqlDecimal.Field<labourAmt> { } #endregion
#region LabourQty PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "LabourQty", Enabled = false)] public virtual Decimal? LabourQty { get; set; } public abstract class labourQty : PX.Data.BQL.BqlDecimal.Field<labourQty> { } #endregion
#region RawMaterial PXDBDecimal()] PXDefault(TypeCode.Decimal,"0.0")] PXUIField(DisplayName = "RawMaterial", Enabled = false)] public virtual Decimal? RawMaterial { get; set; } public abstract class rawMaterial : PX.Data.BQL.BqlDecimal.Field<rawMaterial> { } #endregion } }
Hi, @DewaldH There are a couple of suggestions from my end that may help you!
Instead of declaring all the standard actions, you can declare your graph like below, by default Acumatica will provide the standard actions to the form.
Ex: public class mytestgraph : PXGraph<mytestgraph,FinishedGoods >
{
public SelectFrom<LTFGHeader>.View FinishedGoods;
}
You already mentioned that the PXDBIdentity field i.e. FinGoodsID is a KEY field and no need to declare another field i.e. BatchNbr as KEY (you can remove this)
The below fields are static dropdown fields, hence size should not be 45, provide the database size accordingly.
Status
BatchType
ProcessType,
For all the Decimal fields, the default attribute should be declared like below.
Apart from this, I don’t see any issue with the DAC and Graph code.
Can you please provide the below details?
How many records are there in this table? -LTFGHeader
How did you declare the decimal fields in the database like scale and precisions?
Hi Naveen,
Thanks for the tips, I have adjusted my DAC and Graph accordingly.
I cleared all the tables and re-published with a clean-up.
Afterwards, I added a record and saved. Works perfectly.
But as soon as I navigate, reload or try to add another one, I get this:
So, to answer your questions:
Currently, only one record.
Table declarations are as follows: I originally had it as decimal(25,6) but tried different variations but with the same result.
Thanks
HI @DewaldH There are minor changes required on the data base sizes but I’m sure that will not cause this issue.
This error is strange to me!!
If possible, can you please create a separate customization package for this form and share (including .aspx files, Database scripts (tables), DAC file, and Graph code file). I can check from my end and let you know.
Hi Naveen,
I am definitely going to try that today and let you know.
Thanks
So I have created a new instance of Acumatica, recreated everything from sractch but this time, I left out the Raw Materials field and now the error moves to the previous field.
Error: An error occurred during processing of the field LabourQty: Result set index too big..
Trace:
5/04/2022 10:26:26 AM Error: Error: An error occurred during processing of the field LabourQty: Result set index too big..
System.IndexOutOfRangeException: Result set index too big. at Devart.Data.MySql.MySqlDataReader.a(Int32 A_0, String A_1) at Devart.Data.MySql.MySqlDataReader.IsDBNull(Int32 i) at PX.Data.PXDataRecord.GetString(Int32 i) at PX.MySql.PXMySqlDataRecord.GetDecimal(Int32 i) at PX.Data.PXDBDecimalAttribute.RowSelecting(PXCache sender, PXRowSelectingEventArgs e) at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly) at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly) at PX.Data.PXCache`1.Select(PXDataRecord record, Int32& position, Boolean isReadOnly, Boolean& wasUpdated) at PX.Data.PXView.CreateItem(PXCache cache, PXDataRecord record, Int32& position, Boolean isReadOnly, Boolean& wasUpdated) at PX.Data.PXView.CreateResult(PXCachee] caches, PXDataRecord rec, Boolean hascount, Boolean& overrideSort, Boolean& extFilter) at PX.Data.PXView.GetResult(Objectt] parameters, PXFilterRoww] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumnn] sorts, Boolean& overrideSort, Boolean& extFilter) at PX.Data.PXView.Select(Objectt] currents, Objectt] parameters, Objectt] searches, Stringg] sortcolumns, Booleann] descendings, PXFilterRoww] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows) at PX.Data.PXGraph.ExecuteSelect(String viewName, Objectt] currents, Objectt] parameters, Objectt] searches, Stringg] sortcolumns, Booleann] descendings, PXFilterRoww] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
I believe this is issue in the Devart library. Will update once I have more info.
I have finally resolved the issue.
It was the PeriodID] attribute linked to TransPeriodID field that was causing the issue. Took me an entire day of debugging, but finally narrowed it down.