timb25
1st June 2011, 16:41
Trying to build a User Exit on table tccom124 (business partner - pay to).
I want to update the start date on the pay to business partner with the date of hire from the employee people data table. I was under the assumption (first mistake) that all I needed to do was to set the field and the UE would take over saving the record.

When I debug the script, it does not update the record and the dalhookerror states "Record not modified".
I am fairly new to LN, but not the baan language. Could someone help identify what I'm doing wrong.

Thanks,
-Tim

|**********************************************
|* tccom124ue
|* Script Type: Library
|**********************************************
#include <bic_dal>
table ttccom124
table tbpmdm001
table ttccom001
domain tcdate date.t |Converted date

function extern long ue.after.before.save.object(long mode)
{
on case mode
case DAL_NEW:
break
case DAL_UPDATE:
get.bp.info()
break
endcase
return(0)
}

function extern long ue.after.before.destroy.object()
{
return(0)
}

function get.bp.info()
{
select tccom100.*, bpmdm001.*
from tccom100, bpmdm001
where tccom100._index1 = {:tccom124.ptbp}
and tccom100.lgid refers to bpmdm001
selectdo
convert.date()
tccom124.stdt = date.t
endselect
}

function convert.date()
|* Changing dates from different domains
{long yy, mm, dd, result, hh, nn, ss

result = utc.to.date(tccom124.stdt, yy, mm, dd, hh, nn, ss)
result = num.to.date(bpmdm001.sdte, yy, mm, dd)
date.t = date.to.utc(yy, mm, dd, hh, nn, ss)
}

bdittmar
1st June 2011, 20:40
Trying to build a User Exit on table tccom124 (business partner - pay to).
I want to update the start date on the pay to business partner with the date of hire from the employee people data table. I was under the assumption (first mistake) that all I needed to do was to set the field and the UE would take over saving the record.

When I debug the script, it does not update the record and the dalhookerror states "Record not modified".
I am fairly new to LN, but not the baan language. Could someone help identify what I'm doing wrong.

Thanks,
-Tim

Hello,


|**********************************************
|* tccom124ue
|* Script Type: Library
|**********************************************
#include <bic_dal>
table ttccom124
table tbpmdm001
table ttccom001
domain tcdate date.t |Converted date

function extern long ue.after.before.save.object(long mode)
{
on case mode
case DAL_NEW:
break
case DAL_UPDATE:
get.bp.info()
db.update(ttccom124, db.retry) |Try to do a update here
break
endcase
return(0)
}

function extern long ue.after.before.destroy.object()
{
return(0)
}

function get.bp.info()
{
select tccom100.*, bpmdm001.*
from tccom100, bpmdm001
where tccom100._index1 = {:tccom124.ptbp}
and tccom100.lgid refers to bpmdm001
selectdo
convert.date()
tccom124.stdt = date.t
endselect
}

function convert.date()
|* Changing dates from different domains
{long yy, mm, dd, result, hh, nn, ss

result = utc.to.date(tccom124.stdt, yy, mm, dd, hh, nn, ss)
result = num.to.date(bpmdm001.sdte, yy, mm, dd)
date.t = date.to.utc(yy, mm, dd, hh, nn, ss)
}


Regards