Skip to main content
Question

I can’t convert JavaScript from the Classic UI to Modern UI TypeScript code.

  • March 7, 2026
  • 2 replies
  • 82 views

mos11
Freshman I
Forum|alt.badge.img
<ClientEvents TabChanging="refreshGrid" />
<px:PXJavaScript runat="server" ID="CstJavaScript23" Script="function refreshGrid(){ var custGridTotal = document.getElementById("ctl00_phG_tab_t6_CstFormView8&quot;); if(custGridTotal != null &amp;&amp; custGridTotal != undefined){ custGridTotal.object.refresh(); console.log(&quot;custGridTotal&quot;); } }" IsStartupScript="True" />

I want to convert my JavaScript code to Modern UI TypeScript code. How can I do it? I cannot find any documentation about it. I found @handleEvent in TypeScript, but it does not have TabChanging or many other events that exist in the JavaScript client-side.

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • March 9, 2026

@mos11  what are you trying to do here exactly? 

It seems you refresh the grid on changing tabs, but why do you even need it? 

Seems like that’s something that should not require any custom javascript/typescript.


mos11
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • March 11, 2026

@Dmitrii Naumov In the classic UI, this will be a problem when the screen is opened from a Generic Inquiry or other places. But now in the Modern UI, I need to test it.