SafeSelect does not ignore following statement

The SafeSelect command does not change the selection if the Select attempt did not find the desired record, but I am not finding that it then ignores the following code.

SafeSelect «RequisitionID» = LReqNumber
«Status» = LPONumber
SelectAll

According to the ‘Handling Empty Selections in Code’ help page, the filling of the Status field with the variable LPONumber should not happen but it is in fact receiving that data.

The old way did work:

SafeSelect «RequisitionID» = LReqNumber
If Info("Empty")
    Message "The SKU was not found"
Else
    «Status» = LPONumber
EndIf

I typically like to use NSNotify instead of the Message command but sometimes NSNotify does not work. This is one of those cases. Why am I required to use Message rather than NSNotify?

You are misreading the documentation. Here’s the exact quote:

The safeselect statement will also cause Panorama to skip any following bulk modification statements if the selection is empty.

Bulk modifications are things like formulafill, propagate, etc. Assignment is not a bulk modification, it is not affected by empty selection. If you want it to be, you have to explicitly code it with info(“empty”).

However, I am very happy that you submitted this question because guess what - in researching this question I just discovered that skipping bulk modification statements after an empty selection does not work in Panorama X, and never has worked. Well, except for removeselected/removeunselected. But formulafill, etc. are NOT skipped after an empty selection. Apparently no one uses this, because it hasn’t been noticed in a decade. Nevertheless, I have just fixed this, and it will work in the next release. So for now, you must explicitly use info(“empty”) after a selection (which I think is probably good practice anyway).

You probably have do not disturb enabled without realizing it. I guarantee you that EVERY time this statement runs Panorama passes the notification to Apple’s API. Whether it actually get’s displayed is up to Apple. With all of the various focus modes, etc., it’s easy for notifications to get waylaid. I believe nowadays the focus mode on your phone can affect notifications on your computer, depending on how you have things configured.