Skip to main content

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
cPXDBInt]
PPXUIField(DisplayName = "Service Type", Required = true)]
=PXDefault(PersistingCheck = PXPersistingCheck.Null)]
kPXSelector(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

 

 

 

HI @joe21  You can DescriptionFiled after SubstituteKey like below

 

        #region UsrServiceTypeID
        PXDBInt]
        rPXUIField(DisplayName = "Service Type", Required = true)]
        )PXDefault(PersistingCheck = PXPersistingCheck.Null)]
        NPXSelector(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


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