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 26th May 2003, 20:09
learner's Avatar
learner learner is offline
Guru
 
Join Date: Dec 2002
Location: New zealand
Posts: 562
learner is on a distinguished road
Baan: BaaN Vc with sp 28 - DB: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit - OS: HP-UX B.11.31
Talking Session Type - Maintain

Hello,

I have generated a Maintain session using Generate Session & this is saving data in a customized table, now when i open up this session script, i found that no code was written to save the data, but data is getting properly saved.

Now my doubt starts from here , before Saving data i want to make sure that if tdpur045.spur field is having value as 7 then it should not allow to modify the record which is shown on my this customized session, so for this i added in user.choice.modify that go to tdpur045 and check the value, and give the message that the record cannot be saved if the value is 7 in tdpur045.spur field for the feceipt no. specified on the customized session input form...... but how do i stop it from modifying the record since i cannot find any code relating to Saving/ Modification in the program script ???


Does this means that i re-create the script and write my own code to save/ modify the data into this customized table ??

Waiting for your replies,Gurus !!
Reply With Quote
  #2  
Old 27th May 2003, 04:33
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
options...

The standard script does not need code in it to write/read from the tables (the Baan tools handle this), but you are able to add your own code, to modify whether records get saved or not.

There are a couple of options, where you can prevent records from being saved, such as;

choice.update.db:
before.choice:
if tdpur045.spur = 7 then
choice.again()
endif


or you can use;

main.table.io:
before.write:
if tdpur045.spur = 7 then
skip.io("")
endif

before.rewrite:
if tdpur045.spur = 7 then
skip.io("")
endif

the before.write is for a new record being added, whereas the before.rewrite is for updating an existing record. In the skip.io, you can place a message code between the quotes, to have a message displayed to the user, why the record is not updated, if you leave the quotes empty, then it doesn't update the record, but no message is displayed. The choice.update.db is run, when you click on the save button (so is not always the best place to put checks on record updates in this section).

I have attached a text file, that is a copy of the sections that can be used in a 4GL script...
Attached Files
File Type: txt db_handling.txt (32.8 KB, 62 views)
Reply With Quote
  #3  
Old 27th May 2003, 04:37
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
additional...

Meant to add; that since you have asked about preventing the record from being modified, if tdpur045.spur is not 7, then you may want to try something like;


choice.modify.set:
before.choice:
if tdpur045.spur = 7 then
message("NO MODIFYING!!!")
choice.again()
endif

choice.delete.set:
before.choice:
if tdpur045.spur = 7 then
message("NO DELETING!!!")
choice.again()
endif


You obviously want to refine this (as you should use message codes instead of hard coding the message plus you may have a multi occurrence form, in which case, you will get multiple messages if you select a range of records to delete, etc...).
Reply With Quote
Sponsored Links
  #4  
Old 27th May 2003, 18:10
learner's Avatar
learner learner is offline
Guru
 
Join Date: Dec 2002
Location: New zealand
Posts: 562
learner is on a distinguished road
Baan: BaaN Vc with sp 28 - DB: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit - OS: HP-UX B.11.31
Talking Thanks !!

thanks as soon as i posted this message, i too did some R&D and was able to finanly figure out the same, anyway once again thanks all of u for helping me.
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
Maintain Generic Units ttaad1106m000 mark_h Tools Development 2 5th March 2004 14:43
Baan & Connectware Driver Hangs Rajasekhar Tools Administration & Installation 2 18th February 2004 21:32
additional field in Session No. tfgld0111m000 (Maintain Transaction Type) for Dimensi naresh.baan Enhancements 0 21st August 2003 06:32
Problem when invoking a session from another manusatsangi Tools Development 9 18th August 2003 13:40
How to call maintain session from display session in BaaN V baanlover Tools Development 10 18th July 2003 13:38


All times are GMT +2. The time now is 09:26.


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