Hi,
I am facing a situation where blank beans are saving into database , I want bean only save when all required field like last name etc field in bean.
is this possible via code?
e.g. if last name is blank , then do not save this lead record, obviously need to stop from code.
Interesting question. I don’t know of any way to do this, perhaps you will have to cycle over all the field_defs (the vardefs loaded into an array - if they are available at the point of the code where you’re working) and check each required field individually.
Have a look at this auxiliary function and how it’s used here. It seems to be doing something similar to what you need…
I don’t think you can use that code directly, but maybe you can work it over to achieve your goal.