# Extension functions

**URL:** <https://forum.inductiveautomation.com/t/extension-functions/11013>\
**Category:** Ignition\
**Created:** [January 8, 2016, 2:59pm UTC](https://forum.inductiveautomation.com/t/extension-functions/11013 "2016-01-08T14:59:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg.Bogard](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@Greg.Bogard](https://forum.inductiveautomation.com/u/Greg.Bogard)\
**Post date:** [January 8, 2016, 2:59pm UTC](https://forum.inductiveautomation.com/t/extension-functions/11013/1 "2016-01-08T14:59:53Z")

</div>

this is the the code I used with the help of James Hunt of Inductive automation Tech Support to solve my issue.  
if event.propertyName == ‘data’:   
NextProductsTbl = event.source.parent.getComponent(‘pwrTblNextProducts’)  
system.db.refresh(NextProductsTbl, ‘data’)

```
	ActiveProductTbl = event.source.parent.getComponent('pwrTblActiveProduct')
	system.db.refresh(ActiveProductTbl, 'data')

```

Attached is a screen shot as well.

Thanks for the great support!

I am trying to reference another component on a window from the onCellEdited event of a power table. I cannot seem to find the correct syntax as their is no ‘event’ available in the extension function of the power table component. Has anybody been able to do this?

# def refreshpwrTblNextProducts(tableNextProducts = event.source.parent.getComponent(‘cntProductsToPrint’).getComponent(‘pwrTblNextProducts’)):

# 

# pwrTable = event.source.parent.parent.parent.getComponent(‘Root Container’).getComponent(‘cntProductsToPrint’).getComponent(‘pwrTblNextProducts’).data

# 

# def refreshpwrTblNextProducts(tableNextProducts = pwrTable):

# system.db.refresh(tableNextProducts, ‘data’)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 9, 2016, 4:45am UTC](https://forum.inductiveautomation.com/t/extension-functions/11013/2 "2016-01-09T04:45:00Z")

</div>

In an extension function, use ‘self’ wherever you would have used ‘event.source’ in an event script. So event.source.parent.getComponent(…) becomes self.parent.getComponent(…) and so on.

---

<div class="post-metadata">

**Author:** ![Greg.Bogard](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@Greg.Bogard](https://forum.inductiveautomation.com/u/Greg.Bogard)\
**Post date:** [January 12, 2016, 7:49pm UTC](https://forum.inductiveautomation.com/t/extension-functions/11013/3 "2016-01-12T19:49:30Z")

</div>

Phil, Thanks for your help, I will give that a try.  
Greg
