Alpha Anywhere v3.5 Build 2999
Using MySql56
UX component
I'm entering a new record into the 'wo_log' table. I need to increment the work order number, char(6) by 1. The table needs to be filtered by site.
Right now I've been working with code in the Server-side - afterDialogValidate event.
I'm not really sure what I'm doing but the following is some of the code I have been trying. I'm probably barking up the wrong tree but could someone please give me some guidance. I know, the code is pretty ugly.
Thanks
Using MySql56
UX component
I'm entering a new record into the 'wo_log' table. I need to increment the work order number, char(6) by 1. The table needs to be filtered by site.
Right now I've been working with code in the Server-side - afterDialogValidate event.
I'm not really sure what I'm doing but the following is some of the code I have been trying. I'm probably barking up the wrong tree but could someone please give me some guidance. I know, the code is pretty ugly.
Thanks
Code:
function afterDialogValidate as v (e as p) debug(1) e.datasubmitted.site = "BAF" 'upper(e.datasubmitted.site) e.datasubmitted.tail = upper(e.datasubmitted.tail) e.datasubmitted.descript = w_upper(e.datasubmitted.descript) e.datasubmitted.notes = w_upper(e.datasubmitted.notes) e.datasubmitted.intials = "REA" 'upper(e.datasubmitted.intials) cn = "::Name::AF_WOLog" table = "wo_log" filter = "site="+s_quote(e.datasubmitted.site) result_WO = "WO" dim qry as C qry = "SELECT MAX(wo) AS LargestWONumber FROM wo_log where site = 'BAF'" 'session.Site = sql_lookup(cn,table,filter,result_Site) 'e.javascript = "SELECT MAX(wo) AS LargestWONumber FROM wo_log where site = 'BAF';" 'e.dataSubmitted.WO = sql_lookup(cn,"Site="+s_quote(session.site),alltrim(str(val(tablemax("[PathAlias.ADB_Path]\wo_log","Site="+s_quote(session.site),"wo"))+1))) 'e.dataSubmitted.WO = sql_lookup(cn,table,"Site="+s_quote("BAF"),alltrim(str(val(tablemax("[PathAlias.ADB_Path]\wo_log","Site="+s_quote(session.site),"wo"))+1))) 'To edit this action, place insertion point anywhere in the command, then click the 'Action Scripting' button'. ExecuteServerSideAction("Save Data::Save_Submitted_Data_to_WO_LOG_Table")
Comment