This blog contains some of the Salesforce facts which I have found quite interesting. Happy learning.
Salesforce Fact #653 | Reset value in combobox
Get link
Facebook
X
Pinterest
Email
Other Apps
Suppose we have a scenario in LWC where we need to reset the value of the combobox on button click. We can achieve this using template.querySelector().
We can also pass custom apex-defined variable from flow to LWC. In this case, we have to define the property type as apex://namespace.Classname and expose the same variable as @api. Attached are the screenshots.
Suppose we have a scenario where we have a single select datatable in LWC. There is a field which is editable but it should be editable only for the selected row, for rest of the rows it would be read-only. We can implement the same with a bit of logic of JS. Attached are the screenshots.
We can find the Nth highest value in screen flow using Get Records with a bit of logic. For example, we want to find the Nth highest NumberOfEmployees value across all the accounts. The idea is to fetch the records and then run a check to iterate over the records as long as the temp variable value is less than N value. The temp variable is initialized to 1. In the assignment we would keep on removing the first record. At the end, we will pick the first record from the collection. Attached are the screenshots. Note: this is just a POC flow and the error handlings, best practices are not covered.
Comments
Post a Comment