Robin J Giltner
|
|
Group: Forum Members
Posts: 105,
Visits: 650
|
I have a table with a child table which are linked to by a foreign key field in the parent, to the primary key field in the child table. While testing this on a test DB, using the ForeignKey ComboBox it worked perfectly, using integer type fields.Now trying to use this same approach on my production data using GUID type PK's and FK's, the Function ConvertValue in the ObjectConverter is throwing an error, saying that "The input value could not be converted to the output type." I looked through this code, and there doesn't seem to be an If statement for a GUID type. Is this something that is just impossible at this time, or not doable all together, or am I just going about this the wrong way?
Thanks, Robin Giltner
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
For some reason, it looks like the Guid type was omitted from the ConvertValue of the object converter. If you are compiling your source code, then you can add the following code to the bottom of the the convert method, right before the last End If. If you aren't compiling the source code, the change will be included in the next build. ElseIf OutputType Is GetType(Guid) Then '-- We need to parse the input value If InputType Is GetType(String) Then Return New Guid(CType(InputValue, String)) End If
|
|
|
Robin J Giltner
|
|
Group: Forum Members
Posts: 105,
Visits: 650
|
Awesome, thanks Ben. I have pretty much done that to get it to work, but getting the official nod always makes me feel better when I'm chaning StrataFrame Source. Thanks, Robin Giltner
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Not a problem... you are most certainly correct... I included all of the basic value types in the ConvertValue method, but for some reason, I just left the Guid type off. Sorry for the trouble.
|
|
|
Robin J Giltner
|
|
Group: Forum Members
Posts: 105,
Visits: 650
|
Well that fixed the If/IfElse in the ConvertValue function, but I seem to have another problem with this, it keeps bombing trying to Convert the string value "-1" to type Guid. The ex.Message says "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)." I'm guessing the -1 is for the "Not Used" value in the combo box. So it is dieing trying to convert the string "-1" to a GUID type ? Thanks, Robin Giltner
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Yes, the -1 is for the "Not Used". However, you should be able to specify something other than -1 for the top most value. Something like 00000000-0000-0000-0000-000000000000 should parse back into a guid. Or you could add another If test to the ConvertValue method so that it returns New Guid("00000000-0000-0000-0000-000000000000") if the InputValue equals "-1". Either way should work for you.
|
|
|
Robin J Giltner
|
|
Group: Forum Members
Posts: 105,
Visits: 650
|
Hey Ben. I added the code into the ObjectConverter to check for a "-1" then return an empty GUID, else return the good from the InputValue. I also had to end up in the BrowseDialogWindow class, adding support for a GUID in the HasData function, and adding the GUID type to the BuildWhereElement Function. My form seems to be working now best I can tell. Can you think of any other places that I haven't gotten to yet that are going to throw a wrench into this?
Thanks, Robin Giltner
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Not that I can think of off the top of my head. Would you mind emailing me a complete list of the changes you had to make so that we can implement them for future versions... so you don't have to make the same changes the next time we release a new source code version...
|
|
|
Robin J Giltner
|
|
Group: Forum Members
Posts: 105,
Visits: 650
|
Absolutely. They will be to you shortly. The only other change I found I had to tinker with, was the "Clear" button on the browsedialog. The Strataframe source had set the SelectedValue to -1, to I just changed that to SelectedIndex = 0. Pressing the Clear fields would clear out the value of the combobox and would return no results unless I changed it to "<Not Used>" Thanks. Robin Giltner
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Thanks for the list, Robin  Say hi to the rest of the guys for me.
|
|
|