Baanboard.com

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

Retirement Notice

Baanboard is shutting down on 31-dec-2023. See: http://www.baanboard.com/baanboard/showthread.php?t=76043


User login

Frontpage Sponsor

Main

Poll
What do you expect from your SI Implementation partner for the success of ERP implementation.
Bring best practices - Not to offer more CR's Leveraging standard functions
20%
Need more honesty to work with the Users until their processes are fully mapped & Users are trained
40%
Focus on process automation/ integrations/ Real time data/ BI analytics
13%
Stick to basics
27%
Total votes: 15

Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 9th October 2003, 22:08
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Zoom to Menu and return fields

Need some help on zooming to a menu for a field on a form. I have a field (inventory location) that the users want to zoom to either of two session(maintain locations by item or display inventory by item/lot/warehouse/location). In both cases they want to select a record and drop back and fill in the location. I know I can set the zoom option on the field to a menu, but the two sessions return different table fields. I tried using the after.zoom and setting my table field to the one the user selected. That did not work - I figure because the return field was not set since it was zoom to a menu.

The way I figure I could do it was in the before.zoom section of the field activate the menu with my code, let user select the session, then return to my code and set the attr.zoomsession and attr.returnfield. The problem I have is how to activate the menu. When I do activate("mtdapi000010011") the menu comes up, but in the ascii mode. So how do I activate the menu and see which session they selected? Maybe there is another way to do this, but I have not figured it out yet. I checked the tools libraries, but did not find anything. I also read about ttstpmenu but have not figured out how to call it and return the session selected. Any suggestions are welcome.

Mark
Reply With Quote
  #2  
Old 9th October 2003, 22:28
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,149
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
Mark,

You can also use the tools function - zoom.to$()

Posting your code would help to debug. After you zoom and select a session code etc, you actually would have to get back the ttadv361.* fields to get the menu fields.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #3  
Old 9th October 2003, 22:42
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
zoom.to

NPR,

I know I can use zoom.to to zoom to a session or to a menu. The problem is that I need to do the zoom.to the menu and just to select the session. Not select and activate the session. There really is no code yet - I did not save everything I have tried.

Code:
field.in.location:
before.zoom:
| Set fields needed for find in tdltc0130m000		
 		tdilc007.item = tdpur045.item
 		tdilc007.cwar = tdpur045.cwar
 		tdilc007.loca = in.location
| Set fields needed for find in tdilc1514s000		
 		tdilc101.cwar = tdpur045.cwar
 		tdilc101.item = tdpur045.item
 		tdilc101.loca = in.location
 		select	tiitm001.stgu
 		from	tiitm001
 		where	tiitm001._index1 = {:tdpur045.item}
 		selectdo
 		endselect
 		tdilc101.stun = tiitm001.stgu
after.zoom:
| What code goes here to get the selected field from
| the session selected.  None of the Below works.
after.zoom:
	if strip$(ttgfd202.prog) = "tdilc1514s000" then
		|import("tdilc101.loca",tdilc101.loca)
		in.location = tdilc101.loca
	else
		in.location = tdilc007.loca
	endif
	display("in.location")

You can see I tried export/import. Is there any thing on calling ottstpzoomlist? I am trying to figure out how to use it. I have noticed that it starts when you set the zoom option on the field to menu.

Mark
Reply With Quote
  #4  
Old 9th October 2003, 23:32
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Modifying the Baan Sessions

Also I know I can modify the Baan sessions using Q-key to export a variable called zoom.loca. I was hoping there was a way to do something like this:

Code:
field.in.location:
before.zoom:
| Note on this field the zoom.type would be session and
| calling ottstpzoomlist would return the selection
| from the menu.
   zoomsessionname = activate("ottstpzoomlist","mtdapi000010011")
   if zoomsessionname = "tdilc0130m000" then
      attr.zoomsession$="tdilc0130m000"
      attr.zoomreturn$ ="tdilc007.loca"
   else
      attr.zoomsession$="tdilc1514s000"
      attr.zoomreturn$ ="tdilc101.loca"
   endif
after.zoom:
   if zoomsessionname = "tdilc0130m000" then
      in.location = tdilc007.loca
   else
      in.location = tdilc101.loca
   endif

Just wondering if someone knows how to activate a menu like this.

Mark
Reply With Quote
  #5  
Old 10th October 2003, 12:11
Hitesh Shah's Avatar
Hitesh Shah Hitesh Shah is offline
Guru
 
Join Date: Nov 2001
Location: Mumbai,India
Posts: 1,876
Hitesh Shah is on a distinguished road
Baan: ERP Ln - DB: MSSQL - OS: Windos
try this

Mark

How about this .

1. Edit the menu u zoom to in maintain menus . Fill in the procesinfo (e.g session code of zoom entry) for each menu entry.
2. On the form field, zoom to the menu u wish.
3. In the code in the after.zoom, check the predefined variable procesinfo$ . This will tell u the menu entry (ie session ) u selected. Based on the menu entry u selected, assign ur form field the appropriate value.
4. In order that code works correctly , declare the main tables of zoom session as extern in your session .
5. reset the procesinfo$ to "".
__________________
Hitesh R Shah
Reply With Quote
  #6  
