I tried to create an attribute and then a UDF for a custom field I need to add to the Contact form. I created a custom project, I created the new field (as a string of length 10) and I added it to the Contacts form. By Default, everything works fine. It’s a string field and I am able to enter and save values. However, I want to change it to a combo box so I can restrict the user’s entries. In my custom project, I go to “customize” the attributes and I use the following:
[PXDBString(10)]
[PXStringList(new string[] {"N", "P", "Y"}, new string[] {"No", "Pending", "Yes"})]
[PXUIField(DisplayName="Status")]
It always gives me a TextEdit. Am I missing a line of code?
In the past, I have created the new field as an Integer and used the following code:
[PXDBInt]
[PXIntList(new int[] {1, 2, 3}, new string[] {"No", "Pending", "Yes"})]
[PXUIField(DisplayName="Status")]
This works and I could do this but I’m trying to keep the values as string and not integers.
Best answer by Naveen Boga
View original