Hi Eric,
Here's a bit more on this. The image is the temp table I'm populating against in the above example. This is how I add it to Dexterity. Use case is that I have a table of users what are added to Doc Link (which we no longer use BTW, thank you workflow 2.0) which I want to add to a table in GP which then populates a secondary approval matrix.
I create the table, add the table to the form and then use a pass through SQL query in dexterity to query against a table in any database and read the records returned, adding them to the temp table. This table was closed/opened (just to be sure I have a refresh) on the lookup form, passed to the code below which then is used to fill the window. In it I'm reading a view created in the doclink database.
Not a lot of code to make this happen, works for me.
Side note, I took a one week Dexterity class many years ago and it's well worth your time/effort/money as this language is unique. My favorite reference material of all time is on my CD from the 1998 world wide developers conference in Fargo. It was a session (with excellent additional documentation) presented by David Musgrave on how to interact with third party products through Dexterity. David is very humble on these sites but he is a true Dex god. If you get the chance to attend his class you will be well served.
Tim

{NA_Get_DL_Users_PassThru}
inout table NAT_DL_EMail_TEMP;
local long SQL_connection, status;
local text SQL_Statements;
local boolean result;
local currency l_amount;
local string l_pre_bill_recognized;
local 'SOP Type' l_type;
{Query information}
local string l_company;
{SQL error information}
local long GPS_error_number, SQL_error_number;
local string SQL_error_string, ODBC_error_string;
{ use for current company
clear table SY_Company_MSTR;
set 'Company ID' of table SY_Company_MSTR to 'Company ID' of globals;
get table SY_Company_MSTR;
set l_company to 'Intercompany ID' of table SY_Company_MSTR;
}
l_company = "doclink2"; {this is for a directed company}
{Connect to the SQL data source.}
status = SQL_Connect(SQL_connection);
if status = 0 then
{Build SQL statement to use the appropriate database.}
SQL_Statements = "use " + l_company;
{Execute the SQL statements.}
status = SQL_Execute(SQL_connection, SQL_Statements);
SQL_Statements = "select Name, EMailAddr from vwNATGPUsers order by Name";
status = SQL_Execute(SQL_connection, SQL_Statements);
if status = 0 then
status = SQL_FetchNext(SQL_connection);
while status <> 31 do
clear table NAT_DL_EMail_TEMP;
status = SQL_GetData(SQL_connection, 1, 'Name' of table NAT_DL_EMail_TEMP);
status = SQL_GetData(SQL_connection, 2, 'String 132' of table NAT_DL_EMail_TEMP);
save table NAT_DL_EMail_TEMP;
status = SQL_FetchNext(SQL_connection);
end while;
end if;
status = SQL_Execute(SQL_connection, SQL_Statements);
status = SQL_Terminate(SQL_connection);
else
error "An error occurred executing SQL statements.";
{Retrieve the specific error information.}
status = SQL_GetError(SQL_connection, GPS_error_number, SQL_error_number, SQL_error_string, ODBC_error_string);
if status = 0 then
warning "GPS Error: " + str(GPS_error_number);
warning "SQL Error: " + str(SQL_error_number) + " " + SQL_error_string;
warning "ODBC Error: " + ODBC_error_string;
else
error "Unable to retrieve SQL error information.";
end if;
{Disconnect from the SQL data source.}
status = SQL_Terminate(SQL_connection);
end if;