Baanboard.com

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

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 14th March 2014, 06:29
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
Question handling through AFS

Hello Everyone,

I trying to insert project activity in session tppss2100m000. While Inserting a question pop ups everytime. i have handled this question through stpapi.enum.answer. I have the source code of the script so i know the code of the question getting popped up.

I have attached screenshot of the question.

Urgent Help is required.

Thanx
Attached Images
File Type: jpg act_message.jpg (9.1 KB, 24 views)
Reply With Quote
  #2  
Old 14th March 2014, 07:29
Ankita Patel's Avatar
Ankita Patel Ankita Patel is offline
Junior Member
 
Join Date: Jul 2012
Location: Hyderabad
Posts: 29
Ankita Patel is on a distinguished road
Baan: BaaN IVC4 ,ERPLN - DB: Oracle - OS: ms - Win
Hi,

we can handle questions in AFS using

void stpapi.enum.answer(string session, string question,bset answer)

in your case you said you have already handled it using the above syntax only.
can you please tell what exact error you are getting?
__________________
Regards,
Ankita Patel
Reply With Quote
  #3  
Old 14th March 2014, 08:04
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
Hi,

Actually its not an error, and i have attached a image of actual message that is popped up.

Thanks
Reply With Quote
  #4  
Old 14th March 2014, 08:07
Ankita Patel's Avatar
Ankita Patel Ankita Patel is offline
Junior Member
 
Join Date: Jul 2012
Location: Hyderabad
Posts: 29
Ankita Patel is on a distinguished road
Baan: BaaN IVC4 ,ERPLN - DB: Oracle - OS: ms - Win
can you paste your AFS code?
__________________
Regards,
Ankita Patel
Reply With Quote
  #5  
Old 14th March 2014, 08:22
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
stpapi.put.field("tppss2100m000", "tppss200.cprj", cprj)
stpapi.put.field("tppss2100m000", "tppss200.cpla", cpla)
ret = stpapi.change.view("tppss2100m000",err)
ret = stpapi.synchronize.dialog("tppss2100m000","add",err)
if ret then
stpapi.put.field("tppss2100m000", "tppss200.cact", cact)
stpapi.put.field("tppss2100m000", "tppss200.desc", desc)
stpapi.put.field("tppss2100m000", "tppss200.seak", seak)
stpapi.put.field("tppss2100m000", "tppss200.cuni", unit)
stpapi.put.field("tppss2100m000", "tppss200.tact", str$(tact))
stpapi.put.field("tppss2100m000", "tppss200.pact", pact)
stpapi.put.field("tppss2100m000", "tppss200.stat", str$(stat))
stpapi.put.field("tppss2100m000", "tppss200.wast", str$(wast))
stpapi.enum.answer("tppss2100m000","tppss20001",tcyesno.no)
ret = stpapi.insert("tppss2100m000",true,err)
if ret then
message("Activity Inserted Successfully")
endif
endif

stpapi.end.session("tppss2100m000")
Reply With Quote
  #6  
Old 14th March 2014, 09:52
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,320
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

The problem in your case is that, you are answering the question when its already popped up. Place it before inserting the activity field.

Here's my working trial.
Code:
#pragma used dll ottstpapihand		
function main()
{
long ret
string err(50)
stpapi.put.field("tppss2100m000", "tppss200.cprj", "0.90 MM")
stpapi.put.field("tppss2100m000", "tppss200.cpla", "1")
ret = stpapi.change.view("tppss2100m000",err)
ret = stpapi.synchronize.dialog("tppss2100m000","add",err)
if ret then
stpapi.enum.answer("tppss2100m000","tppss20001",tcyesno.no)
stpapi.put.field("tppss2100m000", "tppss200.cact", "3")
stpapi.put.field("tppss2100m000", "tppss200.desc", "testing")
stpapi.put.field("tppss2100m000", "tppss200.seak", "test")
stpapi.put.field("tppss2100m000", "tppss200.tact", "4")
stpapi.put.field("tppss2100m000", "tppss200.pact", "10000001")
stpapi.put.field("tppss2100m000", "tppss200.stat", "1")
stpapi.put.field("tppss2100m000", "tppss200.wast", "1")
ret = stpapi.insert("tppss2100m000",true,err)
if ret then
message("Activity Inserted Successfully")
endif
endif

stpapi.end.session("tppss2100m000")
}
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #7  
Old 14th March 2014, 10:28
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
Hello sir,
I have tried your code, But still message is coming.

