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 3rd March 2016, 14:10
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 50
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Handle STD Question

Hello ,

My Requirement is to Insert Label in STD Label Session ttadv1140m000,
so I have Write AFS for that session .It is working for New Label with new desc .but if i have insert new Label for Which desc is already Present in some existing session, it will ask one question in std "ttadv11403" , but that Question is not handle in my AFS .I have Tried Question Code at Diffrent Place but still not working for new DESC

|| AFS

stpapi.put.field("ttadv1140m000", "ttadv140.clan", cust.clan)
stpapi.put.field("ttadv1140m000", "ttadv140.cpac", cust.cpac)
ret = stpapi.change.view("ttadv1140m000", err)

ret = stpapi.synchronize.dialog("ttadv1140m000", "add", err)
if ret = 1 then
stpapi.enum.answer("ttadv1140s000", "ttadv11403", ttyeno.yes )
stpapi.put.field("ttadv1140s000", "ttadv140.vers", cust.vers)
stpapi.put.field("ttadv1140s000", "ttadv140.rele", cust.rele)
stpapi.put.field("ttadv1140s000", "ttadv140.cust", cust.cust)

stpapi.put.field("ttadv1140s000", "ttadv140.zc_cont", str$(etol (ttadv.cont.general)))
stpapi.put.field("ttadv1140s000", "ttadv140.desc", str$(trim$(new.label)))
stpapi.put.field("ttadv1140s000", "ttadv140.clab", trim$(f.prefix & str$(get.count)))
stpapi.enum.answer("ttadv1140s000", "ttadv11403", ttyeno.yes )

ret = stpapi.insert("ttadv1140s000",true, err)
if ret then
stpapi.get.field("ttadv1140s000", "ttadv140.desc", get.desc)
stpapi.get.field("ttadv1140s000", "ttadv140.clab", get.clab)
endif
stpapi.end.session("ttadv1140s000")
stpapi.end.session("ttadv1140m000")
endif

I have Also done this by Using DAL - but it will give language error in DAL - i have use 2 as language

switch.to.company(000)
dal.new.object("ttadv140")
dal.set.field("ttadv140.clan", "2")
dal.set.field("ttadv140.cpac", cust.cpac)
dal.set.field("ttadv140.vers",cust.vers)
dal.set.field("ttadv140.rele",cust.rele)
dal.set.field("ttadv140.cust",cust.cust)
dal.set.field("ttadv140.zc_cont",ttadv.cont.general)
dal.set.field("ttadv140.desc",new.label)
dal.set.field("ttadv140.clab", f.prefix)

if dal.save.object("ttadv140") = 0 then
commit.transaction()
else
dal.get.error.message(err)
mess("ltanystr",0,err)
endif

Thank you
Frenny K
Reply With Quote
  #2  
Old 3rd March 2016, 14:41
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 444
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Hi Frenny

There is an AFS section and that section was most revelant for your question.

Anyways.What is the exact question that is asked and what is the default answer in the question?Regarding this AFS functionality, there is a condition that states

Code:
This function must only be used for questions for which the default answer in the session must be overruled.
Perhaps the default answer is Yes .. It could be a small possibility.
Reply With Quote
Sponsored Links
  #3  
Old 3rd March 2016, 15:53
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,924
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Moved to correct forum.

I had this happen in one standard baan session. No matter what I tried it would not work with the stpapi commands. Eventually I just changed the default answer on the question. Not sure that will work for you since this is a tools question. Also confirm the domain is correct(and not tcyesno.yes).

Another option - is before adding, check if present, if present delete it and re-add the record from scratch. A lot more coding but another possibility.
__________________
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
  #4  
Old 3rd March 2016, 16:31
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,314
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,

Surprisingly, your code works just fine for me.

Though, I would suggest to put the stpapi.enum.answer() before using any put() functions.

Code:
stpapi.enum.answer("ttadv1140s000", "ttadv11403", ttyeno.yes )
stpapi.put.field("ttadv1140m000", "ttadv140.clan", cust.clan)
stpapi.put.field("ttadv1140m000", "ttadv140.cpac", cust.cpac)
ret = stpapi.change.view("ttadv1140m000", err)

ret = stpapi.synchronize.dialog("ttadv1140m000", "add", err)
if ret = 1 then

stpapi.put.field("ttadv1140s000", "ttadv140.vers", cust.vers)
stpapi.put.field("ttadv1140s000", "ttadv140.rele", cust.rele)
stpapi.put.field("ttadv1140s000", "ttadv140.cust", cust.cust)

stpapi.put.field("ttadv1140s000", "ttadv140.zc_cont", str$(etol (ttadv.cont.general)))
stpapi.put.field("ttadv1140s000", "ttadv140.desc", str$(trim$(new.label)))
stpapi.put.field("ttadv1140s000", "ttadv140.clab", trim$(f.prefix & str$(get.count)))

ret = stpapi.insert("ttadv1140s000",true, err)
if ret then
stpapi.get.field("ttadv1140s000", "ttadv140.desc", get.desc)
stpapi.get.field("ttadv1140s000", "ttadv140.clab", get.clab)
endif
stpapi.end.session("ttadv1140s000")
stpapi.end.session("ttadv1140m000")
endif
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #5  
Old 4th March 2016, 06:16
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 50
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Thank you very much bhushanchanda sir , your code is working..

Frenny
Reply With Quote
  #6  
Old 4th March 2016, 16:15
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,924
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Now that just does not make sense to my 4c4 mind. In 4c4 I just need to answer the question before any action is executed(like a save, delete, etc). Is this another ln "feature"?
__________________
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
  #7  
Old 4th March 2016, 20:42
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,314
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
Mark,

Fortunately, AFS is one of the few things which hasn't changed in LN or the newer 10.4 versions.

The reason why it works is, the question pops up when we put the Description field value and not when the record is saved.

Following your suggestion on this thread I always prefer to answer the question before starting stapi.put.field().
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #8  
Old 13th March 2017, 10:18
Marek_C's Avatar
Marek_C Marek_C is offline
Newbie
 
Join Date: Oct 2011
Posts: 1
Marek_C is on a distinguished road
Baan: LN - DB: SQL - OS: WIN
Anyone got a clue, why DAL doesn't work?
Reply With Quote
  #9  
Old 20th March 2017, 00:58
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,924
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Dal does not work in what way? I think is the preferred method over AFS for LN.
__________________
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
Question handling through AFS avin_ln AFS/DDC/OLE: Function servers 18 26th March 2014 06:37
wild cards in Question joepte Tools Development 1 10th May 2012 08:27
Cost Price Vs Std price Babuplus Finance, Invoicing and Integration 0 13th July 2011 02:12
Std cost formula change B4c4-B5c? Paul P Manufacturing & Supply Chain 5 17th March 2003 22:55


All times are GMT +2. The time now is 23:59.


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