Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
19%
200 - 500 GB
28%
500 - 800 GB
2%
800 - 1200 GB
7%
1200 - 1500 GB
7%
1500 - 2000 GB
12%
> 2000 GB
24%
Total votes: 83

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 3rd February 2006, 19:54
jcook331's Avatar
jcook331 jcook331 is offline
Member
 
Join Date: Sep 2004
Posts: 79
jcook331 is on a distinguished road
Baan: Baan IVc4 - DB: Oracle 8i - OS: Windows XP
Field will not update on Maintenance Session

I have a maintenance session where I'm updating a field through a function. The function does a check and then updates a date field progammatically. When the function runs the date displays in the field, but is not written to the table on save. I think I have seen this before but don't remember what I did to fix it. Any ideas?
Reply With Quote
  #2  
Old 3rd February 2006, 19:58
csecgn's Avatar
csecgn csecgn is offline
Guru
 
Join Date: Aug 2004
Location: Cologne/Germany
Posts: 300
csecgn is on a distinguished road
Baan: IVc4 SP14 (Tools SP 21) ; LN 6.1 (Testing) - DB: Oracle - OS: Solaris
Call update.occ() after your changes. This should help.

Regards
csecgn
Reply With Quote
  #3  
Old 3rd February 2006, 20:05
jcook331's Avatar
jcook331 jcook331 is offline
Member
 
Join Date: Sep 2004
Posts: 79
jcook331 is on a distinguished road
Baan: Baan IVc4 - DB: Oracle 8i - OS: Windows XP
I tried the update.occ() and it still did not work. Thanks, though.
Reply With Quote
  #4  
Old 3rd February 2006, 21:02
csecgn's Avatar
csecgn csecgn is offline
Guru
 
Join Date: Aug 2004
Location: Cologne/Germany
Posts: 300
csecgn is on a distinguished road
Baan: IVc4 SP14 (Tools SP 21) ; LN 6.1 (Testing) - DB: Oracle - OS: Solaris
Did you try like:

Code:
update.occ()               | a field has changed without user interaction
execute(update.db)      | Update database
execute(interrupt)        |refresh display

hth

Regards
csecgn
Reply With Quote
  #5  
Old 3rd February 2006, 22:02
jcook331's Avatar
jcook331 jcook331 is offline
Member
 
Join Date: Sep 2004
Posts: 79
jcook331 is on a distinguished road
Baan: Baan IVc4 - DB: Oracle 8i - OS: Windows XP
I had not done that, but when I tried that it still did not work. Here is the part of the code where I'm trying to update the table field.

Code:
    if lflfa360.rvav = 0 then
         lflfa360.rvav = date.num()
         update.occ()          
         execute(update.db)
         execute(interrupt)    
         display("lflfa360.rvav")
         message("File Verified")			
    endif

Last edited by mark_h : 3rd February 2006 at 22:18.
Reply With Quote
  #6  
Old 3rd February 2006, 23:09
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Could you please post what sections the update call is made from? How you handle commits vs. update occ. can depend on what standard section you are calling the update from....
Reply With Quote
  #7  
Old 3rd February 2006, 23:39
jcook331's Avatar
jcook331 jcook331 is offline
Member
 
Join Date: Sep 2004
Posts: 79
jcook331 is on a distinguished road
Baan: Baan IVc4 - DB: Oracle 8i - OS: Windows XP
I am calling the function that updates the field from choice.user.4 (a button on the form). I found an old post that had a solution for this that works. Code is:

PHP Code:
choice.user.4:
     
after.choice:
     do.
all.occ(check.for.file)

....

function 
check.for.file()
{
     
domain tcmcs.str100    pnam357
     domain tcmcs
.str15       cprj357
      string        network
.path(210)
      
long         num.bytes
      long        app
.id

...

     if 
lflfa360.rvav 0 then
          update
.occ()
          
lflfa360.rvav date.num()
          
execute(update.db)
          
display("lflfa360.rvav")
          
message("File Verified")
     endif

...

Reply With Quote
  #8  
Old 3rd February 2006, 23:58
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,407
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Shouldn't these two lines be reversed or is it a typo:
update.occ()
lflfa360.rvav = date.num()
__________________
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
  #9  
Old 4th February 2006, 12:43
csecgn's Avatar
csecgn csecgn is offline
Guru
 
Join Date: Aug 2004
Location: Cologne/Germany
Posts: 300
csecgn is on a distinguished road
Baan: IVc4 SP14 (Tools SP 21) ; LN 6.1 (Testing) - DB: Oracle - OS: Solaris
Post

Like Mark wrote: You are writing the update.occ before you update the field.Update.occ acts like db.update(...). I also think thats the problem.

Code:
... 

     if lflfa360.rvav = 0 then 
         lflfa360.rvav = date.num() 
          update.occ()
          execute(update.db) 
          display("lflfa360.rvav") 
          message("File Verified") 
     endif 

...

In your case you also have another opportunity: Select the table with the record where you are for update and write after the commit an execute(interrupt). This should also work.

Code:
...
db.retry.point()
select lflfa360.*
from lflfa360 for update
where lflfa360._index1 = {:lflfa360.<keyfield1>,...}
selectdo
    lflfa360.rvav = date.num()
    db.update(tlflfa360, db.retry)
endselect
commit.transaction()

execute(interrupt)
...

Another note: The do.all.occ works only for the visible records on your form. With this you cannot update the whole or a limited range of your maintable if it is not on the actual view.

hth

Regards
csecgn

Last edited by csecgn : 4th February 2006 at 13:30.
Reply With Quote
  #10  
Old 6th February 2006, 20:42
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
Try changing the order.
Assign the field a value.
Display the field on the form.
Update the occurance.
Call the DB update.

You might be rereading the form value and it is resetting to the original value.
Reply With Quote
  #11  
Old 10th December 2019, 11:36
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Bangkok, Thailand
Posts: 252
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
I just had an issue similar to this.
I can confirm that using

Code:
update.occ()
execute(update.db)
works.
Reply With Quote
  #12  
Old 10th December 2019, 15:03
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,407
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I don't think the question in this case was update.occ() and execute(update.db) not working, but I think it was the order the commands were being called while setting values. So set you field values, then call update.occ and then the execute. Don't call the update.occ, then set variables then call execute.
__________________
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
Sponsored Links
  #13  
Old 10th December 2019, 15:22
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,108
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 > 10.7 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
Question

Quote:
choice.user.4:
after.choice:
do.all.occ(check.for.file)
Ehm, the choice.user sections...
I thought these sections are not executed in the 4GL transaction? IN that case you will need to start your own transaction (so in the before.choice: add db.retry.point() and after the do.all.occ() add a commit.transaction?
__________________
Also read Luke 24:4-8
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
Editable synchronized dialogue not started srinivas AFS/DDC/OLE: Function servers 10 21st July 2005 08:25
update field stat in session tfgld1101m000 zamarlab AFS/DDC/OLE: Function servers 1 12th February 2004 16:01
tfacp9450m000 FIBU Brush Up Kai's Forum Users Deutsches Forum 1 16th November 1999 01:00


All times are GMT +2. The time now is 03:33.


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