Solved

Making the selector show the CD - Description rather than just the CD

  • 23 June 2022
  • 2 replies
  • 203 views

Userlevel 6
Badge +3

I have a selector that, after you select a value, only shows the “CD” of the field.  I want it to show the “CD - Description”.

When you click the lookup, you see this:

After you select a row, you see this:

I want it to show T1 - test1

Note that if I add DescriptionField = typeof(SSGCRServiceType.description))], the field clears out after the row is selected.  I don’t know why that occurs.  Maybe because the field value in the table is int?

Does anyone know what I need to modify in this select statement to make this happen?

#region UsrServiceTypeID
[PXDBInt]
[PXUIField(DisplayName = "Service Type", Required = true)]
[PXDefault(PersistingCheck = PXPersistingCheck.Null)]
[PXSelector(typeof(Search2<SSGCRServiceType.serviceTypeID,
InnerJoin<SSGCRServTypeRecTypeXR,
On<SSGCRServTypeRecTypeXR.serviceTypeID.IsEqual<SSGCRServiceType.serviceTypeID>>>,
Where<SSGCRServTypeRecTypeXR.recordTypeID.IsEqual<CRCaseExt.usrRecordTypeID.FromCurrent>.
And<SSGCRServiceType.isActive.IsEqual<True>>.
And<SSGCRServTypeRecTypeXR.isActive.IsEqual<True>>>>),
typeof(SSGCRServiceType.serviceTypeCD),
typeof(SSGCRServiceType.description),
SubstituteKey = typeof(SSGCRServiceType.serviceTypeCD))]
public virtual int? UsrServiceTypeID { get; set; }
public abstract class usrServiceTypeID : PX.Data.BQL.BqlInt.Field<usrServiceTypeID> { }
#endregion

 

 

 

icon

Best answer by Naveen Boga 23 June 2022, 03:26

View original

2 replies

Userlevel 7
Badge +17

HI @joe21  You can DescriptionFiled after SubstituteKey like below

 

        #region UsrServiceTypeID
        [PXDBInt]
        [PXUIField(DisplayName = "Service Type", Required = true)]
        [PXDefault(PersistingCheck = PXPersistingCheck.Null)]
        [PXSelector(typeof(Search2<SSGCRServiceType.serviceTypeID,
           InnerJoin<SSGCRServTypeRecTypeXR,
           On<SSGCRServTypeRecTypeXR.serviceTypeID.IsEqual<SSGCRServiceType.serviceTypeID>>>,
           Where<SSGCRServTypeRecTypeXR.recordTypeID.IsEqual<CRCaseExt.usrRecordTypeID.FromCurrent>.
               And<SSGCRServiceType.isActive.IsEqual<True>>.
               And<SSGCRServTypeRecTypeXR.isActive.IsEqual<True>>>>),
            typeof(SSGCRServiceType.serviceTypeCD),
            typeof(SSGCRServiceType.description),
            SubstituteKey = typeof(SSGCRServiceType.serviceTypeCD), DescriptionField = typeof(SSGCRServiceType.description))]
        public virtual int? UsrServiceTypeID { get; set; }
        public abstract class usrServiceTypeID : PX.Data.BQL.BqlInt.Field<usrServiceTypeID> { }
        #endregion

Userlevel 6
Badge +3

Hi @Naveen Boga 

Dude...I SWEAR that I tried that and when I put that line in, the field kept clearing itself out as soon as the row was selected from the selector.

I just put it back in and it works now.  In my initial post above, I mentioned that I had a problem when I tried using that.  

I guess I just needed you to tell me to do it again.

Thanks Naveen.

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