Trying to get the data into the right fields
Posted: Sat Jun 29, 2013 3:28 pm
Hi Guys,I need some help again please.
I'v got the following code below which seems to be working in getting the information. The line where I put tTheData["customer"] into field "customer_name" seems to be failing. Its not putting anything into the field. If I change that line to put tTheData into field "customer_name" - then it puts the entire retrieved data into that field which is what Im expecting.
I'd like to just put the returned data into the correct fields, so customer should go in the customer_name field, customerID should go into the customer_id field etc.
Many thanks as always
Jalz
command CustomerForm pCustomerID
local tTheSQLQuery, tTheData
if (gConnID > 0) then
put "SELECT customerID,customer,address1 FROM customer WHERE customerID=" && pCustomerID into tTheSQLQuery
put revDataFromQuery(tab, cr, gConnID, tTheSQLQuery) into tTheData
if tTheData begins with "revdberr," then
delete item 1 of tTheData
else
answer tTheData
put tTheData["customer"] into field "customer_name"
end if
end if
end CustomerForm
I'v got the following code below which seems to be working in getting the information. The line where I put tTheData["customer"] into field "customer_name" seems to be failing. Its not putting anything into the field. If I change that line to put tTheData into field "customer_name" - then it puts the entire retrieved data into that field which is what Im expecting.
I'd like to just put the returned data into the correct fields, so customer should go in the customer_name field, customerID should go into the customer_id field etc.
Many thanks as always
Jalz
command CustomerForm pCustomerID
local tTheSQLQuery, tTheData
if (gConnID > 0) then
put "SELECT customerID,customer,address1 FROM customer WHERE customerID=" && pCustomerID into tTheSQLQuery
put revDataFromQuery(tab, cr, gConnID, tTheSQLQuery) into tTheData
if tTheData begins with "revdberr," then
delete item 1 of tTheData
else
answer tTheData
put tTheData["customer"] into field "customer_name"
end if
end if
end CustomerForm