Question with regards to a combo box

Question with regards to a combo box

  
Hey everyone,
I'm running into a problem with connecting a database to a combo box.
I'm able to compile and publish the site fine without the combo box, and the xls spreadsheet I bind it to pulls information properly, but the minute I try to add a combo box and go through the steps of attaching the entity attribute to the combo box, I keep getting an error.
 
Here is what I'm working on:
-------------------------------
The SQL with variables:
CREATE TABLE [dbo].[ref_ReferralSourceHubs](
      [ReferralSourceID] [int] NOT NULL,
      [IsHub] [bit] NOT NULL,
      [HubReferralSourceID] [int] NULL,
      [ReferralSourceDescription] [varchar](50) NULL,
      [ReferralSourceSortOrder] [smallint] NULL,
CONSTRAINT [PK_ref_ReferralSourceHubs] PRIMARY KEY CLUSTERED
(
      [ReferralSourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
-------------------------------
 
So I created an Entity called "ref_ReferralSourceHubs"
The attributes under it are:
ReferralSourceID <-- should be a combo box
IsHub <-- could be a checkbox
HubReferralSourceID <-- combo box
ReferralSourceDescription <-- Textbox, but it should be disabled (in the sense that it just populates info and the user can't change the text in here)
ReferralSourceSortOrder <-- text box, that reads the input number, but the user can sort it differently if need be.
 
Now I drag the combo box and set these parameters:
Variable: ReferralSource
Source Record List: GetRefReferralSourceHubs.List
Source Entity/Structure: ref_ReferralSourceHubs
Source Attribute: ReferralSourceID
Value 1: 0
Option 1: (All)
 
Here are the errors\warnings I'm getting:
-------------------------------
No Error Handling
 
Errors are not being handled in the 'WebFlow1' web flow. Add error handlers or select a theme with error handling.
Usability Suggestion
 
WebScreen1 has no button or link with 'Method' set to 'Submit'. The user input for this screen will be ignored.
Unused Element
Query Parameter 'ReferralSource' is never used in Query 'GetRefReferralSourceHubs'.
Invalid Combo Box Widget
Source Entity 'ref_ReferralSourceHubs' must have an Identifier in Combo Box widget.
Invalid Combo Box Widget
Source Entity 'ref_ReferralSourceHubs' must have an Identifier in Combo Box widget.
-------------------------------
 
I hope this is enough information for someone to assist me. I'm still learning all functions of this studio. Thanks in advance!
I'm also attaching my project here if it's any help!
Hi James,

I'm on an iPad so I can't open your project... But let me try to understand better what you are doing.
  1. What is the SQL you added to your post? Do you mean you have a table in an existing database and you're trying to integrate it in your application?
  2. The combo box widget can be tricky to use. You say you use a variable ReferralSource, what is it's data type?
  3. I understand you're still learning the platform. How are you doing it? Do you know we have online training fr free? There is actually one lesson dedicated to combo boxes that you can use as a reference but it is probably better to build up your knowledge up to that lesson by watching the previous lessons as well.
  4. You can also check the online help if you haven't already.
I'll try to open your eSpace later so that I can give you more help.

Cheers,
André
Hi Andre,
Thanks for your response.
 
1. Yes, there is an existing database that I will need to connect to, but for the time being I'm just trying to play around with things based on an excel table that was submitted to me as a demo to see if I can populate the fields.
This is how the table looks:

ReferralSourceID IsHub HubReferralSourceID ReferralSourceDescription ReferralSourceSortOrder
2204 1   Lake Forest Hospital 1
2216 1   Northwest Community Hospital 2
2217 1   Northwestern Memorial Hospital 3
2571 0 2217 Imperial Nursing Home 1
2590 0 2216 Lutheran Home -Arlington Heights 1
2670 0 2204 Westmoreland NH 1

In a broader scheme of things, ReferralSourceeID is a value that will be pulled from a database (The information I provided above is just an example)
IsHub - is really a boolean datatype. 1 - Refers to a Hospital and 0 refers to a Nursing Home
HubReferralSourceID, is also pulled from the database and these values tell what hospital is linked to what Nursing home. So you see that 2217 under "HubReferralSourceID" matches 2217 under "ReferralSourceID", so based on this information, "Northwestern Memorial Hospital" is linked to "Imperial Nursing Home" I hope this make sense.
The "ReferralSourceSortOrder", is just the sorting scheme and the user can change the sorting if they desire to.
 
2. The data type is an integer. Same as the "ReferralSourceID" data type.
 
3. I'm doing well, and I have seen that online lesson. I have been watching and following each lesson carefully and going through and doing each training along with the video, but it seems that I get to a part in the video that is different from my espace and that's why I am stuck right now.
 
4. I have looked through the online help as well, but I'll still go through there and use it as a reference for help.
 
Thanks again Andre!
 
One of my dev's have sent me a document with a demo GUI that I will also attach. Thank you.
Hi James,

First of all, let me apologize for the massive reply.
I was looking to the application you have sent, and there are some minor problems that I'll try to guide you on fixing them. I'm glad to see you are watching the instructional videos, and are already trying to develop you application to solve a real-world problem.
 
First lets review the basics: as you watched the videos at the academy, I'm sure you noticed that the OutSystems Platform has a strongly typed language. Not only integers and booleans have their own data type, but emails, phone numbers and surprisingly foreign keys have their own type.
This might be strange at first, but after you get used to it you won't want to get back :)
 
So, start a new application and import the excel file. Right-click in the entities folder and choose 'Import Entities From Excel'. (Review this video if you need so see how it's done).
 
Now we need to work a bit the data model, to ensure we have a solid data model for our app. Start by renaming the entity to something meaningfull like 'NursingFacility'.
 
In your example application I see that after importing the excel, you deleted the 'Id' attribute. While this is common in other platforms, in OutSystems we advise you to keep the Id, afterall you don't need to manage it because it's an auto number.
 
You can then leave the ReferralSourceId attribute with Integer data type, just in case you want to export an excel, or implement some other functionality to integrate with your old system.
 
But then, change the HubReferralSourceID to reference the entity itself: change the HubReferralSourceID data type to 'NursingFacility Identifier'.
 
Now your data model is ok, but you'll have one error: the logic to import the excel file has an error because we are trying to assign an Integer into a NursingFacility Identifier.
If you haven't yet, see this video. If you have seen it, see it again :) since it shows a simmilar problem to yours, and how to solve it.
 
So let's fix this.
Right after the ForEach, create a new query, you will be searching for NursingFacility containing a specific ReferralSourceId.
 
Now you can go to the assign, and fix the error. Instead of using the value from the excel, chose the ID of the record returned by the new query.
Let's recap: when creating a new nursing home, we will search for the related hospital and associate it.
If we are creating a new hospital, the query will return an empty list, and a null identifier will be assign to the HubReferalSourceId.
 
We are finished with the logic to import the excel. Let me just make it clear that this logic will only work as long as your excel is sorted by ReferralSourceId (such as the one you posted).
If the excel is not sorted, you will end up with nursing homes, without an associated hospital, so you will have to improve your logic to deal with this.
 
Now let's go to the interface!
If you have seen the videos, you know in OutSystems application there are usually 2 or 3 screens around the same entity: one to list, another to show a single record, and another to add a new record. This is the CRUD pattern.
 
The List screen
Drag the entity to the canvas to create a new screen. This video at 8:44 shows you how to do it.
 
Shazam! Now you have a screen to list the NursingFacilities.
Drag the entity again, and baaaaam! You now have a show screen.
Drag one last time and powwwww! An edit screen :)
 
You now have some cleaning up to do:
-Display some fields that are missing, and links to navigate between screens;
-Make the list screen sorted in the correct way, by changing the query in the preparation;
-Change the labels, so that instead of 'IsHub' there is 'Is Hospital', instead of 'Hub Referral Source' there is 'Associated Hospital'...
-To implement the delete action, in the show screen drag a button to the interface, right-click and chose 'Link to new Delete Action', or see this video
 
And for the cherry on top of the cake...have you noticed that your list screen has already a search functionality, as your colleague was asking for ? If you want to learn how it works, check out another video.
Sorry for the delayed response. That is so extremly helpful! No need to apologize for the for the massive reply. 
I'm currently on the trial version of outsystems Studio, so the project you provided I don't think can be converted to my espace "localhost". I'll go ahead and try to get all the done on my own and see what happens.

Thanks again for your time and help!

Hi,

No James, the problem is not with your trial version, but with the file I've sent you.
Try this one instead.
This is what I was getting while publishing it to see how it looks:
Intellectual Property Error
 
You are trying to Upload or Publish an eSpace whose Intellectual Property is Protected, since it was created in a different Agile Platform Infrastructure than ''localhost''. To obtain the Intellectual Property Rights for using this eSpace in ''localhost'' Infrastructure, please go to OutSystems' Intellectual Property Services at 'http://www.outsystems.com/ipp'.

When I go to Service Management my activation shows all "0's". The serial number is in there, but that won't work when I go to "http://www.outsystems.com/ipp/"
I can't convert the OML file to my espace because it doesn't look like I can do that according to my license.
Hi James, what platform version are you using? I recently installed the community editon for the new version 8, and I do have an activation code and serial number:



Could you show us what it looks like at your side?
The problem is that the file I've sent you was protected with IPP, so it couldn't be published into any other server other than mine.

I've removed the IPP from the 2nd file I've sent to you. Have you tried it?
As I only have only one machine running OutSystems Platform, I cannot fully test if the IPP has really been removed or not :)

To know more about IPP, you can go to http://www.outsystems.com/ipp/
Hi Joao, I think James already got that, given that he says "but that won't work when I go to http://www.outsystems.com/ipp/". He's saying that he doesn't have a proper activation code, hence my question to provide a screen dump or the like.
Hi, thank you for the responses. Here is an image of my outsystems management. I hope it helps.
Also, yes Joao, I have tried the 2nd version as well and still get the IPP message I posted above. 
Thanks. Test this one and see if it works :)
Thank you so much! That worked!