Skip to main content
Answer

AutoNumbering PXSelector value back to (NEW) when I select value from selector.

  • February 8, 2022
  • 5 replies
  • 446 views

Forum|alt.badge.img+1

Hi All,

I have created an Autonumbering  for my DAC & applied newly created autonumbering sequence to one of my DAC field. I made autonumbering field as PXSelector to select existing record.

But, here I am facing some issue: Whenever I select a value from the AutoNumbering  Selector field  then its value setting back to <NEW> instead of selected value.

 

Code:

    #region AgreementNumberingID
        [PXDBString(10, IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "Agreement Numbering ID", Visibility = PXUIVisibility.SelectorVisible)]
        [PXDefault("DEMO")]
        [PXSelector(typeof(Numbering.numberingID), DescriptionField = typeof(Numbering.descr))]
        public virtual string AgreementNumberingID { get; set; }
        public abstract class agreementNumberingID : PX.Data.BQL.BqlString.Field<agreementNumberingID> { }
        #endregion
        
        
        DAC: TestAgreement
        ==================
         #region AgreeNbr
        [PXDBString(15, IsKey = true, IsUnicode = true, InputMask = "")]
        [PXDefault]
        [AutoNumber(typeof(Demo.agreementNumberingID), typeof(TestAgreement.agreeDate))]
        [PXSelector(typeof(TestAgreement.agreeNbr),
            SubstituteKey = typeof(TestAgreement.agreeNbr))]
        [PXUIField(DisplayName = "Agreement", Visibility = PXUIVisibility.SelectorVisible)]
        public virtual string AgreeNbr { get; set; }
        public abstract class agreeNbr : PX.Data.BQL.BqlString.Field<agreeNbr> { }
        #endregion
        
        Aspx-file:
        ==========
          <px:PXSelector SuppressLabel="False" runat="server" ID="edAgreeNbr"
                FilterByAllFields="True"
                DataField="AgreeNbr"></px:PXSelector>

 

 

Could you please assist me on this.

 

 

Thanks in Advance,

Moulali Shaik.

 

 

Best answer by MoulaliShaik79

Hi @Naveen B  & @jinin ,

Good Morning.

I have resolved it. It is a DataView issue.

Thanks a lot for your replies to assist me. Really, you guys are doing good job, keep going on.

Have a great day!.

 

Thanks,

Moulali Shaik.

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 8, 2022

Hi, @MoulaliShaik79  Below is the sample code for generating Auto Numbering Sequence and it is working as expected.

Hope this helps!!

 

  public class TestAutomNumberingSequence
{
public class TestAutoNbrAttribute : PXSelectorAttribute
{
public TestAutoNbrAttribute(Type SearchType) : base(SearchType, typeof(DACName.refNbr),
typeof(DACName.status),typeof(DACName.description),
typeof(DACName.siteID))
{
}
}
public class NumberingAttribute : AutoNumberAttribute
{
public NumberingAttribute()
: base(typeof(Search<KNSOSetupExt.usrTestField>), typeof(AccessInfo.businessDate))

{ }
}
}

public class KNSOSetupExt : PXCacheExtension<SOSetup>
{
#region UsrTestField
[PXDBString(15, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Test Numbering Sequence", Required = true)]
[PXSelector(typeof(Numbering.numberingID), DescriptionField = typeof(Numbering.descr))]
public virtual string UsrTestField { get; set; }
public abstract class usrTestField : BqlString.Field<usrTestField> { }
#endregion
}


public class DACName : IBqlTable
{
#region RefNbr
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Ref Nbr", Visibility = PXUIVisibility.SelectorVisible)]
[TestAutomNumberingSequence.DeckAutoNbr(typeof(Search<RefNbr>), DescriptionField = typeof(description), Filterable = true)]
[TestAutomNumberingSequence.Numbering()]
[PX.Data.EP.PXFieldDescription]
public virtual string RefNbr { get; set; }
public abstract class refNbr : BqlString.Field<refNbr> { }
#endregion

#region Status
[PXDBString(1, IsFixed = true)]
[PXUIField(DisplayName = "Status", Enabled = false, Visibility = PXUIVisibility.SelectorVisible)]
[PXDefault(KNConstants.Hold)]
[DeckStatusList.DeckList]
public virtual string Status { get; set; }
public abstract class status : BqlString.Field<status> { }
#endregion

#region Description
[PXDBString(50, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Description", Enabled = false)]
public virtual string Description { get; set; }
public abstract class description : BqlString.Field<description> { }
#endregion

#region Warehouse

[Site]
[PXUIField(DisplayName = "Warehouse", IsReadOnly = true)]
public virtual int? SiteID { get; set; }
public abstract class siteID : BqlInt.Field<siteID> { }
#endregion

}

 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • February 8, 2022

Hi @Naveen B ,

 I have tried with your code snippet. But still facing the same issue. I have used existing numbering seq with the below one :

[AutoNumber(typeof(CRSetup.quoteNumberingID), typeof(AccessInfo.businessDate))]

Ex:

#region AgreeNbr
        protected String _AgreeNbr;
        [PXDBString(15, IsUnicode = true, IsKey = true, InputMask = "")]
        [PXDefault()]
        [PXUIField(DisplayName = "Agreement", Visibility = PXUIVisibility.SelectorVisible)]
        [AutoNumber(typeof(CRSetup.quoteNumberingID), typeof(AccessInfo.businessDate))]
        [PXSelector(typeof(agreeNbr),SubstituteKey = typeof(agreeNbr))]
        public virtual String AgreeNbr
        {
            get
            {
                return this._AgreeNbr;
            }
            set
            {
                this._AgreeNbr = value;
            }
        }
        #endregion

Still facing the same issue.

Note: I am using Acumatica Build 21.202.0054.

Thanks,

Moulali Shaik.


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • February 8, 2022

Hi @MoulaliShaik79 

Your code seems to be correct. Same as the existing numbering sequence, Can you try with the existing DAC for the PXSelector Attribute? So it's easy to identify the root cause of the issue.
 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • Answer
  • February 9, 2022

Hi @Naveen B  & @jinin ,

Good Morning.

I have resolved it. It is a DataView issue.

Thanks a lot for your replies to assist me. Really, you guys are doing good job, keep going on.

Have a great day!.

 

Thanks,

Moulali Shaik.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • February 9, 2022

Thanks for sharing the update on the root cause of this issue  @MoulaliShaik79