Skip to main content

I created a UDF called UsrFTEV as a Decimal (2,2) column. (see screenshot below)
What I want to do is make this a Combo Box selection so that a user can only select the values either “1” or “.5”
For calculation reasons no other value should be allowed in that column.  However, I cannot figure out how to do that with a Decimal defined number.  I have done this very easily with Int and String values, but what should I do in the DAC definition?
iPXDBDecimal]
mPXUIField(DisplayName="FTEv")]

For Int column field this would be something like below
ePXIntList(new ints] {0,1}, new stringn] {“0”,”1”})]

For a decimal number what is that command for a list?  And how can I change “NumberEdit” to “Combobox”? When I select “ComboBox” from the screen form data fields and Save, it reverts back to “NumberEdit”

 

 

 

BTW, I did try using this and it did not quite work for me.  Would not let me enter a 1.0

 

pPXDBDecimal]
/PXDecimalList( new stringn] {"0.5","1.00"}, new stringn] {"0.5","1.00"})]
/PXUIField(DisplayName="FTEv")]

 


Hi @NetAdmin42 ,

Could you please try below code snippet?

 #region Usrtest1
PXDBString(4)]
PXUIField(DisplayName="test1")]
PXStringList(new stringg] {"1.00", "0.5"}, new stringg] {"1.00", "0.5"})]

public virtual string Usrtest1 { get; set; }
public abstract class usrtest1 : PX.Data.BQL.BqlString.Field<usrtest1> { }
#endregion

I have replaced datatype Decimal to String and added PXStringList attribute. It will converts cotrol type to ComboBox.

Above code will allow you to select the values which are declared in PXStringList attribute.

Hope, it helps!

Regards,

Sagar, Greytrix


Reply