GUID

A GUID (Globally Unique IDentifier) is a 36-character string such as this: 66d89b0b-eaae-4853-90c3-238d4531bd1a.

This page combines three similar concepts that go together and so are grouped on one page. A GUID is a datatype. A Key is a primary key of a database table, and it is a GUID datatype. A FormKey is used to describe the primary key of a Form record in md_dynamic_form, so a FormKey is a Key, which is a GUID. The FormKey is not just a term, but it is also used programmatically in URL querystrings in some places.

GUID

Globally Unique IDentifier. In .NET, System.Guid. In SQL, data type is uniqueidentifier. (av_key is the User-defined datatype that netFORUM uses). A GUID is a 36-character string such as this: 66d89b0b-eaae-4853-90c3-238d4531bd1a.

Every NetForum database Table has a column that is a Primary Key, and that datatype of that column is always a av_key (which has a basetype of uniqueidentifier).

Just because you have a 36-character string with numbers and letters and dashes does not mean it is a valid GUID. You can test to see if a string is a valid GUID with this method in UtilityFunctions:

if(Avectra.netForum.Common.UtilityFunctions.IsGuid(sztest))
{
// this is a Guid
}

Key

Many areas of netFORUM refer to the Key of a record. You can often get this value by navigating to that record in iWeb and then looking at the URL querystring address. You should see in the querystring Key= followed by a 36-character string of numbers, letters and dashes. This is usually all the way to the right. This is the Key. Many System Options use the Key, for example, the Key of an address type, a Correspondence Template, etc.

This is the URL of an individual:

http://www.SomeNetForumSite.com/iweb/forms/DynamicProfile.aspx?FormKey=B772881D-D704-40F3-92B6-09B13A50FCC9&Key=1ea126b5-8998-427e-b89b-d1f441a3c764

The value of the Key is:

1ea126b5-8998-427e-b89b-d1f441a3c764

If the page is a popup, and you can't see the URL address, the do the following in Internet Explorer:

  1. Edit the particular record whose Key you want to determine.
  2. From the popup page, position your mouse over the form on a blank area of the form (i.e., not over a control or image), and right-mouse-click.
  3. From the menu that appears, choose Properties.
  4. From the properties page, inspect the Address (URL). Click into the Address field and cursor to the part that follows Key=. Select and Copy (Ctrl-C) the 36 characters that follow Key=.
  5. You have just copied the primary key of that record, and you can later Paste (Ctrl-V) its value where you need it.
Copy Key
How to "copy" a Key from a popup page

You can do the same thing with other browsers but the steps are slightly different.

FormKey

A FormKey is the GUID for a NetForum Form. To get the Form Key, navigate to the Form in question and look at the URL Querystring. You should see FormKey= and then a 36-character string of numbers, dashes and letters after it. This is the FormKey. If the form is a popup, then do a right-mouse-click on the form, choose propertiers, and you'll see the URL there.

Working with GUIDs

Please note that the value for a GUID can be case sensitive. In other words, these two values are NOT equal in .NET (which is netFORUM) although they are equal in SQL:

if('931161EF-4834-4511-9D93-EFB6565C9146' == '931161ef-4834-4511-9d93-efb6565c9146')
{
print "equal";
}
else
{
print "not equal";
}
 
/// output:
 
"not equal"

If you are finding that a guid is not working the way you think it should, for example as the default value of a Form Control, then try putting the GUID in lowercase and see if that works. For example, suppose you have a URL built with List SQL pointing to a new eWeb Web Page that has a Wizard. You are trying to default some Form Controls on the Wizard, and they are not defaulting properly. Your URL might be:

[Report] = case when t__reported_ceu IS NOT NULL then '<font color="green">' + convert(varchar, t__reported_ceu) + '</font>' 
when t__available = 0 then '<font color="red">Time Conflict</font>'
else '<a href="DynamicPage.aspx?WebCode=ReportCEWiz&ch1_credited_session_key=' + (convert(char(36), t__ses_key))
+ '&ch1_credited_event_key=' + (convert(char(36), t__evt_key) )
+ '&Action=Add&ch1_ind_cst_key='
+ convert(char(36), {CustomerKey}) + '">Report</a>'

The controls that are not defaulting properly are ch1_credited_session_key and ch1_credited_event_key. The problem could be that they return in UPPER CASE in SQL, but the values in the DropDownList on the form are in lower case. Therefore, if you are trying to figure out why they are not defaulting properly, convert the values in the URL querystring using the SQL LOWER() function as you can see in the revised example below:

[Report] = case when t__reported_ceu IS NOT NULL then '<font color="green">' + convert(varchar, t__reported_ceu) + '</font>' 
when t__available = 0 then '<font color="red">Time Conflict</font>'
else '<a href="DynamicPage.aspx?WebCode=ReportCEWiz&ch1_credited_session_key=' + LOWER(convert(char(36), t__ses_key))
+ '&ch1_credited_event_key=' + LOWER(convert(char(36), t__evt_key) )
+ '&Action=Add&ch1_ind_cst_key='
+ convert(char(36), {CustomerKey}) + '">Report</a>'