Hi,
There is a requirement to add custom string list field called Usrdiscountcode in SOLine DAC. I have defined the string list like below.
[PXDBString(1000)]
[PXStringList(new string[]
{"A", "B", "C", "D","E","F","G", }, new string[]
{"SPRING",
"HARVEST",
"XPT",
"TESTTIRE",
"SPECIAL",
"REBATE",
"DISCOUNT"
})]
[PXUIField(DisplayName="New Discount Code")]
now I need to set the value (ex: SPRING) to a grid level field of the customized screen. For that, I defined an event in the graph extension like this.
using System;
using PX.Objects;
using PX.Data;
using PX.Objects.SO;
namespace GRIProformaInvoice
{
public class APProformaEntry_Extension : PXGraphExtension<GRIProformaInvoice.APProformaEntry>
{
#region Event Handlers
public PXSelect<SOLine> soview;
protected void APProformaItemList_RowInserted(PXCache cache, PXRowInsertedEventArgs e)
{
var row = (APProformaItemList)e.Row;
foreach (PXResult<SOLine> result1 in soview.Select())
{
SOLine line = result1;
if(line.OrderNbr==row.Ponbr && line.LineNbr==row.POLineNbr){
SOLineExt lines = PXCache<SOLine>.GetExtension<SOLineExt>(line);
row.SODiscountCode = lines.Usrdiscountcoden2;
}
}
}
#endregion
}
}
But this time Iβm getting the key (ex:βAβ) instead of its value of the string list. No idea about whatβs missing in this code. Can someone provide me a solution for this to avoid this issue please?