# Gateway Script Inheritance

**URL:** <https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502>\
**Category:** Ignition\
**Tags:** ignition81, scripting, vision\
**Created:** [September 3, 2024, 7:33pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502 "2024-09-03T19:33:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 7:33pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/1 "2024-09-03T19:33:31Z")

</div>

I found this [post](https://forum.inductiveautomation.com/t/gateway-events-and-project-inheritance-issues/28045/2?gad_source=1&gclid=CjwKCAjw59q2BhBOEiwAKc0ijb8n1wgsdZz1pC6Pa-6k1d7AT8GxsQVWtAwdzU1uiSqjY-KXWOEQlBoC4A8QAvD_BwE) that is basically asking the question that I want an answer to.

I have a parent project that is inherited by a child project. The Gateway Message scripts exist in the parent project but are not populated to the child project.

Why?

Will deleting the file mentioned in that post cause them to be updated from the parent project?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 3, 2024, 7:35pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/2 "2024-09-03T19:35:51Z")

</div>

Inheritance for this resource doesn't work the way you wish it would.

The scripts are part of a large opaque blob of a resource. You can either:

1. inherit them from the parent, in which case you need no UI because you can't modify or augment them
2. override them entirely

These and the handful of other resources that didn't play well with inheritance are supposed to get overhauled for 8.3 so they work more like you'd expect.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 7:37pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/3 "2024-09-03T19:37:03Z")

</div>

I never overrode these scripts in the child project, so why are the inherited scripts not present?

My message handlers are 1-line, so easy to copy/paste, so easy workaround.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 3, 2024, 7:37pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/4 "2024-09-03T19:37:57Z")

</div>

Even opening the editor to _look_ at the scripts acts as an override, and there's no UI presentation to revert. If you look on the filesystem you'll likely see a resource present in the client project.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 7:38pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/5 "2024-09-03T19:38:19Z")

</div>

So, to revert then?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 3, 2024, 7:42pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/6 "2024-09-03T19:42:53Z")

</div>

Delete the entire resource by deleting the _folder_, as Oscar mentioned in the linked post:  
`data\projects\$projectName\ignition\event-script\`

If you're on a recent enough version, trigger a `system.project.requestScan()` on the gateway afterwards, or wait 5 minutes for the system to automatically scan. Note for future readers: that automatic scan is going away entirely in 8.3; though this entire thing will be a moot point with the refactors Kevin's mentioned already -- there'll be a resource per "singleton" script (i.e. you can inherit _just_ the startup/shutdown/update scripts), and a resource type per currently-multiplexed resource (message handlers, timer scripts, tag change scripts, etc), which will all be inheritable as individually named resources.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 7:44pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/7 "2024-09-03T19:44:13Z")

</div>

So these are the gateway event scripts associated with the project then? If not, what other resources are included?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 3, 2024, 7:50pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/8 "2024-09-03T19:50:27Z")

</div>

Everything here will be deleted if you delete the resource from the child project:

> **[Gateway Event Scripts | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/gateway-event-scripts#gateway-event-scripts-overview)**
>
> Gateway Event Scripts Overview

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 8:09pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/9 "2024-09-03T20:09:35Z")

</div>

My child project does not have an event-script folder in that location, which would tell me that those scripts are not overridden? (8.1.35) My parent project does have the event-script folder

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 3, 2024, 8:12pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/10 "2024-09-03T20:12:02Z")

</div>

Hm. And if you open the child project in the designer, you don't see the parent resources still? That's definitely unusual/unexpected.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 8:13pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/11 "2024-09-03T20:13:49Z")

</div>

parent:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/0/e098ab379ea3b7b662269562c754bdd86159e467.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/5/45d024156cd3343de481b569ab8975c255827926.png)

child:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/a/5ade75ec163d577675f50804ccd34724f740042e.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/b/db262e36d6a95b29a715f74128d58cf638d39b0f.png)

and yes, I've saved and merged changes multiple times much more than 5 minutes ago

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 3, 2024, 8:17pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/12 "2024-09-03T20:17:42Z")

</div>

Weird. May be worth getting in touch with support. Are you able to do a full gateway restart?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 3, 2024, 8:18pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/13 "2024-09-03T20:18:44Z")

</div>

I'll give that a shot. Restarted it not long ago

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 4, 2024, 1:06pm UTC](https://forum.inductiveautomation.com/t/gateway-script-inheritance/95502/14 "2024-09-04T13:06:08Z")

</div>

Still no folder after the restart, but the scripts are there.
