A combobox question

A combobox question

  
Thanks for reading this.

I have a page created to add a new record.
One of the entities attributes used here is "Employee" which is a text type field.
Standard, Outsystems comes with a nice data entry box where you can type in an employee name.
I don't want that.

What I want is to display a combobox displaying all users from the usertable (system) and have the user select a value from there.

So, I dragged a combobox onto the canvas and stumbled over a variable problem almost immediately, that blocks my ways to its best efforts :-)

TrueChange says: "Invalid Data Type: 'User Identifier' data type required instead of 'Text'.

That's strange to me. I can't seem to change the type of the variable? The variable is: PlanningEdit.Record.Planning.Medewerker it's the variable that is filled in standard in the normal text box properties. It does seem to work for a normal text box expecting text, but the combobox does not want that.
It seems to be looking for an "identifier type". Well, at this point I have no clue how to achieve that.

I have looked at the videos from the Academy section, but those did not enhance my understanding about this specific error much. And I don't understand why it wants an identifier type either. Since what is going into this combo box is a list of names. Usernames. So those are text type. I can choose the souce entity (User) and the source attribute (Username). So why ask for an identifier type if the contents will be of the text type?

To me, this is a riddle. Who can provide me with the solution? Thank you in advance for your efforts!
Hi Marcel,

That EditRecord has a source right, an Entity or a Structure named Planning, you must change the attribute of that entity or structure.

Other way in case you can´t change the attributes it's having a local variable of the type you want and then make the assign to your attribute.

Hope that helps, 
Not to whine about details, but when one is evaluating an other platform it always immediately gets clear that "the new platform" is not perfect either. Of course, "perfect" does not exist. The "new platform" will have things "better" than the old platform, and obviously chances are, that it also has things "less optimal" than the old platform.

Looking at the combobox it seems to me that for an "agile" platform the user has to do an aweful lot to get this to work properly. For instance. If you have a combobox populated with usernames where the user selects a username, one could have the wish the system also populated a few other fields on that choice. Like when the user selects "John" as a user, the system automatically fills fields "role" and "group" with values associated with the choosen user. Why can't this be done automatically based on a few property settings?

In the platform I have been working with until now, these things only took a few clicks. In the properties list was a property group "other fields to fill" and you just clicked a field to fill in the target table with a field to get the data from in the source table, linked by the user selected choice's ID. A few clicks and this worked flawlessly.

In OutSystems, on has to do a lot of work to get the combobox to work on itself, like connecting code behind variables to it (why should the user even do that, the system can do that automatically without bothering the developer?) and what not. In order to get OTHER attributes to be filled one has to do even an awful lot MORE propably in a screen action connected to the combobox's onchange destination. I have not yet found a way to do this, but as I see it, that will probably include a few queries and assign commands in the screen action?

Now, what is "agile" about have to do so much work in order to achieve just so little?

Or, what am I missing here? 
It's normal have some issues when changing platforms.

So a Combobox in Outsystems normally need two values, an identifier and a description. The description is what you see, the identifier it's what you really have when the user select, so the variable that you assign to the combo must be the same type of the identifier. Simple!

Sometimes and for several different reasons, bad design of the DB entities or impossability to create real FK theres a need to make the workaround that i mention above.
You are right Nuno. Indeed, every change will bring postives and, unfortunately, some less positive effects. 
In general, OS is a real charm to work with.
One would have wished though, that things like multi-field population from a combobox would have been integrated a bit easier. Well, one has got to have something on the wishlist, is it not?
Any sugestion/wish can be made here
Marcel,

I agree with you. When one is trying new technologies you find out that things in the new way work differently than the old way, and sometimes the new way does not even do some stuff that the old one did.
And yes, this is very frustrating, specially for situations where old way worked almost without you having to think or took for granted, and in the new way you have to think a lot to accomplish the same.

For what I understood you watched almost all videos in the Academy, and even reviewed the one about combo boxes, but let me step back just to ensure that nothing is missing.

