sendRequest() Perspective

Hi! Can I use system.util.sendRequest() in perspective? I’ll explain what I need to do.
I need to delete a register and I want to ask in a Pop up “Do you want to delete the x register?”. If the user select Acept the process continue and delete the register, and if the user select Cancel the process is aborted.
So I have a Project Library Script called CRUDRecipes where I have a procediment called DeleteRecipe. I’m trying to open the pop up using system.util.sendRequest but I receive a log massage saying “The message handler “openPopUpConfirm” could not be found! Check your event script message handlers.”
Now I print some parts of the code what I’m using:

I have my script in the Project Library Script that I’m usin for testing:

Then I created a Message Handler in the Gateway Events Scripts called “OpenPopUpConfirmGTW”

And in the windows where is the button that call the testing procediment I added a message handler too in the root scripts where I use the system.perspective.openPopUp function:

But like I said before when I run it in the session I receive the error “The message handler “openPopUpConfirm” could not be found! Check your event script message handlers.” in the gateway log.

What am I missing? Can you help me please?
Do you have any idea when will be available somthing similar to system.gui.messageBox, system.gui.confirm, system.gui.errorBox for perspective?

Thank you

Sounds like you’ve mixed up what’s possible with system.util.sendRequest() or system.util.sendMessage() versus system.perspective.sendMessage(). Also note that Perspective scripts run in the gateway, so can call your CRUD “recipes” directly.

Be aware that if you do use anything that runs in the gateway outside of a Perspective event, you’ll need to specify scope='S' with system.util.sendMessage() to get back into Perspective scope, and that message can only go to a session message handler in Perspective.

But the send request can receive scope like a parameter? Because it is not spedified in the manual document.

Whit sendMessage can i receive a response?

No, sendRequest does not take a scope argument because it is designed to make a round-trip to the gateway. Both types of sendMessage do not return a response.

But note, from a perspective script, you are already in the gateway, so you do not need to use sendRequest to get a response from the gateway. Call your CRUD project scripts directly from the action script for the “Confirm” button in your popup view.

2 Likes