Regards,
Avin Singhi
Reply With Quote
  #8  
Old 14th March 2014, 10:31
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,320
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

What are you passing for tact,stat & wast? You can try passing the long values like 1,2,3 instead of passing the domain enum code.

Check the example. It works form me. May be you are not passing the correct values.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #9  
Old 15th March 2014, 05:31
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
Hello sir,

I have tried passing long values but still message is coming.

Regards,
Avin Singhi
Reply With Quote
  #10  
Old 16th March 2014, 03:20
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
What do you mean the message pops up? When you run afs code it all runs in the background and you should not see any messages. If the actual session or message actually brings it to the foreground then there is something else wrong.

So to me this code looks correct - well except for the synchronize dialog - not sure what it is in the code for, so I took it out.
Code:
stpapi.put.field("tppss2100m000", "tppss200.cprj", cprj)
stpapi.put.field("tppss2100m000", "tppss200.cpla", cpla)
ret = stpapi.change.view("tppss2100m000",err)
if ret then
   stpapi.put.field("tppss2100m000", "tppss200.cact", cact)
   stpapi.put.field("tppss2100m000", "tppss200.desc", desc)
   stpapi.put.field("tppss2100m000", "tppss200.seak", seak)
   stpapi.put.field("tppss2100m000", "tppss200.cuni", unit)
   stpapi.put.field("tppss2100m000", "tppss200.tact", str$(tact))
   stpapi.put.field("tppss2100m000", "tppss200.pact", pact)
   stpapi.put.field("tppss2100m000", "tppss200.stat", str$(stat))
   stpapi.put.field("tppss2100m000", "tppss200.wast", str$(wast))
   stpapi.enum.answer("tppss2100m000","tppss20001",tcyesno.no)
   ret = stpapi.insert("tppss2100m000",true,err)
   if ret then
      message("Activity Inserted Successfully")
   endif
endif
stpapi.end.session("tppss2100m000")

So the above code should work unless there is a data issue as bhushan stated. My question would be what is in the err code in the stpapi.insert. Right after the stpapi.insert - check err and see what it says.

Now having said all that - there is a remote possibility that answer the question with no will not work. I know in 4c4 one session we created afs code we had to change the default answer for the question. Only then would it work. But first look at the above and see what err is returning.
__________________
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
  #11  
Old 18th March 2014, 11:43
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
Activity that i am trying to insert is standard activity(refer table tppdm110). With standard activity only i am getting the message. For default activity my code works perfectly fine

Regards,
Avin Singhi
Reply With Quote
  #12  
Old 23rd March 2014, 18:51
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Once again - what do you mean you are getting the message? What message are you getting and from where in the afs code? You started the thread out asking about a question. The questions answer is set before you do the insert. At the point ret = stpapi.insert("tppss2100m000",true,err) is executed you have the answer set. So what is the value in err?
__________________
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 24th March 2014, 07:59
avin_ln's Avatar
avin_ln avin_ln is offline
Member
 
Join Date: Feb 2014
Posts: 39
avin_ln is on a distinguished road
Baan: INFOR LN FP9 - DB: SQL SERVER 2012 - OS: WINDOWS
Message(question) that i am getting is Copy data from Standard Activities?. i have handled this question before stpapi.insert(). whether i click yes or no i am able to insert the data. there is no error in inserting data. problem is created due to this message. If i have 1000 records to insert then this question will come 1000 times

Regards,
Avin Singhi
Reply With Quote
  #14  
Old 24th March 2014, 14:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,929
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
You still have not answered my question - is this actual message box popping up in the middle of the AFS session?
__________________
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
  #15  
Old 24th March 2014, 14:41
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,320
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

Yes, you have to answer the question every time you insert a record. Whether its 1000 times or more.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
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
"ttstpsplopen" handling in tfgld1111s000 using AFS kiran kumar AFS/DDC/OLE: Function servers 8 3rd August 2011 18:01
AFS & API question Ash Gajjar Tools Development 1 13th November 2007 14:20
Question about AFS in tdsls4101m000 baanfans AFS/DDC/OLE: Function servers 4 31st July 2006 08:47
AFS Question... r_nagu AFS/DDC/OLE: Function servers 3 30th June 2003 13:48
Question on handling sub sessions using AFS. r_nagu AFS/DDC/OLE: Function servers 5 9th August 2002 21:30


All times are GMT +2. The time now is 04:40.


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