Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 5th January 2012, 13:42
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Zoom from filter
Baan: ERP LN 6.1 FP7
C/S: Client

Hi, I have a session which is been zoomed from another session from a field.
I need whenever the session is zoomed it should show only a particular record.

I am using following script on, it is not giving any error but not showing selected record, in debug I could found the variables are having correct value, please suggest...

----
zoom.from.all:
on.entry:
get.var(parent, "whinh220.orno", morno)
get.var(parent, "whinh220.pono", mlin)

query.extend.where.in.zoom("whalp212.ordn = " & quoted.string(morno) & " and whalp212.line = " & quoted.string(mlin))
Reply With Quote
  #2  
Old 5th January 2012, 14:16
JaapJD's Avatar
JaapJD JaapJD is offline
Guru
 
Join Date: Sep 2002
Location: Netherlands
Posts: 788
JaapJD will become famous soon enoughJaapJD will become famous soon enough
Baan: BaanIV, BaanERP, ERP LN 6.1 - DB: Oracle, SQL Server - OS: Unix, Windows
The query.extend.where.in.zoom function should be used in the calling session. If you want to code it in the called session, you should use query.extend.where.
Reply With Quote
  #3  
Old 5th January 2012, 16:40
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Not working

Hi Jaap

Tried as suggested but it is still not opening the corrected record.
Reply With Quote
Sponsored Links
  #4  
Old 5th January 2012, 16:45
JaapJD's Avatar
JaapJD JaapJD is offline
Guru
 
Join Date: Sep 2002
Location: Netherlands
Posts: 788
JaapJD will become famous soon enoughJaapJD will become famous soon enough
Baan: BaanIV, BaanERP, ERP LN 6.1 - DB: Oracle, SQL Server - OS: Unix, Windows
If you changed the called session to use query.extend.where, you need also to call the rebuild.query() function. And maybe you need also the execute(find.data).
Reply With Quote
  #5  
Old 5th January 2012, 17:01
ipineda's Avatar
ipineda ipineda is offline
Member
 
Join Date: Aug 2008
Posts: 38
ipineda is on a distinguished road
Baan: BaaN V, LN - DB: Oracle - OS: Unix, Windows
Hi friend,

First thing you have to use query.extend.where.in.zoom() in the selection.filter sub-section of the field you are working. Another important thing is that the field whinh220.pono is numeric and you are using quoted.string(), that is not right.

Good luck.
Reply With Quote
  #6  
Old 5th January 2012, 20:12
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Hi,

Thanks for the posts friends.

Jaap, Achually I am making a change in the form, I have changed a normal input field to a input zoom field which if zoomed opens the session where user has to enter some input in a field for a selected record as per parent session.
I do not have the script of main session.
The sub session is a customized session so I can write a script on it.
As suggested I will try for rebuild.query.

Ipineda, As I explained above I can not write anything on the main form field as do not have script of the same. I have also tried it without quoted string but still not working.

Thanks
Virendra
Reply With Quote
  #7  
Old 6th January 2012, 08:03
dhruv_x0's Avatar
dhruv_x0 dhruv_x0 is offline
Member
 
Join Date: Oct 2010
Location: New Delhi
Posts: 81
dhruv_x0 is on a distinguished road
Baan: baan 4,erp ln6 FP2 - DB: MS SQL - OS: Windows XP,Windows 2000
Thumbs up

Hi,

You can also try Query.extension = "Expression " in before .program section of the cutomized session.


When this customized session is opened, import order and position in variables in before.program section and then you can use query.extension.

For ex.

before.program:
import("whinh220.orno",var.orno)
import("whinh220.pono",var.pono)

query.extension = "customized table._index1 inrange {:var.orno,:var.pono}"
or

query.extension = "customized table.orno = :var.orno and customized table.pono = :var.pono"

Might Help.


Regards Dhruv
Reply With Quote
  #8  
Old 6th January 2012, 09:37
v_kewl v_kewl is offline
Member
 
Join Date: Dec 2008
Posts: 58
v_kewl is on a distinguished road
Baan: LN 6.1 - DB: MS SQL - OS: Windows 2003
I feels following code posted by you is wrong:
query.extend.where.in.zoom("whalp212.ordn = " & quoted.string(morno) & " and whalp212.line = " & quoted.string(mlin))

