485
Views
7
Comments
[HTTPRequestHandler Runjavascript]How to create javascript code
Question

Hello everyone.

Now I use RunJavaScript Server Action but I don't know how to create javascript code and how can I check the result.

I tried below and run my app in browser but there is no alert in my browser.

If someone know the solution please help me.

possible please sample oml file share me.

Thanks alot.

UserImage.jpg
Nishant Pareek

May Zin Linn wrote:

Hello everyone.

Now I use RunJavaScript Server Action but I don't know how to create javascript code and how can I check the result.

I tried below and run my app in browser but there is no alert in my browser.

If someone know the solution please help me.

possible please sample oml file share me.

Thanks alot.


Hello May Zin Linn,

Can you please explain exactly what you want to achieve with the javascript code.


Thanks,

Nishant Pareek

UserImage.jpg
May Zin Linn

Thanks everyone reply for me.

Actually the thing I want to do is Combobox onChange event .

I hope you will understand when you see my oml.

I expect the result is the child Combobox value is changed base on the parent Combobox selected.


explanations of my app {I create an app which create data,edit data,delete data from salesforce through outsystems UI.so I use salesforce connector API from forge to connect salesforce and outsystems.The problem is in my outsystems there is no entity becasuse I retrive data from salesforce so I cannot create query for cascating combobox.So I decided to use javascript to solve this problem.}

I so sorry for japanese language.

Thanks .


SalesforceconnectorTest.oml
UserImage.jpg
Nishant Pareek

May Zin Linn wrote:

Thanks everyone reply for me.

Actually the thing I want to do is Combobox onChange event .

I hope you will understand when you see my oml.

I expect the result is the child Combobox value is changed base on the parent Combobox selected.


explanations of my app {I create an app which create data,edit data,delete data from salesforce through outsystems UI.so I use salesforce connector API from forge to connect salesforce and outsystems.The problem is in my outsystems there is no entity becasuse I retrive data from salesforce so I cannot create query for cascating combobox.So I decided to use javascript to solve this problem.}

I so sorry for japanese language.

Thanks .



Try this - on the OnChange action of your parent combo box put an assignment in which assign your selected combo box value then send this as a request to your API from which you will be getting the results of child combo box. Now assign the response from API to a local variable and set this local variable as the source record of your child combo box.

Hope this will work for you.


Thanks,

Nishant Pareek 

2022-03-01 15-42-44
Thiago Mari
Champion

May Zin Linn wrote:

Thanks everyone reply for me.

Actually the thing I want to do is Combobox onChange event .

I hope you will understand when you see my oml.

I expect the result is the child Combobox value is changed base on the parent Combobox selected.


explanations of my app {I create an app which create data,edit data,delete data from salesforce through outsystems UI.so I use salesforce connector API from forge to connect salesforce and outsystems.The problem is in my outsystems there is no entity becasuse I retrive data from salesforce so I cannot create query for cascating combobox.So I decided to use javascript to solve this problem.}

I so sorry for japanese language.

Thanks .


Hello,

So, you have 2 combo box, the second depends the selection of first, right? If yes, you can add a input parameter in the first OnChange Action and refresh - using AjaxRefresh - the second combo box.


Hope to help.


Cheers


2021-01-12 14-29-49
Prajakta Roshankhede

May Zin Linn wrote:

Hello everyone.

Now I use RunJavaScript Server Action but I don't know how to create javascript code and how can I check the result.

I tried below and run my app in browser but there is no alert in my browser.

If someone know the solution please help me.

possible please sample oml file share me.

Thanks alot.

You can define your functions at screen level in advanced tab and then call in you screen/server action. you can refer below attached images for the same.

Thanks & Regards

Prajakta Roshankhede

UserImage.jpg
Maitha Khanji

thanks for this discussion it is helpful. How can i achieve the same but with dynamic Input parameter (variable based on dynamic data). For example in my case below textToSpeak is the variable. 

the function Say works perfectly. But now i need to make it work with input variable.

EncodeJavaScript("Say("+textToSpeak+");")
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.