Some operations can be performed on only one record at a time. However, the user interface typically permits multiple options to be checked before an operation is selected. Therefore, the operations that do not support multiple selections must themselves validate that not more than one record has been selected for processing. This function does that validation.
yfcAllowSingleSelection(chkName)
chkName - Optional. Name of the set of checkbox controls, one of which must be checked before an operation is performed. If the value is not passed or is blanks, it defaults to EntityKey.
true - Zero or one record was selected.
false - More than one record was selected.
Receiving intransit updates can only be done one stop at a time. Therefore, the operation for receiving intransit updates is configured to first call the JavaScript function yfcAllowSingleSelection() and then to invoke the receiveIntransitUpdates() API.
This example performs an action if one, and only one, selection was made for checkboxes that have the name set to the value passed in the sKeyName variable.
function goToOrderLineSchedules(sSearchViewID, sKeyName, bPopup)
{
if(yfcAllowSingleSelection(sKeyName))
{
…
}
}