I have a customer form and I have a variable vccustid. I now know how to set the variable and open up my faxform at the custid+1 record. (Thanks to you guys I have made a little progress)
However when I get to that form I have have two problems.
One, how do I MANUALLY remove the query constraints, set the customer index to "custid" so that I can step back one record.
Two, How do I do that via action scripting?
In the manual mode the filter icon doesn't appear to have a "X" on it.
Why doesn't control "I" show me the possible indices?
The code that has been generated is:
'Get 'Value' property of 'Comp_id' in Form 'cust1' .
DIM SHARED vccustid AS c
vccustid = topparent:Comp_id.value
'Inline-Xbasic. Converted from: Refresh data in current form at parent level.
'Refresh data in current form at parent level.
'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
topparent.Commit()
topparent.Resynch()
topparent.Refresh_Layout()
vccustid=increment_value(vccustid)
'Open a Form or Browse layout, displaying all, or selected records in the layout.
query.filter = "(Cust_id = Var->vccustid ) "
query.order = "Cust_id"
'replace variables in the filter with their actual values
query.filter = convert_expression(query.filter,"V")
'Open the layout_type showing just the records that satisfy the filter
DIM Shared varP_faxhead as P
DIM layout_name as c
layout_name = "faxhead"
dim tempP as p
'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it
tempP=obj(":"+object_name_normalize(word(layout_name,1,"@")))
'Test if pointer is valid
if is_object(tempP) then
'Test if pointer refers to a form or browse
if tempP.class() = "form" .or. tempP.class() = "browse" then
'Apply the query to the form or browse as the Base query. (this means that
'the user cannot turn the query off, only add to the query)
tempP.BaseQueryRun(query.filter,query.order)
'then activate the already open window
tempP.activate()
else
'Window is not already open, so open it
varP_faxhead = :Form.viewqueried(layout_name,query.filter, query.order )
end if
else
varP_faxhead = :Form.viewqueried(layout_name,query.filter, query.order )
end if
However when I get to that form I have have two problems.
One, how do I MANUALLY remove the query constraints, set the customer index to "custid" so that I can step back one record.
Two, How do I do that via action scripting?
In the manual mode the filter icon doesn't appear to have a "X" on it.
Why doesn't control "I" show me the possible indices?
The code that has been generated is:
'Get 'Value' property of 'Comp_id' in Form 'cust1' .
DIM SHARED vccustid AS c
vccustid = topparent:Comp_id.value
'Inline-Xbasic. Converted from: Refresh data in current form at parent level.
'Refresh data in current form at parent level.
'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
topparent.Commit()
topparent.Resynch()
topparent.Refresh_Layout()
vccustid=increment_value(vccustid)
'Open a Form or Browse layout, displaying all, or selected records in the layout.
query.filter = "(Cust_id = Var->vccustid ) "
query.order = "Cust_id"
'replace variables in the filter with their actual values
query.filter = convert_expression(query.filter,"V")
'Open the layout_type showing just the records that satisfy the filter
DIM Shared varP_faxhead as P
DIM layout_name as c
layout_name = "faxhead"
dim tempP as p
'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it
tempP=obj(":"+object_name_normalize(word(layout_name,1,"@")))
'Test if pointer is valid
if is_object(tempP) then
'Test if pointer refers to a form or browse
if tempP.class() = "form" .or. tempP.class() = "browse" then
'Apply the query to the form or browse as the Base query. (this means that
'the user cannot turn the query off, only add to the query)
tempP.BaseQueryRun(query.filter,query.order)
'then activate the already open window
tempP.activate()
else
'Window is not already open, so open it
varP_faxhead = :Form.viewqueried(layout_name,query.filter, query.order )
end if
else
varP_faxhead = :Form.viewqueried(layout_name,query.filter, query.order )
end if
Comment