Instead of quaoted.string for a long value "mlin" use str$(mlin). i.e.,
query.extend.where.in.zoom("whalp212.ordn = " & quoted.string(morno) & " and whalp212.line = " & str$(mlin))

Also if require use rebuild.query() after writingthe above code.

Regards,
Gaurav
Reply With Quote
  #9  
Old 6th January 2012, 09:40
v_kewl v_kewl is offline
Member
 
Join Date: Dec 2008
Posts: 58
v_kewl is on a distinguished road
Baan: LN 6.1 - DB: MS SQL - OS: Windows 2003
And also if require try after this rebuild.query()
Reply With Quote
  #10  
Old 6th January 2012, 17:33
ipineda's Avatar
ipineda ipineda is offline
Member
 
Join Date: Aug 2008
Posts: 38
ipineda is on a distinguished road
Baan: BaaN V, LN - DB: Oracle - OS: Unix, Windows
In that case, try the rebuild.query() I'm sure that will help, and post your solution so other can get help too.

Bye.
Reply With Quote
  #11  
Old 21st January 2012, 13:01
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Unhappy Back again

Hi friends...

Sorry for not responding on the posts, was away on another task.

Started working again on it, unfortunately I am still stuck on it.

Here is the outcome.

I changed the query to as suggested:

before.program:
get.var(parent, "whinh220.orno", morno)
get.var(parent, "whinh220.pono", mlin)
get.var(parent, "whinh220.oorg", motyp)

query.extension = "whalp212.ordn = morno and whalp212.line = mlin"
rebuild.query()
------
it gives error.

Following is windows error log which shows SQL syntax not correct, we can see values are passed fine now but the syntax seems to be wrong.

BdbErrno : 302 (SQL syntax not correct)
ExtraInfo : session: "whalp2112m001";object: "whalp2112m001"; function: "sql.parse.stp" sql.parse; company number: 450
query: "SELECT whalp212.* FROM whalp212 WHERE {whalp212.otyp,whalp212.ordn,whalp212.line} = {:whalp212.otyp,:whalp212.ordn,:whalp212.line} AND (whalp212.ordn = 100000044 and whalp212.line = 10) ORDER BY whalp212._index1 "
Message : FATAL ERROR: Error 302 (SQL syntax not correct) on sql statement

Any suggestions...

Thanks
Virender
Reply With Quote
  #12  
Old 29th January 2012, 14:51
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Thumbs up Its done...



Finally its done, here is the final code.

before.program:

get.var(parent, "whinh200.oorg", motyp)
get.var(parent, "whinh200.orno", morno)

form.all:
before.form:
query.extend.select("whalp212.* ")
query.extend.from("whalp212")

query.extend.where("whalp212.otyp = " & str$(etol(motyp)) & " and whalp212.ordn = " & quoted.string(morno))

rebuild.query()
execute(find.data)

Thanks all for all your valuable comments.

Virender
Reply With Quote
  #13  
Old 29th January 2012, 14:53
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Closing the thread...
Reply With Quote
  #14  
Old 30th January 2012, 14:35
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,109
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
No reason to close it or lock. Someone else might have a question on this topic and continue this thread.

Thanks
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #15  
Old 1st February 2012, 07:09
Virender's Avatar
Virender Virender is offline
Member
 
Join Date: Jun 2009
Posts: 34
Virender is on a distinguished road
Baan: Baan IV, ERP LN 6.1 FP7 - DB: Oracle, SQL Server - OS: Windows 2008
Smile

Quote:
Originally Posted by mark_h View Post
No reason to close it or lock. Someone else might have a question on this topic and continue this thread.

Thanks
You are right Mark, sure.

Thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter Before Zoom bumbaermail Tools Development 2 26th September 2008 09:47
How to use a filter in zoom ? jeffersyuan Tools Development 10 14th April 2006 14:18
Problems with ttstpqbf (filter) en@frrom Tools Development 1 19th April 2005 11:56
Zoom and return vallue ICT Builder Tools Administration & Installation 0 4th May 2004 17:15
zoom to different session trchandra Tools Development 2 19th March 2002 03:58


All times are GMT +2. The time now is 15:58.


©2001-2018 - Baanboard.com - Baanforums.com