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 3rd February 2006, 18: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, 18: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, 19: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, 20: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, 21: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 21:18.
Reply With Quote
  #6  
Old 3rd February 2006, 22: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
Sponsored Links
  #7  
Old 3rd February 2006, 22: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, 22:58
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
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, 11: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 12:30.
Reply With Quote
  #10  
Old 6th February 2006, 19: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
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 07:25
update field stat in session tfgld1101m000 zamarlab AFS/DDC/OLE: Function servers 1 12th February 2004 15:01
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:20.


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