Skip to main content
Answer

PXSelector column custom name

  • June 30, 2022
  • 4 replies
  • 193 views

tomwhitfoot
Freshman I

Hello,

I have a SOLine custom field with PXSelector, how can I rename the column Customer Price Class to Price Code inside the selector?

 

 

 

In Sales Price screen (not customized), its name was Price Code.

 

I already tried using ARSalesPrice.priceCode in the code, but it shows empty value.

 

Here’s my code,

 

Best answer by Naveen Boga

Hi @tomwhitfoot  Here is the small piece of code you need add to rename the field.

 

Please find the screenshot and code here.

Source Code:

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
public PXSelect<ARSalesPrice> DummyView;
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXUIField(DisplayName = "NAVEEN Sales Price Rec")]
protected virtual void ARSalesPrice_CustPriceClassID_CacheAttached(PXCache cache)
{
}
}

 

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • June 30, 2022

Hi @tomwhitfoot  Can you please share the DAC field i.e. UsrSalesPriceRec  code instead image?


tomwhitfoot
Freshman I
  • Author
  • Freshman I
  • June 30, 2022

Oh sorry, here it is,

#region UsrSalesPriceRec
public abstract class usrSalesPriceRec : PX.Data.BQL.BqlInt.Field<usrSalesPriceRec> { }
protected int? _UsrSalesPriceRec;
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
[PXDBInt()]
[PXUIField(DisplayName = "Sales Price Record ID")]
[PXSelector(typeof(Search<ARSalesPrice.recordID,
Where2<Where<Current<SOLine.customerID>, Equal<ARSalesPrice.customerID>,
Or<ARSalesPrice.customerID, IsNull>>,
And<Where<Current<SOLine.inventoryID>, Equal<ARSalesPrice.inventoryID>, And<ARSalesPrice.expirationDate, IsNull>>>>>),
new Type[] {
typeof(ARSalesPrice.priceType),
typeof(ARSalesPrice.custPriceClassID),
typeof(ARSalesPrice.salesPrice),
typeof(ARSalesPrice.uOM),
typeof(ARSalesPrice.effectiveDate),
typeof(ARSalesPriceExtension.usrLastPurchaseDate),
typeof(ARSalesPriceExtension.usrLastPurchasePrice)})]
public virtual int? UsrSalesPriceRec
{
get
{
return this._UsrSalesPriceRec;
}
set
{
this._UsrSalesPriceRec = value;
}
}
#endregion

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • June 30, 2022

Hi @tomwhitfoot  Here is the small piece of code you need add to rename the field.

 

Please find the screenshot and code here.

Source Code:

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
public PXSelect<ARSalesPrice> DummyView;
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXUIField(DisplayName = "NAVEEN Sales Price Rec")]
protected virtual void ARSalesPrice_CustPriceClassID_CacheAttached(PXCache cache)
{
}
}

 


tomwhitfoot
Freshman I
  • Author
  • Freshman I
  • June 30, 2022

Thanks @Naveen Boga , it worked.