Old 10th October 2003, 15:56
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Return values

Hitesh,

The return values for the sessions are table fields. So I am not sure what you mean by declare them as extern. The tables are already defined in the declaration session, is there another way to declare tables? I will try the processinfo as soon as my users quit testing the session and see what that does for me.


Mark
Reply With Quote
  #7  
Old 10th October 2003, 16:44
Hitesh Shah's Avatar
Hitesh Shah Hitesh Shah is offline
Guru
 
Join Date: Nov 2001
Location: Mumbai,India
Posts: 1,876
Hitesh Shah is on a distinguished road
Baan: ERP Ln - DB: MSSQL - OS: Windos
return values

I mean u declare the tables like this.

extern table ttdilc101
extern table ttdilc007

I have never faced such a scenario and I could not test this due to other pressing issues on hand .

Further u can check exit.val$ pre-defined variable. Finally if u see the help for zoom.to it return string . It's worth checking this return value.
__________________
Hitesh R Shah
Reply With Quote
  #8  
Old 10th October 2003, 18:50
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Learned something new

Well I never new you could do extern table, but it did compile. The bad news is that it did not work for returning the values(still the pre-zoom values). I put a couple of message statements in the after.zoom section. Both were empty. I expect because I zoom to the menu. Sigh.

Mark
Reply With Quote
  #9  
Old 11th October 2003, 10:39
Hitesh Shah's Avatar
Hitesh Shah Hitesh Shah is offline
Guru
 
Join Date: Nov 2001
Location: Mumbai,India
Posts: 1,876
Hitesh Shah is on a distinguished road
Baan: ERP Ln - DB: MSSQL - OS: Windos
use handle.listbox

Why not use handle.listbox function with an array of size 2 (for each menu description) ? Probably u do not want that route.

But it will work for sure. Use it in before.zoom function and set the attr.zoomsession$ and attr.zoomreturn$ .based on the return value of handle.listbox and there u have the zoom values.
__________________
Hitesh R Shah
Reply With Quote
  #10  
Old 11th October 2003, 19:20
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Never Thought of it...

Never really thought about using a list box. Not a bad idea. I might just try that later on, just to see what it looks like. Busy with a 4c4 upgrade in test this weekend.

Mark
Reply With Quote
  #11  
Old 3rd November 2003, 20:26
toolswizard toolswizard is offline
Senior Member
 
Join Date: Aug 2001
Location: USA
Posts: 292
toolswizard is on a distinguished road
Baan: 4c4, 50b, 50c, ERP ln - DB: Informix, Oracle, Sql - OS: Unix, NT, AIX
ottstpzoomlist working but is there more

Mark,

I have been able to get ottstpzoomlist to work in Baan IVc. I added a extension (shadow) table to an existing session. It also had text, so I needed a way to invoke the text editor and make it look like the standard program. I have attached the code for your review. There are 13 blank paramters that I guess are used for other things like a scrollable list, or window placement. I have not experimented with them, but the code does work the way it is and should work for you. Let me know if you have any questions.

Code:
|******************************************************************************
|* zncomdllextend  0  VRC B40o c4 nvd1
|* Extended Standard Program Utilities
|* Bill Prokurat
|* 10-29-03 [10:35]
|******************************************************************************
|* Script Type: Library
|******************************************************************************

	#include <bic_text>
	#include <bic_interface>
	#include <bic_tt>


function extern domain tcmcs.int zncomdllextend.selection.menu(
			ref domain tcmcs.str132m 	header.text,
			    long			lcol,
			    long			lrow,
			ref domain tcmcs.str132m 	enames(), 
			    long 			counter,
			ref domain tcmcs.str132m 	rvalue)
{
| 	DLLUSAGE
| 	Expl:  	This function will build a selection menu on your form
| 		The title of the menu will be the header.text and the 
| 		choice options are stored in enames(array)
| 	Pre:	NA.
| 	Post:
| 	Input:	- header text 	-> The title of the menu
| 		- lcol		-> X-position of the menu
| 		- ycol		-> Y-position of the menu
| 		- enames	-> array of enumdescriptions by example 
| 				   (20, 100)
| 		- counter	-> Number of enumsvalues (arraydepth)
| 		- rvalue	-> Return of selected enumdescription
| 	Output:	-
| 	Return:	- The function returns the kind of error containing the 
| 		  following values: 
| 		  0 No selection
| 		  >0 = Arraynumber of selected enumvalue
| 	EndDllUsage

	domain	tcmcs.int	retval
	long			object.window
	extern	long    	g.exit.menu

	retval = 0
	rvalue = ""
	if counter > 0 then
		if counter = 1 then
			retval = 1 
			g.exit.menu = 1
		else
			enames(1,counter+1) = header.text
			object.window = current.window()
|Start Baan IV format
|The 13 arguments set to 0 are place holders.  At the time of this writing
|their function is unknown, but thought to be controls for the listbox for
|window size, scroll bar, etc.
			wait.and.activate("ottstpzoomlist", 
					counter, 
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					"0",
					enames)

|End Baan IV format

|Start Baan V format
| 			wait.and.activate("ottstpzoomlist", 
| 					counter, 
| 					str$(lcol), 
| 					str$(lrow),
| 					object.window, 
| 					enames)
|End Baan V format
			retval = g.exit.menu
		endif
		if retval then
			rvalue = strip$(enames(1,g.exit.menu))
		endif
	endif
	return(retval)
}

