As i said on the other thread, _.user is not customizable. (As far as i'm aware).
You need to create a report object that brings back the information you want.
You will then call your report object within your form's script with ca_reportQuery.
In my exemple, i have a report object with the following query :
SELECT CNT.last_name, CNT.first_name, CNT.email_address, USPCNT.z_title AS position, CNT.userid,
FROM mdb.dbo.ca_contact AS CNT
INNER JOIN mdb.dbo.usp_contact AS USPCNT
ON USPCNT.contact_uuid = CNT.contact_uuid
where CNT.userid = '%userid%'
On my form, when the lookup that brings back the userid of a selected user is completed, i call getData()
getData: function()
{
var userid = ca_fdGetTextFieldValue(ca_fd.formId,'yourTextBoxWithTheUserID');
ca_reportQuery('yourReportObject', {'userid':userid}, function(rows) { ca_fd.js.writeEmployeeInfo(rows);}, null);
},
getData will execute the report object with the query i pasted. On success, ca_reportQuery will call an anonymous function (and pass the results set from the query as a parameters), wich will then call a function defined in your script. (writeEmployeeInfo)
writeEmployeeInfo : function(rows)
{
if (rows.length>0)
{
ca_fdSetTextFieldValue(ca_fd.formId,'txt_info_userid',rows[0]['userid']);
ca_fdSetTextFieldValue(ca_fd.formId,'txt_info_title',rows[0]['position']);
ca_fdSetTextFieldValue(ca_fd.formId,'txt_info_email',rows[0]['email_address']);
ca_fdSetTextFieldValue(ca_fd.formId,'txt_info_first_name',rows[0]['first_name']);
ca_fdSetTextFieldValue(ca_fd.formId,'txt_info_last_name',rows[0]['last_name']);
}
},
WriteEmployeeInfo receives the results set as a parameter. Technically, there is only one user with a specific userid so this is why i do not use a loop to read the results set.
The results set, defined as "rows " in my exemple, is an "array" with named indexes. The name of the indexes are the exact same as the column name in your query. Except that the case of your column name will not be kept.
Hope this helps.