Variable of Input Field Is Blank During Server Action - Using Traditional Web

Hi, 

Looking for some assistance. We have a screen which is "thrown" data values from a third party application into text fields. This part is working fine.

After the page loads we are using javascript to emulate a button click so that a server action can be triggered. During that server action, we want to retrieve the value which is in the text field. I would think this would be just a standard form submit process and the set variable for the input field would be populated, but the text field value is blank, and we do not know why. 

The application is built using a Traditional Web, and the button submit is using Ajax, however we troubleshooted both Ajax/Submit and Server/Client and Server validation, and it was the same result.

Any assistance with this would be greatly appreciated. If anyone needs more information, please let me know.

Thank you

MultipleScreenshots.jpg

Hi @Nuno Ricardo Rodrigues ,

I appreciate the effort. I figured out the issue but had a question on your thoughts for the best way to resolve it.

We have a CRM product called FACS which throws data from FACS to the web application by mapping the data field names in FACS to the web application.

In Outsystems, to get this to work I had to modify the extended properties of the text field and modify the id and name of the element. Well in doing this, in server action Outsystems doesn't know about these id's as Outsystems creates its own element names. This is why the value was blank when I tried retrieving it on server side.

Now to my resolution. I have my original field which I override the text field with the id and name of the element I need. I create another text field without overriding the id and name. In javascript, pass the value I'm capturing in the overridden field and store that value into the default text field. Then on submission Outsystems server action has the stored value.

The issue I have is I have to gather the element id and it seems to change in Outsystems based on where you move the element. To anyone's knowledge, is there a cleaner way to do this or is this the best path?

I appreciate everyone's effort with this.

Hello @Alexander Hunsiker ,

If you can provide an OML as example is always better to help, because other developer need to create an example to try to help you.

Best Regards,

Nuno R

Hi @Nuno Ricardo Rodrigues 

Thank you for your quick response. I've attached the OML.

If you need any other information please let me know.

Thank you

PaymentProcessingTraditional.oml

Hi @Alexander Hunsiker ,

The OML that you send have some dependencies, can you create just one version of this OML, just with the error that you have?

Best Regards,

Nuno R

Hi @Nuno Ricardo Rodrigues ,

Attached is the OAP file. Not really able to take apart into one OML.

The screen which is having the issue is "PaymentWindow_8881" which renders a web block "Payment_8881". 

If you have any other questions please let me know.

PaymentProcessingTraditional.oap

Hello @Alexander Hunsiker ,

I try to understand what is happen, but I cant publish, because of the missing dependencies.

Let see if the other developer can help you with publishing, just looking at the code they can understand what is happen.

Best Regards,

Nuno R

Hi @Nuno Ricardo Rodrigues ,

Sorry, I'm not following. You are unable to open and publish the project file? I would think it would package up the dependencies used. If you can assist, how can I provide the needed dependencies as I'm sure others will have the same issue. Can you let me know which dependencies you are missing? Maybe I can provide those as well so you can add manually?

Hi @Alexander Hunsiker,

I cant publish the project. The missing dependencies are the ones with the garbage icon:

Maybe they are components from the forge, but others are modules from our environment for sure.

I´ m not sure if with all this information I can help you, because somethings I don´  t know, but for sure someone in the foruns will help you.

Best Regards,

Nuno R


Hi @Nuno Ricardo Rodrigues ,

I appreciate the effort. I figured out the issue but had a question on your thoughts for the best way to resolve it.

We have a CRM product called FACS which throws data from FACS to the web application by mapping the data field names in FACS to the web application.

In Outsystems, to get this to work I had to modify the extended properties of the text field and modify the id and name of the element. Well in doing this, in server action Outsystems doesn't know about these id's as Outsystems creates its own element names. This is why the value was blank when I tried retrieving it on server side.

Now to my resolution. I have my original field which I override the text field with the id and name of the element I need. I create another text field without overriding the id and name. In javascript, pass the value I'm capturing in the overridden field and store that value into the default text field. Then on submission Outsystems server action has the stored value.

The issue I have is I have to gather the element id and it seems to change in Outsystems based on where you move the element. To anyone's knowledge, is there a cleaner way to do this or is this the best path?

I appreciate everyone's effort with this.

Hello @Alexander Hunsiker,

I think I understand your issue, let see if I can help.

To each element you can add "Extended Properties", and you can add for example this:

In the Javascript you can call the element like this:

document.querySelector('[data-id="BtnOK"]').click();

Hope it helps your issue.

Best Regards,

Nuno R

Hi @Nuno Ricardo Rodrigues ,

I resolved this issue earlier. I was just asking if there was a better way to obtain the Outsystems, dynamic id from the element. Right now I have to hard code the element id into the javascript. Just wondering if their is something I'm not aware of I could use to resolve this in Outsystems.

Thank you

Hi  @Alexander Hunsiker ,

I dont understand that you find the solution, better then.

In traditional is not possible to get the id on other way.

Best Regards,

Nuno R

Hi @Alexander Hunsiker ,

Not able to replicate the issue.  as mentioned by Nuno, can you attach oml file to investigate?

Hello Alex,

Could you please confirm the name of the screen on which you are getting this error? 

Thanks & Kind Regards,

Sachin



Hi Sachin,

The screen which is having the issue is "PaymentWindow_8881" which renders a web block "Payment_8881". 

If you have any other questions please let me know.

Thank you

Hi Alexander,

For better understanding of your problem, Please share your OML file.

Thanks,

Mita

Hello Mita,

He had already shared the OML in above post. Please go through with all the above post for OML.

Thanks & Kind Regards,

Sachin 

Hi Sachin,

Yes , thanks for reminding me.

Best Regards,

Mita


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