# Trouble Calling The Message Handler

**URL:** <https://forum.inductiveautomation.com/t/trouble-calling-the-message-handler/89361>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [April 24, 2024, 2:11pm UTC](https://forum.inductiveautomation.com/t/trouble-calling-the-message-handler/89361 "2024-04-24T14:11:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh\_S](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@Rakesh\_S](https://forum.inductiveautomation.com/u/Rakesh_S)\
**Post date:** [April 24, 2024, 2:11pm UTC](https://forum.inductiveautomation.com/t/trouble-calling-the-message-handler/89361/1 "2024-04-24T14:11:17Z")

</div>

Description: I’ve encountered an issue with calling a message handler from (main) view Save button action. Here’s the scenario:

1. I have a popup that saves photo details when the user clicks the Save button.
2. In the popup view, I’ve created a message handler that includes an API call.
3. After saving the photo, the popup should close automatically.
4. However, the popup message handler is not being invoked when I call it from the (main) view.

I’ve tried using different scopes for the message handler, but it still doesn’t work. Any insights into why this might be happening?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 24, 2024, 2:17pm UTC](https://forum.inductiveautomation.com/t/trouble-calling-the-message-handler/89361/2 "2024-04-24T14:17:15Z")

</div>

You have some incorrect terminology and that may be affecting how you write your code.

> Calling Message Handler from Main Screen

Perspective doesn't have "screens". It has **views**.

> Inside the popup, I’ve created a message handler that includes an API call.

Message handlers are for sending messages **from one view to another**. There is no point in having the button send a message for a handler on the same view. You can just execute the code in the button onActionPerformed event.

[Edit] The paragraph above is not correct and I'm not sure what I was thinking when I wrote it. Message handlers are for sending messages **from one view or one component to another or multiple others** - even within the same view where they avoid the fragile parent-sibling structure.

If you are doing something different then please explain.
