19
Views
4
Comments
[Timer Map] Inline Javascript
timermap-png
Web icon
Forge asset by TimerMap++

In AI Mentor Studio, it keeps on telling me I have a performance issue:


The issue comes from the expression in block cal_heatmap_Day, where the JS code is typed inside there.


May I ask, how can I solve the issue by moving the JS code from expression to block-level (ie to cal_heatmap_Day --> Advanced --> JavaScript)? As the JS script contains inputs to the block, it seems that I can't directly copy the whole expression JS script into the block-level one.


Thanks

2022-12-30 07-28-09
Navneet Garg

Are you using traditional app or reactive app ? you can check following documentation .

https://success.outsystems.com/documentation/11/monitoring_and_troubleshooting_apps/manage_technical_debt/code_analysis_patterns/


UserImage.jpg
Kwan Yat MOK

Thanks for replying. I am using traditioanl app,and I understand that I have to define JS at screen/web/block level instead of inline expressions, but may I ask how can I pass the screen input parameters into the JS functions?


Thanks

2025-01-23 09-22-22
ABHIJITH G
Champion

Hi @Kwan Yat MOK,
As the Inline JavaScript will create the technical debt in Traditional web applications, you can define JavaScript at the screen/web block level instead of in inline expressions.  

The below link may help you to understand how to add JavaScript to screen or block in the Traditional Web Applications.

https://success.outsystems.com/documentation/11/integration_with_external_systems/javascript/extend_your_traditional_web_app_using_javascript/
Thanks.

UserImage.jpg
Kwan Yat MOK

Thanks for replying. 

I understand that I have to define JS at screen/web/block level instead of inline expressions, but how can I pass the screen input parameters into the JS functions?

For example, I have this in the inline expression, where the DayDate is the input parameter:

Then how can I pass the DayDate parameter if I write it on the block level JavaScript, ie here?


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.