Question

Validation

Hi Guys,

Please, i need advise on how to go about this scenario

On my Activity edit page, i have two text fields called Result and Status. I also have Account Address detail on the same Activity edit page. the "Account Address Detail" has a checkbox that must be checked before Activity can be save.

 

I need a validation that checks that all Account Address check boxes on the detail are checked and status and result are completed before a user can successfully save activity.  Any advise will be highly appreciated.

 

Thanks

File attachments

Like

1 comments

Hi, Adebola!

You have to overwrite save method in your ActivityPageV2 in Custom package. You should run an ESQ

https://academy.bpmonline.com/documents/technic-sdk/7-10/use-entityschemaquery-implementation-client

to the table where your store addresses, whether it ContactAddress, AccountAddress, LeadAddress or your own custom object, filter it by column, which you use to link this detail with Activity and return any addresses where the value of your field is false(or count of those addresses). An example of the query you need(in SQL):

SELECT Id FROM ContactAddress WHERE ContactID = 'Id of Contact in Activity' AND 'MyCustomBooleanField' = 0

Then, if query returned any addresses, the warning is showed to the user(you can use showInformationDialog for it), otherwise, you just save the record using this.callParent(arguments)

Show all comments