Skip to main content
Answer

Error when inserting in table for the first time

  • April 5, 2023
  • 7 replies
  • 97 views

abdallaahmed61
Varsity III
Forum|alt.badge.img+1

Hello,

 

i have a problem with a screen that i have made,

when the table has zero records and i try to insert a record this error appears.

but when there is one or more records in the table, the insert happens successfully.

Appreciate your feedback.

 

Best answer by Naveen Boga

@abdallaahmed61  Hope you have removed Key for the Identify field.

And, here is the sample DAC field.

 


 #region TESTID
        [PXDBString(30, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXDefault()]
        [PXUIField(DisplayName = "TEST ID", Required = true)]
        [PXSelector(typeof(Search<MySetup.TransferNbr>), typeof(MySetup.TransferNbr), typeof(MySetup.description), typeof(MySetup.isActive))]
        public virtual string TransferNbr { get; set; }
        public abstract class transferNbr : BqlString.Field<transferNbr> { }

        #endregion


 

7 replies

abdallaahmed61
Varsity III
Forum|alt.badge.img+1

 

This is my DAC


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • April 6, 2023

Hi @abdallaahmed61  If I guess correctly, TransferNbr should be unique.

If this is the case, can you please mark TransferNbr as a key field at DAC level ( Is Key = True ) and check once?


abdallaahmed61
Varsity III
Forum|alt.badge.img+1

Hi @abdallaahmed61  If I guess correctly, TransferNbr should be unique.

If this is the case, can you please mark TransferNbr as a key field at DAC level ( Is Key = True ) and check once?

When i make this, when i write something in the transfer number it disappears after i click on another field


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • April 6, 2023

@abdallaahmed61  Can you please DAC field here?


abdallaahmed61
Varsity III
Forum|alt.badge.img+1

@abdallaahmed61  Can you please DAC field here?

you mean, make the edit and show you it ?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • April 6, 2023

@abdallaahmed61  Hope you have removed Key for the Identify field.

And, here is the sample DAC field.

 


 #region TESTID
        [PXDBString(30, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXDefault()]
        [PXUIField(DisplayName = "TEST ID", Required = true)]
        [PXSelector(typeof(Search<MySetup.TransferNbr>), typeof(MySetup.TransferNbr), typeof(MySetup.description), typeof(MySetup.isActive))]
        public virtual string TransferNbr { get; set; }
        public abstract class transferNbr : BqlString.Field<transferNbr> { }

        #endregion


 


abdallaahmed61
Varsity III
Forum|alt.badge.img+1

@abdallaahmed61  Hope you have removed Key for the Identify field.

And, here is the sample DAC field.

 


 #region TESTID
        [PXDBString(30, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXDefault()]
        [PXUIField(DisplayName = "TEST ID", Required = true)]
        [PXSelector(typeof(Search<MySetup.TransferNbr>), typeof(MySetup.TransferNbr), typeof(MySetup.description), typeof(MySetup.isActive))]
        public virtual string TransferNbr { get; set; }
        public abstract class transferNbr : BqlString.Field<transferNbr> { }

        #endregion


 

It Seems like the PXDefault was the solution, thank you so much for your time and effort.