Solved

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

  • 8 February 2022
  • 5 replies
  • 349 views

Userlevel 4
Badge +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.

 

 

icon

Best answer by MoulaliShaik79 9 February 2022, 05:07

View original

5 replies

Userlevel 7
Badge +17

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

}

 

Userlevel 4
Badge +1

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.

Userlevel 7
Badge +11

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.
 

Userlevel 4
Badge +1

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.

Userlevel 7
Badge +17

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

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved