Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 24th July 2013, 20:48
timb25's Avatar
timb25 timb25 is offline
Member
 
Join Date: Feb 2002
Location: Pittsburgh, PA
Posts: 90
timb25 is on a distinguished road
Baan: Baan IV c4, ERP LN 6.1 - DB: Oracle 9.2.0, MSQL7 - OS: HP-UX 11.11, Windows
trouble creating a child session in LN
Baan: ERP LN 6.1 FP5
C/S: None/Unknown

What is the best way to accomplish this seemingly simple customization?
First referring to: LN6.1 FP5
-----------------------------------------------------
Starting with AR open entries session - tfacr2520m000
When I highlight a record, I want to click Specific and select a custom session. (I've already added my custom session to the form command)

When this custom session opens, I want to display the document number, etc. (PK) and allow the user to insert 1 record of more information about this AR record, but in a different table.

The PK in the tfacr200 table is: ttyp, ninv, line, tdoc, docn, lino
The PK in the custom table tfacr930 is the same: ttyp, ninv, line, tdoc, docn, lino
There are 3 additional fields in the tfacr930 table for entry.

I'm going insane trying to get this to work. This should be simple in nature, but nothing seems to be working as expected.

Thanks for any help!

-Tim
Reply With Quote
  #2  
Old 24th July 2013, 22:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well sorry I can't help, but maybe this helps someone else help you. What exact problems or errors are you encountering? As much detail as possible to help an LN person to make a recommendation. Again sorry I can't help, but maybe one day in the future I will get to work on LN.
__________________
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
  #3  
Old 24th July 2013, 22:52
timb25's Avatar
timb25 timb25 is offline
Member
 
Join Date: Feb 2002
Location: Pittsburgh, PA
Posts: 90
timb25 is on a distinguished road
Baan: Baan IV c4, ERP LN 6.1 - DB: Oracle 9.2.0, MSQL7 - OS: HP-UX 11.11, Windows
Post screen shots and code

Please see the word attachment of the screen progression that I want to accomplish.

Also here is my code. This is on the called custom session.

Code:
zoom.from.all:
on.entry:
	import.tfacr200.fields()


functions:

function import.tfacr200.fields()
{
	import("tfacr200.ttyp", tfacr930.ttyp)
	import("tfacr200.ninv", tfacr930.ninv)
	import("tfacr200.line", tfacr930.line)
	import("tfacr200.tdoc", tfacr930.tdoc)
	import("tfacr200.docn", tfacr930.docn)
	import("tfacr200.lino", tfacr930.lino)
}
Attached Files
File Type: zip Screen Shots of sessions.zip (190.4 KB, 14 views)
Reply With Quote
  #4  
Old 25th July 2013, 01:16
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
On 4c4 I have never had that work. I usually import to the same field name. Then assign the field to the new table field. So I would basically import tfacr200 into tfacr200, then set tfacr930 = tfacr200. I can't remember why but back in the early 2000's I had issues with a called session knowing about a table record in the parent session. From that point forward I did not try it. I also usually use zoom type fields on export from one session and for import. Then set the table field. Another for example I usually say like zoom.item = tiitm001.item, export zoom.item, import zoom.item, tablexx.item = zoom.item. I know there are better ways, but it works for me.

OOPS only referring to import/export. I can't answer the LN questions you had. Sorry about that.
__________________
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
  #5  
Old 25th July 2013, 03:54
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Ok,

I will take this one. Have done this many times.

First add the customized session to the form commands of the main session. Do copy the session to current VRC. Now, in the form command, the "command availability" field should be - "One Record Selected".

What I always do is, declare the variables having domains similar to the imported variables and now do this:-

Code:
before.program:

import("prog.name$",calling.session) 
	
	if calling.session = "tfacr2520m000" then
		import("tfacr200.ttyp",ttyp)
		import("tfacr200.ninv",ninv)
               ...
               ...
        endif

 

field.tfacr930.ttyp:

before.display:    | you can use before.field too

tfacr930.ttyp = ttyp

field.tfacr930.ninv:

before.display:

tfacr930.ninv = ninv

........... | Do this for all the form fields
Thats it.

Also, make the imported fields as display fields else the user will play with them
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!

Last edited by bhushanchanda : 25th July 2013 at 04:35.
Reply With Quote
  #6  
Old 25th July 2013, 09:46
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Also,

Add this for the additional fields:-

Code:
field.tfacr930.text:

before.display:

select tfacr930.*
from   tfacr930
where  tfacr930._index1 = {:ttyp,:ninv,:line,:tdoc,:docn,:lino}
selectdo
endselect
This will display the values for the other non imported fields if any information is already inserted in the table.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!

Last edited by bhushanchanda : 25th July 2013 at 10:00.
Reply With Quote
  #7  
Old 25th July 2013, 17:31
timb25's Avatar
timb25 timb25 is offline
Member
 
Join Date: Feb 2002
Location: Pittsburgh, PA
Posts: 90
timb25 is on a distinguished road
Baan: Baan IV c4, ERP LN 6.1 - DB: Oracle 9.2.0, MSQL7 - OS: HP-UX 11.11, Windows
Post that works!!...but

Thanks for the replies Mark and Bhushan!!

Bhushan - that worked awesomely! (for the most part)

I made all the changes. Now when I 'zoom' to that session from the tfacr2520 session the first time, I can add the record. Added text into that text box. Save and exit. Go back into that record to see the data but the text in the text box would not appear.

SO... I changed the session to use the text manager thinking that might make a difference.

Now when i go into the session to see a previously entered record, it says record already exists after clicking the text button.

I'm not sure the best way to handle this text field because it could get lengthy. (meaning should i use the text manager)
Attached Files
File Type: zip AddRecordSteps.zip (190.9 KB, 8 views)
Reply With Quote
  #8  
Old 25th July 2013, 17:50
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi Timb,

What does the button text do? Does it have any script attached? Also, have you added the select loop in the field section for the two fields i.e. catagory code and action code?

Like:-

Code:
field.field_name:

before.display:

select tfacr930.*
from   tfacr930
where  tfacr930._index1 = {:ttyp,:ninv,:line,:tdoc,:docn,:lino}
selectdo
endselect
Because, I guess the fields stored are not getting retrieved.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #9  
Old 25th July 2013, 21:55
timb25's Avatar
timb25 timb25 is offline
Member
 
Join Date: Feb 2002
Location: Pittsburgh, PA
Posts: 90
timb25 is on a distinguished road
Baan: Baan IV c4, ERP LN 6.1 - DB: Oracle 9.2.0, MSQL7 - OS: HP-UX 11.11, Windows
Post current code and screen shot

Bhushan.. Ok I removed the text manager button and went back to the original text form field. I have the select code under each of the other non imported fields. Here is the code:

Code:
before.program:
	import.tfacr200.fields()

field.tfacr930.ttyp:
before.display:
	tfacr930.ttyp = x.ttyp

field.tfacr930.ninv:
before.display:
	tfacr930.ninv = x.ninv

field.tfacr930.line:
before.display:
	tfacr930.line = x.line

field.tfacr930.tdoc:
before.display:
	tfacr930.tdoc = x.tdoc

field.tfacr930.docn:
before.display:
	tfacr930.docn = x.docn

field.tfacr930.lino:
before.display:
	tfacr930.lino = x.lino

field.tfacr930.catn:
before.display:
	select	tfacr930.catn
	from	tfacr930
	where	tfacr930._index1 = {:x.ttyp, :x.ninv, :x.line, :x.tdoc, :x.docn, :x.lino}
	selectdo
	endselect

field.tfacr930.actn:
before.display:
	select	tfacr930.actn
	from	tfacr930
	where	tfacr930._index1 = {:x.ttyp, :x.ninv, :x.line, :x.tdoc, :x.docn, :x.lino}
	selectdo
	endselect

field.tfacr930.text:
before.display:
	select	tttxt010.text
	from	tfacr930, tttxt010
	where	tfacr930._index1 = {:x.ttyp, :x.ninv, :x.line, :x.tdoc, :x.docn, :x.lino}
	and	tfacr930.text = tttxt010.ctxt
	selectdo
	endselect


functions:

function import.tfacr200.fields()
{
	import("prog.name$",calling.session)

	if calling.session = "tfacr2520m000" then
		import("tfacr200.ttyp", x.ttyp)
		import("tfacr200.ninv", x.ninv)
		import("tfacr200.line", x.line)
		import("tfacr200.tdoc", x.tdoc)
		import("tfacr200.docn", x.docn)
		import("tfacr200.lino", x.lino)
	endif
}
Thanks,
-Tim
Attached Files
File Type: zip RecordProblemWithText.zip (129.1 KB, 4 views)
Reply With Quote
  #10  
Old 26th July 2013, 08:10
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi Timb,

I have not played with the text fields on form. I will get back to you if found any solution.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!

Last edited by bhushanchanda : 26th July 2013 at 08:22.
Reply With Quote
  #11  
Old 26th July 2013, 09:30
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Ok,

Here's what you need to do:-

Declare these variables:-

Quote:
string bbuf(80,40)
string btext(500)
long b1
string text1(240)
And include this library:-

Quote:
#include<bic_text>
Code:
field.tfacr943.text:

before.display:

	btext = ""
	text1 = ""
	for b1 = 1 to
	text.to.buf("tfacr943.text", "2", 5, bbuf)
	btext = strip$(btext)&" "&strip$(bbuf(1,b1))
	endfor
	text1 = btext
 	
        text.buf.to.field("tfacr943.text", text1)
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!

Last edited by bhushanchanda : 26th July 2013 at 17:49.
Reply With Quote
  #12  
Old 26th July 2013, 17:38
timb25's Avatar
timb25 timb25 is offline
Member
 
Join Date: Feb 2002
Location: Pittsburgh, PA
Posts: 90
timb25 is on a distinguished road
Baan: Baan IV c4, ERP LN 6.1 - DB: Oracle 9.2.0, MSQL7 - OS: HP-UX 11.11, Windows
Bhushan,
That text piece has worked perfectly! Thank you!

Still trying to figure out why i cannot modify a record that has already been inserted in the custom table.
Reply With Quote
Sponsored Links
  #13  
Old 26th July 2013, 19:02
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,287
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Smile

Hi Timb,

Congrats for that. Now, for the next thing, i.e. to modify the text, just add this:-

Code:
choice.add.set:

after.choice:

select tfacr943.*
from   tfacr943 for update
where  tfacr943._index1 = {:ttyp,:ninv,:line,:tdoc,:docn,:lino}
selectdo
	db.delete(ttfacr943,db.retry,elocked)
	commit.transaction()
endselect
And there you go!
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!

Last edited by bhushanchanda : 26th July 2013 at 20:39.
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
Zoom Menu Return Multi Value layswan Tools Development 3 24th July 2012 09:42
Start a customized session from a standard session ltannous Tools Development 15 26th May 2005 14:08
tfacp9450m000 FIBU Brush Up Kai's Forum Users Deutsches Forum 1 16th November 1999 00:00


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


©2001-2017 - Baanboard.com - Baanforums.com