5.1 Use Input Fields for Text

5.1 Use Input Fields for Text

  
What if I don't have data in the Outsystems DB, but I'm using a form to fill-in an XML data structure that I'm later sending to a webservice?
Hi Mark,

Sorry I didn't fully understand your question :( ....

You want to have a form to get data from the user as different fields (like name, email, etc.) and to convert that to an XML structure you want to send to a webservice, is that it?

Well you always need to have the inputs bound to variables. These can be attributes of an entity record or it can be local variables. So you can define a structure with those attributes and define it as the record definition in the EditRecord. Then you will have to build the XML with those values.

I hope this answers your question.
Cheers
Yes, I want to use a form to collect data from the user and then send that data as a XML structure to a web-service. The data structure is complex in the sense that I have more than one object, I have objects for the loan application, borrower, addreses, employers, a lists of declared debts such as housing, cars, boats which are each objects.

I tihnk I hear you saying that I use "entities" which are persistant in the Outsystems platform and just before I want to call the web service I "build" the xml by instantianting a local variable and assigning the attributes to values from the Outsystems entities.

This seems to imply that I have to replicate (and maintain) the XML structure as entities in the Outsystems platform.

Do I follow correctly?
No, you don't need the entities. But you need variables for the inputs. You can either have local variables in your screen for that but since the data is complex this would become unmanageable. So you should probably create a structure with those attributes. Bind the attributes of this structure to the inputs in the edit record and than transform these values into the XML you want.
Andre,
      Thanks, I like the sounds of this, but I don't understand how to do it. My first attempt used a local variable which I wanted to pass to a screen to edit say the list of borrowers, but since its passed by value when I return to the "home screen" that data is lost.

      If I go to the "data" intereface I see the structures generated for me when I set up the Web Reference and specified the WSDL.

     What I don't know how to do is then to use it as you are suggesting.
  • I can create an Edit Record and I can drag the "borrower" structure to it.
  • I see the fields on my page.
  • What do I select for a "source record"?
  •      So that when the user navigates to a new page (to provide some other loan related information) the information they entered for the borrower is still available?
Thanks,
Mark
You need to have an input parameter of that type on the other screen and you need to navigate to that screen passing the record from the Edit Record.

This is starting to sound scary. If this is such a complex form you probably would be better in having either only one screen or doing some persistency of data even if it is temporary. Passing records between screens doesn't seem to be the best approach...

Thanks for helping, yes it's starting to be scary passing data around so perhaps persistency is best. I don't see having one form, even with popups I'd have to pass data to / from the web-blocks so its the same challenge.
I'm a main-framer trying to understand your approach [which I love].

Why must user inputs always be bound to a variable?

In Tutorial 5.1, the search argument entered by the user is bound to a variable, and the the search query references the variable. Why can't the query reference the user input directly?
Hi Phil,

Queries have a local scope only, meaning that everything you need inside the query must be passed via a parameter. On the other hand user inputs need a variable to hold the end-user input. So you need the variable bound to the input and then you need to pass this variable inside the query so that you can use it there.

I hope not to have confused you more...
Thanks for the prompt reply.

I understand the need for the query parameter -- that's being sent to the database server. But, why can't the parameter see the user entry? Is the user entry hidden in some service/class/object/method/???
Hi Phil,

I'm affraid I'd have to say that it is that way by design :( (I really don't know those tiny bit details)
Though this puzzles me...
For me it would make much more sense that the query would have access to the variable that holds the user entry without the need to define an input parameter in the query. Can you develop on this?

Thank you very much for your feedback!
Cheers

In this film at 3:30 minutes I found this difference, I analyzed it and find that it was sufficient to include the quotes to be able to move on. 
Still suggest on new platform upgrade is restored to the previous form, avoiding the need to include the quotes.
Hi Rui,

You are totally right! I've added a callout on the video to explain what changed.
Thank you!
Hi there, I need to know about some specifics in terms of the input. for some reason, when I make a form everytime I go to that form it generates previous inputs and autofills everything with my information no matter on what computer I'm on.
Hi Denis,

Not sure I completely understand your issue. Can you share your module so that I can take a look? You can export the module using Ctrl+S.

Cheers
Hi,
How do i fetch the data based on id in the database.
Please see my two screenshots.
1.The first one is the grid where i have display the information.
2.The second screenshot is if i click any names i have to get a pdf file like which i have added in
my second screenshot.
3.Can anyone show how to write a query to fetch any data.
RIght now i'm getting pdf file only for the updated or last record.
Regards,
ChandrasekarRadhakrishnan
This is my second screenshot.
Chandrasekar Radhakrishnan wrote:
This is my second screenshot.
Hi,

Strange that you have this question so far into the training... I suggest that you go back to 3.3 Create a Detail Screen for a Record and review those concepts.