I am encountering an obstacle withing Salesforce Lightning and I bet there's a solution out there.
When running a snippet that has to select items from a drop-down menu, if the mouse cursor happens to be positioned in the space where a drop-down is revealed, then no matter what selection is found by the snippet code, if the mouse cursor is touching another item in the list, then most of the time, its the item touched by the mouse cursor that ends up being selected.
I have tried coding the snippet to paste the exact text of the item I wish to select from the drop-down list.
I have tried coding the snippet to type the characters of the item I wish to select from the drop-down list.
I have tried using the {key:downarrow} code however many times it has to key down the list to get to the item I wish to select.
This really depends on how the Salesforce dropdown is implemented. Could you post a screenshot and instructions on how to get to it in the SFDC UI (as they often have multiple versions of a widget in use at the same time in different sections of the app) and I'll take a look.
@Kevin_Roberts@Cedric_Debono_Blaze Hello gentlemen! Apologies for the delay in my replying. I have tinkered with this quite a bit and have landed on a solution that, so far, has a 100% success rate. The solution is, to not use the simulated arrow keys to navigate a dropdown list. Rather, use the simulated letter keys to spell out the selection you want from the dropdown list. It takes a little testing to figure out exactly what letter keys need to be simulated in order for the drop down list item to be highlighted. You want to figure out what the absolute minimum keys need to be typed to get the desired result. This helps save time in the snippet run. Here's an example:
We have a drop down list in Salesforce Lightning that the snippet needs to select "Student Liaisons" from the Case Team field, and "Course Withdrawal" from the Case Type field. Therefore, the snippet is programmed to do the following:
I used to have the snippet type the "c" key, then the down arrow key 8 times to get to Course Withdrawal. This worked until a new item was added to the dropdown list that started with a "c"; this made Course Withdrawal no longer the 9th item beginning with "c" in the list. So, to get around this issue, code the snippet to type out what you want from the list, including the spacebar key if needed. I'm attaching a short video clip on the above snippet running.
Awesome! Thank you so much. I did a quick test and it seemed to be working exactly as you said it would. Looking forward to getting this up and running.
That's great news, @Kevin_Roberts! A piece of advice; you may need to play with the delay timing to find the sweet-spot for your Salesforce environment. Specifically the delays involved in jumping from field to field...especially if you are jumping to a field, or through it to another, and that field you are jumping to/through is a dropdown list as well. Otherwise, should be pretty smooth sailing!
@Kevin_Roberts, quick tip: you can set a variable for all of your delays. That way, once you've found a delay that works, you can set it in the variable and use it in all the wait commands in that snippet
{note: trim=right}{dly=0.5}
{endnote: trim=right}
text 1
{wait: delay={=dly}s}
text 2
{wait: delay={=dly}s}
text 3
{wait: delay={=dly}s}
text 4
{wait: delay={=dly}s}
Great tip @Cedric_Debono_Blaze! Speaking for myself, the only reason I have not employed variables related to wait delays is because Salesforce Lightning can be a little temperamental at times with how long it takes for fields to process what the user (or Text Blaze) has commanded the field to do. I find myself needing to change the delays by 10ths of a second at what seems like random intervals of the delay commands within snippets. I base those tiny changes on feedback I get in real-time from users on my teams. However, maybe it's time I revisit the use of variable with time delays. Definitely will take it for a spin!