Every input is associated with a variable. Most of times you don't notice this because the platform automatically associates the inputs in the Edit Record implicit variable.
Another important thing are the data types. The data collected from the user is saved on a variable with a certain data type, so when you manipulate the user input you need to consider the data type of the variable you are dealing with.

Again, most of the time you don't realized about this, because you are using the Edit Record implicit variable. But for example if you are editing a record that contains a boolean attribute, the platform automatically creates a checkbox, or if the variable is an entity identifier, the platform creates a combo box.

Ok I get that, but how do combos work?
Again, every input needs to be associated with a variable. And just as a checkbox needs to be associated with a boolean variable, combo boxes need to be associated with an entity identifier variable.
I know this sounds confusing, specially for combos, but if you think about it, it just makes sense.
When I add a checkbox to my screen, I could save the users' choice in a text variable, but then I would need to do messy casts to transform the text variable into a boolean variable. So the platform ensures you don't have to do this.

The same for combos. When I add a combo to my screen, I am giving users the choice to choose an item in a list. Again the paltform could let you save the user choice into a text variable, but then you would need all kinds of nasty casts to find out the user choice. So the platform does not let you do this.

So when you are giving the option to choose a user from a list of users, the platform makes you bind the combo to a variable with the user identifier data type. If you were giving the option to choose a car from a list of cars, then the variable must be of car identifier data type, and so on.

Too Long, Didn't Read
You are trying to bind your combo to a variable with type text. You need to bind it to a variable of type User Identifier (because you are presenting a Users list).
You have 2 options:
  1. Change the Entity definition so that its attribute is a User Identifier
  2. Create a screen variable with User Identifier data type, and in your screen logic use an assign to ensure it is filled-in with the correct value before updating the database.
Sorry for making you read all this.

No, nothing to be sorry about! Instead, thank you for creating such an informative post and spending the time to educate a new user! I am grateful you did.

I got it working, but after carefully reading your post, it also got clear WHY it worked in the end :-)

Another thing I am "used to", is to have extensive documentation including several coding examples on almost every aspect of methods and commands in my previous platform. Understanding of how things work should not need to be a result of endless trial-and-error, or asking fellow developers on the message board. I have the feeling that OS is missing such extensive documentation. However, on the other hand, the old platform clearly showed that it was almost impossible to keep up with changing features in the product and so in the end, what was in the documentation was by all means not at sync with the reality anymore. And there you have it. Product documentation nowadays is a considerable issue. The time of extensive documentation seems to be gone. It does not "fit" into the world of hyper-changing software, since you may need twice as many personell for documenting as you would need for development and no product could carry that costs nowadays. It's a vulnerable balance between costs and how to educate the user. Especially new ones.
Hi Marcel,

I don't know if you tried the Service Studio Help/Documentation (F1). Its well integrated with the widgets used... For example, if you select the combo box widget and the press F1, Service Studio opens a help page for that widget. Maybe not as complete as you described about the other platform, but I think that OutSystems guys did a good job in providing and maintaining this information.

Well, just my 2 cents... Hope that it helped...

Cheers.
It does: I wasn't aware of that function! Thank you!
I think the last time I got REALLY "extensive documentation" for a product is when I bought Delphi 1 when I was a college student... came with thousands of pages of manuals!

Marcel, to answer your question, it sounds like what you want are some on-screen If Widgets, each one holding a different combo box, and the If based on if the previous value in the sequence had been selected.

I agree, every platform has differences! I have used Perl/CGI, PHP, JavaEE, ASP, ASP.NET Web Forms, and OutSystems... and I have taken very extensive looks at Ruby on Rails, ERB, Django, ASP.NET MVC, Alpha5, and Sinatra. Every single one is different, though some have many common pieces. It would be pretty simple to slide from ASP to PHP to ERB for example, outside of the language itself. But a jump from ASP.NET Web Forms to ASP.NET MVC is *huge* even if you are sticking with C# all of the way through.

J.Ja