Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Distribution, Transportation & Warehousing

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
29%
500 - 800 GB
3%
800 - 1200 GB
8%
1200 - 1500 GB
8%
1500 - 2000 GB
12%
> 2000 GB
23%
Total votes: 77

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th February 2008, 00:21
rmloduchowski rmloduchowski is offline
Junior Member
 
Join Date: Mar 2006
Location: Warsaw, Poland
Posts: 4
rmloduchowski is on a distinguished road
Baan: 4c, 6.1 - DB: oracle, db2 - OS: sun
Angry tdsls401.disc in DAL method - always 0 value
Baan: ERP LN 6.1

Hello,

i can't set disc value(tdsls401.disc), when i try to create new line in DAL method

my code:
Code:
...
dal.new.object("tdsls401")
dal.set.field("tdsls401.orno", orno)
dal.set.field("tdsls401.item", item)
dal.set.field("tdsls401.qoor", qoor)
dal.set.field("tdsls401.pric", tdisa001.pris)
dal.set.field("tdsls401.disc", disc)
and order and line is creating but there is 0 value in disc field. i have tried to set like this:
Code:
dal.set.field("tdsls401.disc(1)", disc)
and set tdsls401.dorg filed
and no success :-(
please help!!!!
Reply With Quote
  #2  
Old 19th February 2008, 09:48
Andreas's Avatar
Andreas Andreas is offline
Senior Member
 
Join Date: Nov 2001
Location: Hannover
Posts: 263
Andreas is on a distinguished road
Baan: ERP LN FP5 - DB: Oracle 10g - OS: AIX, SLES
Quote:
Originally Posted by rmloduchowski View Post
and order and line is creating but there is 0 value in disc field. i have tried to set like this:
Code:
dal.set.field("tdsls401.disc(1)", disc)
and set tdsls401.dorg filed
and no success :-(
please help!!!!
Hi rmloduchowski,

have you defined your disc variable as array with depth 5?
If not, then try it.

Andreas
__________________
Jazz is not dead, it just smells funny!
F.Z.
Reply With Quote
  #3  
Old 19th February 2008, 14:42
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 438
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Post

Hi,

the correct call is something like this.

Code:
      |for discount 1
      dal.set.field("tdsls401.disc", disc, 1)
      ...

or 
     for i = 1 to ...
        dal.set.field("tdsls401.disc", disc(i), i)
     endfor
__________________
May the force be with you!
Reply With Quote
  #4  
Old 20th February 2008, 06:26
dharam.dv dharam.dv is offline
Member
 
Join Date: Jul 2007
Posts: 56
dharam.dv is on a distinguished road
Baan: LN 6.1 - DB: SQL - OS: Windows,unix
Check Dimensions

if you have declared 'disc' variable as Array then you need to write

dal.set.field("tdsls401.disc(1)", disc(1))

Regards
dharam
Reply With Quote
  #5  
Old 20th February 2008, 23:08
rmloduchowski rmloduchowski is offline
Junior Member
 
Join Date: Mar 2006
Location: Warsaw, Poland
Posts: 4
rmloduchowski is on a distinguished road
Baan: 4c, 6.1 - DB: oracle, db2 - OS: sun
No success - dal.save.object reset values

Andreas, dharam.dv, vahdani - Thank you for help!

Until now i have tried to do this:
Code:
domain tcdisc disc.t
disc.t = 1
dal.set.field("tdsls401.disc", disc.t,1)
line added but with 0 disc. Debbuger before saving object shows that tdsls401.dis(1) = 1 but after
Code:
dal.save.object("tdsls401")
says that Array tdsls401.disc is empty

i have tried another one:
Code:
domain tcdisc discs(11)
long i
discs(1) = 1
for i = 2 to 11
discs(i) = 0
endfor for i = 1 to 11
dal.set.field("tdsls401.disc", discs,i)
endfor
no success :-(

I think that it may be a field dependence(tdsls401.dorg, tdsls401.dmth??). I put values(like in manual order with discount) but no success.

Have you any other ideas
__________________
--------
Rafal
Reply With Quote
Sponsored Links
  #6  
Old 21st February 2008, 06:48
dharam.dv dharam.dv is offline
Member
 
Join Date: Jul 2007
Posts: 56
dharam.dv is on a distinguished road
Baan: LN 6.1 - DB: SQL - OS: Windows,unix
Try this

Hello Rafel,

dal.set.field() if it is not working. you can try
tdsls401.disc(1) = disc

then write dal.save.object()

Regards
Dharam
Reply With Quote
  #7  
Old 23rd February 2008, 14:32
rmloduchowski rmloduchowski is offline
Junior Member
 
Join Date: Mar 2006
Location: Warsaw, Poland
Posts: 4
rmloduchowski is on a distinguished road
Baan: 4c, 6.1 - DB: oracle, db2 - OS: sun
Unhappy

Dharam,
thaks for idea.

i have inserted
tdsls401.disc(1) = 4
as you wrote before dal.save.object, but it behaves as earlier just the same - dal.save object() resets the values of
tdsls401.disc
tdsls401.dorg
tdsls401.dmth

(i see it in debugger)

i think it's field dependence and validate/check method in DAL script. I do not have sources so i can't check what is require to insert discount value in line order in DAL. Maybe it is possible to see the description of the dal script for tdsls401.

Last possibility is to save dal object and after then select the record and update discount by db.* methods. But what for is DAL?

Have you any ideas how to insert sales line order with discount?
Best Regards
Rafal
__________________
--------
Rafal
Reply With Quote
  #8  
Old 25th February 2008, 09:16
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 438
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi Rafal,

I agree with you, this is apparantly caused by the field dependancies. When entering a new position the discounts are reset to default. I haven't tried it by this may work: Try opening the position after insert to change the discounts.

Code:
     dal.new.object("tdsls401")
     dal.new.object("tdsls401")
     dal.set.field("tdsls401.orno", orno)
     dal.set.field("tdsls401.item", item)
     dal.set.field("tdsls401.qoor", qoor)
     dal.set.field("tdsls401.pric", tdisa001.pris)
     ret = dal.save.object("tdsls401")
     if ret = 0 then
            select  *
            from    tdsls401 for update
            where  orno = :tdsls401.orno
            and     pono = :tdsls401.pono
            and     seqn = :tdsls401.seqn
            selectdo
                     dal.change.object("tdsls401")
                     dal.set.field("tdsls401.disc", disc, 1)
                     ...
                     ret = dal.save.object("tdsls401")
            endselect
            
            commit.transaction()
     else
            abort.transaction()
            dal.show.errormessages()
     endif
__________________
May the force be with you!
Reply With Quote
  #9  
Old 2nd March 2008, 14:14
rmloduchowski rmloduchowski is offline
Junior Member
 
Join Date: Mar 2006
Location: Warsaw, Poland
Posts: 4
rmloduchowski is on a distinguished road
Baan: 4c, 6.1 - DB: oracle, db2 - OS: sun
Quote:
Originally Posted by vahdani View Post
Hi Rafal,

I agree with you, this is apparantly caused by the field dependancies. When entering a new position the discounts are reset to default. I haven't tried it by this may work: Try opening the position after insert to change the discounts.

Code:
     dal.new.object("tdsls401")
     dal.new.object("tdsls401")
     dal.set.field("tdsls401.orno", orno)
     dal.set.field("tdsls401.item", item)
     dal.set.field("tdsls401.qoor", qoor)
     dal.set.field("tdsls401.pric", tdisa001.pris)
     ret = dal.save.object("tdsls401")
     if ret = 0 then
            select  *
            from    tdsls401 for update
            where  orno = :tdsls401.orno
            and     pono = :tdsls401.pono
            and     seqn = :tdsls401.seqn
            selectdo
                     dal.change.object("tdsls401")
                     dal.set.field("tdsls401.disc", disc, 1)
                     ...
                     ret = dal.save.object("tdsls401")
            endselect
            
            commit.transaction()
     else
            abort.transaction()
            dal.show.errormessages()
     endif

hi vahdani,
i do as you wrote, but it behaves the same - dal.save.object in update case is reseting tdsls401.disc array :-(

i don't know how to find field dependencies... someone knows?

regards
Rafal
__________________
--------
Rafal
Reply With Quote
  #10  
Old 3rd March 2008, 08:32
dharam.dv dharam.dv is offline
Member
 
Join Date: Jul 2007
Posts: 56
dharam.dv is on a distinguished road
Baan: LN 6.1 - DB: SQL - OS: Windows,unix
use dal.new instead of dal.new.object

Hi rafel,

use dal.new() instead of dal.new.object() and dal.save.object(). In the parameters of dal.new we have Property_Check. here we need to give Property check yes/no. put the value of it as NO. then try to insert the data. Whenever we are putting this Property check as NO then it wont check the Property Hooks which is present in DAL Script of table. but the Disadvantage of using this is by mistake User can enter invalid data also. So be careful using this.

Thanks & Regards
Dharam
Reply With Quote
  #11  
Old 3rd March 2008, 11:29
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 438
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi Rafal,

apparantly non manual discounts are reset by the DAL. please set the discount origin (tdsls401.dorg) to manual for the discounts that you enter per program:
Code:
     dal.new.object("tdsls401")
     dal.set.field("tdsls401.orno", orno)
     dal.set.field("tdsls401.item", item)
     dal.set.field("tdsls401.qoor", qoor)
     dal.set.field("tdsls401.pric", tdisa001.pris)
     dal.set.field("tdsls401.disc", disc, 1)
     dal.set.field("tdsls401.dorg", tdgen.dorg.manual, 1)
     ...
     ret = dal.save.object("tdsls401")
__________________
May the force be with you!
Reply With Quote
  #12  
Old 18th October 2019, 10:25
tmannais's Avatar
tmannais tmannais is offline
Senior Member
 
Join Date: Jul 2017
Location: Thailand, Bangkok
Posts: 220
tmannais is on a distinguished road
Baan: LN 10.5, 10.6, 10.7 - DB: MSSQL - OS: Windows
Quote:
Originally Posted by vahdani View Post
Hi Rafal,

apparantly non manual discounts are reset by the DAL. please set the discount origin (tdsls401.dorg) to manual for the discounts that you enter per program:
Code:
     dal.new.object("tdsls401")
     dal.set.field("tdsls401.orno", orno)
     dal.set.field("tdsls401.item", item)
     dal.set.field("tdsls401.qoor", qoor)
     dal.set.field("tdsls401.pric", tdisa001.pris)
     dal.set.field("tdsls401.disc", disc, 1)
     dal.set.field("tdsls401.dorg", tdgen.dorg.manual, 1)
     ...
     ret = dal.save.object("tdsls401")
I have been looking for a solution to this problem.
This does solve the issue.
Thank you.
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
BOI Continue Method mozila Open World, Portal & Decision Manager 1 16th February 2008 07:20
No Steps Defined for this payment method Error. metropoj Finance, Invoicing and Integration 2 13th December 2007 20:40
Dal & Gtm bigjack Tools Development 0 27th December 2006 12:05
save data / dal / commit.transaction baanconsultant Tools Development 14 14th October 2005 10:01
DAL activation srinivas Tools Development 5 2nd January 2003 08:07


All times are GMT +2. The time now is 01:08.


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