Topic
  • 1 reply
  • Latest Post - ‏2018-07-14T08:11:32Z by ahluwaliagagan
RanieriMazili
RanieriMazili
104 Posts

Pinned topic [BPM 8.6] Calling a method declared on Inline Javascript from component onchange event

‏2018-06-20T12:38:24Z |

Hello,

on my coach view I have declared a method called calculateMTA

I need to call this method if one of two fields are changed so I decided to call the method above on onchange event of these fields.

 

But when executing it, the console show calculateMTA isn't a function. I've tried this.calculateMTA(), this.context.calculateMTA, @calculateMTA() and other, but can't figure out the context of Inline Javascript function are declared.

The article below show that it should work using @ before the function name, but it didn't work too.

https://salientprocess.zendesk.com/hc/en-us/articles/206347997-Creating-Custom-Functions-

 

Does anyone knows how to call Inline javascript declared methods directly from events of the components?

 

Thanks

Updated on 2018-06-21T02:06:57Z at 2018-06-21T02:06:57Z by RanieriMazili
  • ahluwaliagagan
    ahluwaliagagan
    1 Post

    Re: [BPM 8.6] Calling a method declared on Inline Javascript from component onchange event

    ‏2018-07-14T08:11:32Z  

    Hi,

     

    You need to use @calculateMTA() and you need to implement this function in the inlineJavascript part as this.calculateMTA = function() { }.

    Please try that and see if it works.