Salesforce Fact #581 | LWC datatable validation on row selection

Suppose we have a scenario where we have a lightning datatable in lwc with couple of columns. Now, if the user selects any record where any of the column value is not present, an error message needs to be shown.

We can implement this with some JS logic.

In this example, the datatable shows contact fields and if any of the Phone or Email is empty of the selected records, it shows an error message.

Attached are the screenshots.




Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow