cancel
Showing results for 
Search instead for 
Did you mean: 

Validation in Form Data add Event

Former Member
0 Kudos

Dear All,

I am developing an add-on m facing some problems in the Form_Data_ADD Event. I have created a form using screen painter and i have done some validations for few fields those fields are mandatory. after entering some data iam closing the form it will show a messageBox saying do you want to save the changes or not n if i give yes its saving data. but it has to show the error message saying certain fields are mandatory.please suggest some solution regarding how to validation in such a condition.

Regards,

Anand.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Anand,

I do my validations either in the Form Data Add event, when BusinessObjectInfo.BeforeAction = True or in the ItemPressed Item Event, when pVal.BeforeAction = True. In both cases, if I need to stop b1 from adding the record, I set BubbleEvent to False.

I guess that in your case it's not working because you're catching the BusinessObjectInfo.BeforeAction = false or because you're not setting BubbleEvent to False.

Regards,

Vítor Vieira

Former Member
0 Kudos

Dear Vieira,

First of all thanks for ur reply. I am validating in Form_Data_Add event in beforeaction = True And m using bubble event also in this case. but its showing the following message Action stopped by add-on (UI_API -7780) [Message 66000-152] . I want to display the message which m giving. This problems comes when i close the form using close button n when i give Yes to the message its asking its saving the record. is there any other way for doing this.

Regards,

Anand.

Former Member
0 Kudos

Hi Anand,

Yes, catch the ItemPressed event for pVal.ItemUID = "1" and when pVal.BeforeAction = True. Again, set BubbleEvent to False to stop the record from being added.

Regards,

Vítor Vieira