Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 16th January 2018, 10:18
tmannais's Avatar
tmannais tmannais is offline
Member
 
Join Date: Jul 2017
Posts: 58
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
Exclamation [AFS] mandatory field is cleared on insert

Hi,

I am having a problem about AFS.
I use stpapi.put.field() to put values into the mandatory fields.
After that, I use stpapi.insert() to insert the record.
I normally do something like this and all the works I have done can perform just fine.
However, this session (tfacr1110s000) doesn't.
After running the AFS code, it gives error pointing that a mandatory field is missing even though I just put it in before the insert line.
After a while of investigating, I suspect that this stpapi.insert() clears the field itself and then gives error because it cannot insert since the field (it just cleared) is empty. I think because a field here has a default value for the field to be empty and it overwrites after the AFS had just finished its script.
Am I misunderstanding anything?
If not, is there a solution for this issue?
Please help.
Thanks in advance.

Regards,
Thana
Reply With Quote
  #2  
Old 16th January 2018, 13:48
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,096
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Moved to the correct forum. Hard to say exactly what might be happening but it sounds reasonable. In a couple of situations like this our solution was to use qkey to modify the source code - assuming you do not own source. Other times I have done a save followed by an update. I think even in one place I had to do an update with the update flag set to false before I could get something like an insert to work. Not familiar with LN or that session so just relating some of the stuff I have done in 4c4.
__________________
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 17th January 2018, 03:05
tmannais's Avatar
tmannais tmannais is offline
Member
 
Join Date: Jul 2017
Posts: 58
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
I will try what you suggested and let you know if the solutions work.
By the way, please tell me more about QKEY and how can I get it?

Regards,
Thana
Reply With Quote
  #4  
Old 17th January 2018, 12:02
tmannais's Avatar
tmannais tmannais is offline
Member
 
Join Date: Jul 2017
Posts: 58
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
I tried your solutions except QKEY and all of them did not work.
Using Save and then Update results in "Command Disabled".
Using Update with flag set to false and then Insert results in the same error as I had before -- the field is empty.
I really want to try QKEY. Please advice.

Regards,
Thana
Reply With Quote
  #5  
Old 17th January 2018, 13:20
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,096
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Are you on LN? See this thread where they got it to work http://www.baanboard.com/baanboard/s...=tfacr1110s000.

Qkey is no longer supported or available. Qkey is basically a source extender like what ~vamsi posted in http://www.baanboard.com/baanboard/showthread.php?t=559 the code and utilities forum.
__________________
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
  #6  
Old 18th January 2018, 11:42
tmannais's Avatar
tmannais tmannais is offline
Member
 
Join Date: Jul 2017
Posts: 58
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
I explore every reply in the link you gave me. I came up with a method to stpapi.put.field() only on tfacf200.itbp and then insert. It can actually insert the record to the database. After that, I put other fields in and update, and I found that field tfacr200.dued causes the issue. So, I put in every field other than tfacr200.dued and it works just fine now. I will try to update the field later but it is easier than before now because at least it is inserted into the database.
Thank you so much for your help.

Regards,
Thana
Reply With Quote
  #7  
Old 18th January 2018, 13:26
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,096
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Glad you found the solution. I know I do that exact same thing on my PO session - I create the PO then go back and update 1 field (and I actually use a select/update) to get it updated. For some reason it would never update thru stpapi - I think it was buyer.
__________________
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
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
How can we make a form field of type text as mandatory in script baan1234 Tools Development 2 10th August 2015 15:17
Problem in making text field to be mandatory field alerts Tools Development 10 17th December 2013 09:24
Mandatory Field Problem ashishjain Tools Development 2 6th December 2010 18:24
Mandatory field at form level BaanTech Tools Development 3 20th September 2002 16:14


All times are GMT +2. The time now is 06:46.


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