function extern domain tcmcs.int 
			zncomdllextend.choice.text(string table_name(9),
						   ref string rvalue())
{

			long		retval
			long 		no_keys
			long 		no_columns
			long 		int_length
			long 		real_length

			long 		column_number
			string 		column_name(18)
			string 		domain_name(14)
			long 		offset
			long 		size
			long 		dept
			long 		type
			long 		flag
			string 		default_val(3072)

			long		counter
		domain	tcmcs.str132m	linked_list(1024)
		domain	tcmcs.str132m	header.text
			string 		textfield(18,1024)

	retval = rdi.table(table_name, no_keys, no_columns, int_length,
				real_length )

	rvalue = ""
	if not(retval) then

		counter = 0
		for column_number = 1 to no_columns
			retval = rdi.table.column( table_name, 
						   column_number,
						   column_name,
						   domain_name,
						   offset, 
						   size,
						   dept,
						   type,
						   flag,
						   default_val)
			if type = DB.TEXT THEN
				counter = counter + 1
				textfield(1,counter) = column_name
				tt.field.desc( column_name, 
					       linked_list(1,counter))
			endif
				       
		endfor
		on case counter
		case 0:
			rvalue = ""
			retval = -1	|attr.textmode error
			break
		case 1:
			rvalue = textfield(1,counter)
			retval = 3	|attr.textmode read write
			break
		default:
			header.text = "Text Manager"       
			retval = zncomdllextend.selection.menu(header.text,
								0,
								0,
								linked_list, 
								counter,
								rvalue)
			if retval then	|user selected
				rvalue = strip$(shiftl$(textfield(1,retval))) 
					 |return column name
				retval = 3	|attr.textmode read write
			else	|user hit cancel
				rvalue = ""
				retval = -1
			endif
			
			break
		endcase
	endif
	return(retval)
}
function extern void zncomdllextend.text.manager(string table_name(9))
{

			long		text.lines
			
	attr.textmode = zncomdllextend.choice.text(table_name, attr.textfield$)
	if not isspace(attr.textfield$) then
		text.lines = TEXT.EDIT(attr.textfield$,language$,attr.textkw1$,
				       attr.textkw2$,attr.textkw3$,
				       attr.textkw4$,"","",attr.textmode)
		update.occ()
		refresh()
		attr.textfield$ = ""
	endif
}
Reply With Quote
  #12  
Old 27th April 2012, 23:52
benito's Avatar
benito benito is offline
Guru
 
Join Date: Jan 2002
Location: Eastern US
Posts: 528
benito is on a distinguished road
Baan: LN Cloud Edition - DB: Oracle/Windows - OS: Unix/Linux/Windows
which route did you go?

mark,

were you able to solve your issue? which route did you go?

thanks.
benito
Reply With Quote
  #13  
Old 2nd May 2012, 20:44
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,819
mark_h will become famous soon enoughmark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Sorry missed this. Looks like I just zoomed to a menu instead of what I was looking for.

Code:
field.in.location:
before.zoom:
| Set fields needed for find in tdltc0130m000	
 	attr.zoomsession$="mtdapi000010011"
	tdilc007.item = tdpur045.item
	tdilc007.cwar = tdpur045.cwar
	tdilc007.loca = in.location
| Set fields needed for find in tdilc1514s000		
	tdilc101.cwar = tdpur045.cwar
	tdilc101.item = tdpur045.item
	tdilc101.loca = in.location
| 20061003 - Add tiitm001.desc	
	select	tiitm001.stgu, tiitm001.cuqp, tiitm001.dsca
	from	tiitm001
	where	tiitm001._index1 = {:tdpur045.item}
	selectdo
	endselect
	tdilc101.stun = tiitm001.stgu

after.zoom:
	import("zoom.loca",zoom.loca)
	in.location = zoom.loca
	display("in.location")
__________________
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
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
problem with function server and menu DEM console AFS/DDC/OLE: Function servers 1 5th November 2003 15:44
Zooming and returning fields ken bohnenkamp Tools Development 5 21st November 2002 11:14
Menu return value? RalphBaan Tools Development 3 5th March 2002 10:51
Herstellkostenberechnung in BaaN 4c Kai's Forum Users Deutsches Forum 4 5th July 1999 01:00


All times are GMT +2. The time now is 01:30.


©2001-2023 - Baanboard.com - Baanforums.com