cherokee
9th November 2010, 21:03
Hello everyone,

I have a session with this code..
before.program:
if background then
import("tdpur041.orno",hold.orno)
import("tdpur041.pono",hold.pono)
import("tdpur041.item",tdpur987.item)
import("tdpur041.suno",tdpur987.suno)
import("tdpur041.oqua",po.qana)
query.extension = "tdpur987._index1 = {:hold.orno,:hold.pono}"
endif

When I zoom from the Purchase Order Lines session to this session, it finds the records in my table tdpur987. But when I zoom from another session where I put on the before.zoom: section read table tdpur041.* for the same order position that is in the Purchase Order Lines Session, it doesn't find any record.

Any ideas?

Thanks in advance,

mark_h
9th November 2010, 21:17
Silly question but in the other program did you declare hold.orno and hold.pono as external? Don't forget to export them also.

cherokee
9th November 2010, 21:29
Mark,

I did not export hold.orno nor hold.pono since those are only used in the called session; however, I did the test(export them) with the same results. when I debugged it, I see the values being assigned to hold.orno and hold.pono properly right before the query.extension.

Thanks again,

cherokee
9th November 2010, 21:39
This is the only difference I found in the memory right before the query extnesion. The one with the zoom.field$ tdsls989.lino is the one that doesn't work.

Thanks

mark_h
9th November 2010, 22:56
Okay - gotcha. I can't remember why, but I stopped using table fields in zooms. I always set zoom.fields and export/import them to the zoom session. Then I execute a find. Just makes it easier for me to track things.

Okay - both sessions call this zoomed to session. This session for tdpur987 loads the hold.orno and hold.pono fields correctly with the import. What is the start option on the session for tdpur987?

Just some questions - Are you zooming the same way in both sessions? On some field in the form you have this session(for tdpur987) in the zoom box? Are they both same type field or different fields and return fields? I don't see why that would matter, but thought I would check.

Kind of grasping at straws since I do not see any initial problem.

cherokee
9th November 2010, 23:06
Hi Mark,

No, the one that works, I am zooming from a Purchase Order Lines/Application and there is a zoom option that display a menu with several sessions. I select the session from there and works fine. The one that doesn't work, I am zooming from a mult-occ session from a field in the rows.

I thought this won't matter but maybe...

I tried this and doesn't work either from a dll scrpt
function test.zoom()
{
select tdpur041.*
from tdpur041
where tdpur041._index1 = {300505,1}
selectdo
zoom.to$("tdpurc111m000", z.session,"","",0)
endselect
}

mark_h
9th November 2010, 23:28
I seem to recall one time I had a problem with a zoom. I had to move the code from the before.program to a zoom.from.all section. At the end of the zoom from all section I put in an execute find. I wish I could remember the problem. Can you try that in the program you are calling as a quick test?

mark_h
9th November 2010, 23:39
This is code I know that works, but I only call it using a zoom.to command

Program doing the calling.

choice.cont.process:
on.choice:
export("item.filter",item.filter)
export("buyer.filter",buyer.filter)
export("suno.filter",suno.filter)
export("quote.filter",quote.filter)
export("date.filter",date.filter)
export("rfq.filter",rfq.filter)
export("bidn.filter",bidn.filter)
if check.for.records() then
message("No records would be selected")
choice.again()
endif

|Zoom to controlling program
zoom.to$("tdexi0160m000",z.session,"tdexi0159m000","",0)


Code on the other end. In my case I had to add a query.extension in case they run it by itself without the filer - this session was a main session, but it works. The start option on this session is 2 for first set. In my case I am going from a single occurence session where the user sets the filters to a multi-occurence sesion. I don't see why that makes a difference.

before.program:
if background then
import("item.filter",item.filter)
import("buyer.filter",buyer.filter)
import("suno.filter",suno.filter)
import("quote.filter",quote.filter)
import("date.filter",date.filter)
import("rfq.filter",rfq.filter)
build.qry.ext()
else
buyer.filter = 0
item.filter = ""
suno.filter = ""
date.filter = 0
rfq.filter = 0
quote.filter = empty
query.extension = "tdexi060.rfqnum > 0 "
|query.extension = ""
endif


function build.qry.ext()
{
query.extension = ""
if rfq.filter <> 0 then
query.extension = "tdexi060.rfqnum = " & str$(rfq.filter)
endif
if not isspace(item.filter) then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.item = " & chr$(34) & item.filter & chr$(34)
endif
if not isspace(suno.filter) then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.suno = " & chr$(34) & suno.filter & chr$(34)
endif
if date.filter > 0 then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.rtndte = " & str$(date.filter)
endif
if etol(quote.filter)>0 then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.quotstat = " & str$(quote.filter)
endif
}

cherokee
10th November 2010, 15:37
Mark,

I just changed the start option of the session from 21 to 2 (First Set) and it worked!

Something to investigate about "Start Options" behavior.

Thanks for your help, really appreciated.

shah_bs
10th November 2010, 20:44
My suggestion, since you happen to have the source code, is to modify as follows:

in the init.form: section, add the following code:


if background
then
ignore.first.event = TRUE | this ignores the start option of the session
execute(find.data)
endif


That way, the session should work irrespective of its Start Option. You may have to add more checks about which session this one was called from to further constrain the right behaviour.

cherokee
10th November 2010, 21:44
Thanks... I'll give a try.