Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
50%
Handover everything to System Integrator from drawing BP till implementation of ERP
0%
Hire more inhouse skilled & capable IT Resource to work directly with SI
50%
Rely on SI Architects/Consultants
0%
Total votes: 2

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 15th May 2020, 11:00
DDPatel DDPatel is offline
Junior Member
 
Join Date: Dec 2018
Location: India,Gujarat,Umbergaon 396150
Posts: 14
DDPatel is on a distinguished road
Baan: LN10.3 and LN10.4 - DB: SQL SERVER 2008 R2 - OS: WINDOW SERVER 2008 R2
AFS - "Calculate cost price" command not working
Baan: Infor ERP 10.3
C/S: None/Unknown

Hii all,
I have an issue in AFS. I made one session in which i am trying to do "Calculate Cost Price" by AFS .
Code Debugged successfully without any error, But when i go through standard session it seems "Calculate cost price" command has not executed.

What am i missing in this code ?


Below is my code.
Code:
function extern domain tcbool calculate.cost.prize.for.item()
{
   domain    tcmcs.str100    error.msg, error

    stpapi.put.field("ticpr0107m000","ticpr007.item", fn.item)
    stpapi.put.field("ticpr0107m000","ticpr007.acpm", "001     ")                                            |Aggregate Material Cost
    stpapi.put.field("ticpr0107m000","ticpr007.acpo", "002     ")                                            |Aggregate Operation Cost
    stpapi.put.field("ticpr0107m000","ticpr007.acps", "004     ")                                            |Aggregate Surcharge Cost
    stpapi.put.field("ticpr0107m000","ticpr007.chrt", "")                                               |Cost Component Chart
    stpapi.put.field("ticpr0107m000","home.currency", "INR")                                            |Currency
    stpapi.put.field("ticpr0107m000","ticpr007.inlc", str$(etol(tcyesno.yes)))                    |Include LAnded Cost
    stpapi.put.field("ticpr0107m000","ticpr007.lcst", "")                                            |Landed Cost Set
    stpapi.put.field("ticpr0107m000","ticpr007.spit", str$(etol(tcyesno.yes)))                    |surcharge by item
    stpapi.put.field("ticpr0107m000","ticpr007.vpwh", str$(etol(tcyesno.yes)))                    |Surcharge by Warehouse
    stpapi.put.field("ticpr0107m000","ticpr007.coyn", str$(etol(tcyesno.no)))                    |Combine ownership allowed
stpapi.form.command("ticpr0107m000", 5, "calculate", error.msg)
        if isspace(error.msg) then
         stpapi.end.session("ticpr0107m000",error)
            return(TRUE)
        endif
    stpapi.end.session("ticpr0107m000",error)
    return(FALSE)
 }

regadrs,
DPatel

Last edited by bhushanchanda : 15th May 2020 at 11:22. Reason: Added code tags
Reply With Quote
Sponsored Links
  #2  
Old 15th May 2020, 11:22
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,444
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
First thing I would try will be using segmented domain for item -

Code:
stpapi.put.field("ticpr0107m000","ticpr007.item.segment.2", trim$(fn.item))

Also, if you are just updating the cost prices, you don't need to use all the fields. And you will need to do a stpapi.find() to find the correct item. Here's the code you can use -

Code:
function extern domain tcbool calculate.cost.prize.for.item()
{
   domain    tcmcs.str100    error.msg, error

    stpapi.put.field("ticpr0107m000","ticpr007.item.segment.2", trim$(fn.item))
    ret = stpapi.find("ticpr0107m000")
   |** You can add validation if no record found (I've not added it)
    stpapi.form.command("ticpr0107m000", 5, "calculate", error.msg)
        if isspace(error.msg) then
         stpapi.end.session("ticpr0107m000",error)
            return(TRUE)
        endif
    stpapi.end.session("ticpr0107m000",error)
    return(FALSE)
 }
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #3  
Old 16th May 2020, 12:37
DDPatel DDPatel is offline
Junior Member
 
Join Date: Dec 2018
Location: India,Gujarat,Umbergaon 396150
Posts: 14
DDPatel is on a distinguished road
Baan: LN10.3 and LN10.4 - DB: SQL SERVER 2008 R2 - OS: WINDOW SERVER 2008 R2
Quote:
Originally Posted by bhushanchanda View Post
First thing I would try will be using segmented domain for item -

Code:
stpapi.put.field("ticpr0107m000","ticpr007.item.segment.2", trim$(fn.item))

Also, if you are just updating the cost prices, you don't need to use all the fields. And you will need to do a stpapi.find() to find the correct item. Here's the code you can use -

Code:
function extern domain tcbool calculate.cost.prize.for.item()
{
   domain    tcmcs.str100    error.msg, error

    stpapi.put.field("ticpr0107m000","ticpr007.item.segment.2", trim$(fn.item))
    ret = stpapi.find("ticpr0107m000")
   |** You can add validation if no record found (I've not added it)
    stpapi.form.command("ticpr0107m000", 5, "calculate", error.msg)
        if isspace(error.msg) then
         stpapi.end.session("ticpr0107m000",error)
            return(TRUE)
        endif
    stpapi.end.session("ticpr0107m000",error)
    return(FALSE)
 }
it's working....

I forgot "item.segment" and "find" part in my code....
I faced same issue in many script,Now it's look like all script has been solving...

Thank you Bhushan ji...
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
AFS Not Working sachinbaan AFS/DDC/OLE: Function servers 1 23rd March 2014 18:05
Cost Allocation - Activity Based Costing tapzhou Finance, Invoicing and Integration 4 14th February 2010 01:11
item update through AFS not working under SP25 thieuf AFS/DDC/OLE: Function servers 2 30th July 2009 16:51
Print Picking List AFS not working sbn123 AFS/DDC/OLE: Function servers 4 30th June 2009 20:57
Cost update not working through AFS jmathew AFS/DDC/OLE: Function servers 9 8th July 2005 06:06


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


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