rogierverkaik
25th July 2016, 17:56
I table bptmm111 (Project and General Hours/Expenses) I've added a new CDF field with data type "date". I want to have this new field being filled in with the date of creation:
function extern long ue.after.before.save.object(long mode)
{
on case mode
case DAL_NEW:
bptmm111.cdf_endt = utc.num()
break
case DAL_UPDATE:
break
endcase
return(0)
}
But the new CDF field stays empty when saving a new record. Do you know why it remains empty?
mark_h
25th July 2016, 21:09
I found this thread http://www.baanboard.com/baanboard/showthread.php?t=59987&highlight=user+exit+dal not sure if it helps. Actually I was wondering if the table was declared like in that example.
bhushanchanda
26th July 2016, 08:03
Hi,
Did you tried writing your code in ue.before.before.save.object()?
Also, check if put.var() works.
e.g.put.var(pid, "tdsls401.cdf_xyz", value)
Not sure which version and porting set are you on. There have been number of enhancements done to CDF.
rogierverkaik
29th July 2016, 15:19
I found this thread http://www.baanboard.com/baanboard/showthread.php?t=59987&highlight=user+exit+dal not sure if it helps. Actually I was wondering if the table was declared like in that example.
Thanks for the extra information. The table is declared with the following code:
table tbptmm111
rogierverkaik
29th July 2016, 15:23
Hi,
Did you tried writing your code in ue.before.before.save.object()?
Also, check if put.var() works.
e.g.put.var(pid, "tdsls401.cdf_xyz", value)
Not sure which version and porting set are you on. There have been number of enhancements done to CDF.
Yes, I also tried it in the ue.before.before.save.object(). In both cases I debugged the user exit, and in both cases the user exit is being triggered, but the data, in this case the utc time is not inserted into the CDF field.
We are using porting set 8.9.a.01.
Let me try put.var(pid, "tdsls401.cdf_xyz", value)
bhushanchanda
29th July 2016, 15:52
Hi,
What is the field type here? I don't think we have a date time field type in the CDF. You can try using string and then use sprintf$() to insert the values. Or, just try using date/numeric format.
Ajesh
31st July 2016, 12:04
I have read I one of the thread regarding CDF.Just try declaring the CDF in the DAL as an extern field
Something like this.
extern. tfgld.date. bptmm111.cdf_endt
rogierverkaik
2nd August 2016, 10:56
For some reason this assignment is now working! Maybe I had forgot to restart ERP LN last time :confused:
case DAL_NEW:
bptmm111.cdf_endt = utc.num()
break