Skip to main content
Question

Selector is not working in landed cost code screen

  • April 7, 2026
  • 3 replies
  • 36 views

Forum|alt.badge.img+2

I added a custom field to store the internal company in both the Item Classes and Landed Cost Code screens, using the same approach in both cases. I also added a selector to choose the company.

In the Item Class screen, the selector works as expected and displays the available company list. However, in the Landed Cost Code screen, the selector is empty and does not show any values, even when logged in with the same user.
Following is the code

    public class LandedCostCodeAccessRestExtP : PXCacheExtension<PX.Objects.PO.LandedCostCode>
{
#region UsrInternalCompanyID
[PXDBInt]
[PXUIField(DisplayName = "Company ID")]
[PXSelector(typeof(OrganizationBAccount.organizationID),
typeof(OrganizationBAccount.acctCD),
typeof(OrganizationBAccount.acctName),
SubstituteKey = typeof(OrganizationBAccount.acctName),
DescriptionField = typeof(OrganizationBAccount.acctName))]
public virtual int? UsrInternalCompanyID { get; set; }
public abstract class usrInternalCompanyID : PX.Data.BQL.BqlInt.Field<usrInternalCompanyID> { }
#endregion
}


Item class

Landed cost code
 

 

3 replies

Forum|alt.badge.img

Hi ​@PDharmasena10, Wrap your code inside search<> , Modified your substitute key to acctCD and try with this,

public class LandedCostCodeAccessRestExtP : PXCacheExtension<PX.Objects.PO.LandedCostCode>

{

#region UsrInternalCompanyID

[PXDBInt]

[PXUIField(DisplayName = "Company ID")]

[PXSelector(

typeof(Search<OrganizationBAccount.organizationID>),

typeof(OrganizationBAccount.acctCD),

typeof(OrganizationBAccount.acctName),

SubstituteKey = typeof(OrganizationBAccount.acctCD),

DescriptionField = typeof(OrganizationBAccount.acctName)

)]

public virtual int? UsrInternalCompanyID { get; set; }

public abstract class usrInternalCompanyID : PX.Data.BQL.BqlInt.Field<usrInternalCompanyID> { }

#endregion

}


Forum|alt.badge.img+3

Hello ​@PDharmasena10 You can try this snippet :
 

    [PXDBInt]
[PXUIField(DisplayName = "Company ID")]
[PXSelector(typeof(Search<Organization.organizationID>),
typeof(Organization.organizationCD),
typeof(Organization.organizationName),
SubstituteKey = typeof(Organization.organizationCD),
DescriptionField = typeof(Organization.organizationName))]
public virtual int? UsrInternalCompanyID { get; set; }
public abstract class usrInternalCompanyID : PX.Data.BQL.BqlInt.Field<usrInternalCompanyID> { }

 


Forum|alt.badge.img+2
  • Jr Varsity III
  • April 10, 2026

@PDharmasena10 you can try this.No dependency on BAccount access joins. Hope will work.
[PXDBInt]
[PXUIField(DisplayName = "Company ID")]
[PXSelector(typeof(Search<Organization.organizationID>),
    typeof(Organization.organizationCD),
    typeof(Organization.organizationName),
    SubstituteKey = typeof(Organization.organizationCD),
    DescriptionField = typeof(Organization.organizationName))]
public virtual int? UsrInternalCompanyID { get; set; }