Hi All,
I figured this query.filter, see Code, and work fine within test.
I want to have combine it with the "Operation" code which copied from Action Scripts. I had an Query.filter Error at "Operation" Query.filter line.
The Operation Code
Neither one of "Operation's Query.filter" keep get the Error Message. Does anyone know what is wrong on the Query.filter ?
I figured this query.filter, see Code, and work fine within test.
I want to have combine it with the "Operation" code which copied from Action Scripts. I had an Query.filter Error at "Operation" Query.filter line.
Code:
dim vProjId as c ="11-0014" dim tSum as p dim qry as p dim rcd as n tSum = table.open("Quote_summary") query.order="" 'query.filter="left(alltrim(Last_esthd_id),7)= "+quote(vProjID) 'Not work, Cannot find the records 'query.filter="left(alltrim(Quote_summary->Last_esthd_id),7)="+quote(vProjID) 'Not work 'query.filter= left(Last_Esthd_id,len(+quote(vProjId))) = +quote(vProjId) 'Not work 'query.filter= left(tsum.Last_Esthd_id,len(Var->vProjId)) = Var->vProjId 'It works [COLOR="#B22222"]query.filter= left(Quote_summary->Last_Esthd_id,len(Var->vProjId)) = Var->vProjId 'It works[/COLOR] 'query.filter= left(tSum.Last_Esthd_id,len(quote(vProjId))) = quote(vProjId) 'It works qry = tSum.query_create() rcd = qry.records_get() if rcd>0 then vMsg1 = "There are matching records." vMsg2 = "Do you want to reinstate again?" ui_msg_box("Notice",vMsg1+crlf()+vMsg2 ,UI_STOP_SYMBOL+UI_YES_NO) else ui_msg_box("Else","What now") end if qry.drop() tSum.close()
Code:
'Run a saved 'Summarize' operation: 'Summary_Estimate'. [COLOR="#FF0000"]'query.filter = "left(Esthd_id,len(Var->gProjectId)) = Var->gProjectId" 'It does not work 'Created by ActionScripts query.filter = left(Est_items->Esthd_id,len(Var->vProjId)) = Var->vProjId[/COLOR] query.order = "recno()" 'replace variables in the filter with their actual values [COLOR="#FF0000"]query.filter = convert_expression(query.filter,"V")[/COLOR] [COLOR="#0000FF"]<--- Error Message[/COLOR] DIM operation_name as c operation_name = "Summary_Estimate" If operation_name <> "" then [COLOR="#FF0000"]summarize.run_silent(operation_name,query.filter)[/COLOR] [COLOR="#0000FF"]<--- Error Message[/COLOR] End if
Comment