Eg: I am trying to create a “Customer” related field in “Invoices” screen.
I am trying to create a custom “Related” field and it doesn’t work for some reason, so need your input.
I created a new Customization Project, and in the Data Access section for Invoice, I created a new field:
Lets say the Field name is “Shipping Customer”. I added the following as part of field attributes:
[CustomerActive(Visibility = PXUIVisibility.SelectorVisible, DescriptionField = typeof(Customer.acctName),Filterable=true, TabOrder=2)]
Once the field is created, I added it to the Invoice Screen, and it appears fine (woohoo!).
But when I save the Invoice, the field value is not getting saved into the DB. Any clues why?
Thanks for your help!
Best answer by ray20
Can I take a whole look at your DAC? And your screen field.
You have to make the type match.
Like, Customer is stored in DB in Int, so the selector should use BAccountID in the typeof
Below is an example of add a “warehouse” field on user.
[PXSelector(typeof(INSite.siteID),SubstituteKey = typeof(INSite.siteCD),DescriptionField = typeof(INSite.descr))]