Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
14%
200 - 500 GB
32%
500 - 800 GB
4%
800 - 1200 GB
4%
1200 - 1500 GB
11%
1500 - 2000 GB
14%
> 2000 GB
21%
Total votes: 28

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 25th April 2018, 05:24
tmannais's Avatar
tmannais tmannais is offline
Member
 
Join Date: Jul 2017
Posts: 98
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
[AFS] some fields are not updated on stpapi.update()

Hi,

I am using AFS to update Sales Order in session tdsls4100m000. However, some fields are updated while some are not.
This is the code:

**************
stpapi.clear(session.code)
stpapi.put.field(session.code, "tdsls400.orno.segment.1", trim$(str$(i.sales.order)))
stpapi.find(session.code, error.msg)
if not isspace(error.msg) then
error.msg = "Record not found: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
if stpapi.mark(session.code, error.msg) = 0 then
error.msg = "Cannot mark: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
if stpapi.synchronize.dialog(session.code, "modify", error.msg) = 0 then
error.msg = "Cannot open synchonized dialog for updating SQ header: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.form.command(session.code, 5, "open.sales.order", error.msg)
if isspace(error.msg) then
|These fields get updated
stpapi.put.field(session.code, "tdsls400.ofbp", trim$(str$(i.sold.to.bp)))
stpapi.put.field(session.code, "tdsls400.sotp", trim$(str$(i.so.type)))
stpapi.put.field(session.code, "tdsls400.stbp", trim$(str$(i.ship.to)))
stpapi.put.field(session.code, "tdsls400.corn", trim$(str$(i.customer.order)))
|These fields don't get updated
stpapi.put.field(session.code, "tdsls400.refa", trim$(str$(i.reference.a)))
stpapi.put.field(session.code, "tdsls400.refb", trim$(str$(i.reference.b)))
stpapi.put.field(session.code, "tdsls400.cfrw", trim$(str$(i.carrier)))
stpapi.put.field(session.code, "tdsls400.cpay", trim$(str$(i.payment.term)))
|Moreover, if these two fields are uncommented, all of the fields here don't get updated at all
|stpapi.put.field(session.code, "tdsls400.prdt", trim$(str$(i.planned.date)))
|stpapi.put.field(session.code, "tdsls400.ddat", trim$(str$(i.planned.date)))

stpapi.update(session.code, true, error.msg)
if not isspace(error.msg) then
error.msg = "Cannot update SO header: " & error.msg
stpapi.recover(session.code,recov.error.msg)
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
**************

I commented the lines showing which fields are getting updated and which fields are not. Please advice.
Reply With Quote
Sponsored Links
  #2  
Old 25th April 2018, 15:40
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,135
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
You can search this forum to see what others did, but I am not familiar with this session. But one thing I have done for some fields is to do an insert/update and then go back and update some fields. Might work and might not work. As for the other 2 fields - not really sure unless you have the wrong date format or possibly invalid dates.
__________________
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
Undocumented Functions & Variables george7a Tools Development 81 30th September 2015 12:35
reading fields updated by "display.total.fields" using AFS ? Trisli AFS/DDC/OLE: Function servers 0 3rd August 2005 10:41
Exchange - Only need to import date for a couple of table fields pjohns Tools Development 7 27th June 2003 10:06
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 13:40.


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