Like the new "Switch" UI Feature! I have a form, and when the user toggles the switch, I need to run a process that opens a pick list. Even if I turn off the "do not use rule during initialization" I get the following in the Log Viewer:

Action PICK FROM SeletPurchaseLines is not allowed during initialisation

Is there a way to do this? Or do I need a plain old boring button???

Thanks
Bruce

Tick the option to save the form when a checkbox is clicked and then setup the Save operation to run your process. So when the switch is turned on/off the form will be saved and the process will run.

Please also make sure you use the latest build - there were a couple of issues fixed recently related to switches.

That wont work. I don't want to run it every time the form changes, but ONLY when the switch is changed to a particular value. (When they change the switch, I want to ask about which shipping method, but if the user goes back and edits the order and then re-saves it, I don't want to ask again. Only when the switch is toggled.

Can that be done?

Thanks
Bruce

I don't want to run it every time the form changes, but ONLY when the switch is changed to a particular value. (When they change the switch, I want to ask about which shipping method, but if the user goes back and edits the order and then re-saves it, I don't want to ask again. Only when the switch is toggled.

Sounds like you need to put some additional logic in the process to account for only showing the pick list in certain cases ... something like BO.SwitchValue WAS CHANGED ...

The problem is, I cant have a PICK FROM run from a rule. I can from a process called by a button press. Extra Logic Tom, will not help with the error "can't call it during initialization"

Bruce

"That wont work. I don't want to run it every time the form changes, but ONLY when the switch is changed to a particular value. (When they change the switch, I want to ask about which shipping method, but if the user goes back and edits the order and then re-saves it, I don't want to ask again. Only when the switch is toggled."

I still don't understand why it won't work. You save the form only when a switch changes it's value (which can be either on or off). The form is saved and the process runs on the server. The process checks which value the switch has been changed to and then asks the user if necessary. The process should use PICK FROM or something like that as Tom suggested.

I don't understand your comment about initialization rules either - what do initialization rules have to do with it? And by the way you can control which rules will be considered initialization rules.

Not sure if this is exactly what you are looking to accomplish, Bruce, but in the attached V7 BSV:

1) Create some regions using "New region" menu option

2) Create customers using "New customer" .. you will see "Region pick" switch

when Region Pick is turned ON, you will be prompted to pick a region

3) Edit customers - when editing, you will also be promoted to pick a region only when Region Pick is turned ON.

Picker_4_3_2016.zip
34.75kB

Not trying to answer for bruce,
it may well work for him, but I think, based on him writing this...
"I don't want to run it every time the form changes, but ONLY when the switch is changed to a particular value. (When they change the switch, I want to ask about which shipping method"

that he'd like it to come up while you're still adding/editing the record, not after its being committed (the Save button).
Thanks for the demo, I learned something from it.

"that he'd like it to come up while you're still adding/editing the record, not after its being committed (the Save button)."

From the user point of view he is not submitting the form - in this case saving the form is just a trick to get the process to run on the server. You might just as well delete the record afterwards if the user does not properly submit the form.

Bruce,

I'm sort of guessing on the flow of your UI and this doesn't directly answer your initial question, but ... have you considered just hiding/showing the picklist as a referenced drop down field on the main form with the switch?

Then it seems:

#1 You'd be able to create a "client-side" only rule that turns on/off Read Protect for that referenced attribute in order to hide/show it. - which is simple to do.
#2 Your user doesn't have another pop-up to deal with. - which is likely a more appealing UX.

If you must use the pop-up picklist, and there isn't a good way to do this OOTB .... you should be able to run the process to display the picklist from an event fired by the switch widget.

JT

The problem is the UI. The pick list shows a bunch of stuff and takes up 1/3 of the screen. I have accomplished this by adding a button, and the button will then toggle the switch. So all is good. (sort of...)

Bruce

9 years later