jatin_sanghi
29th October 2009, 06:25
Hi All,

can we read non main table fields on form in the dal of the main table of a session.

I want to execute some logic, based on the value i specify in this non table field at the time od saving the record.

regards,

Jatin

rberti
29th October 2009, 13:41
I belive that you can do it, since the table is declared and set in the record you want. It can be done with the query extension functions in before.open.object.set, for exmaple:

function extern long before.open.object.set()
{
query.extend.select("qmptc021.cual")
query.extend.from("qmptc021")
query.extend.where(":qmptc015.algo refers to qmptc021")
}

function extern long qmptc015.algo.check(long has_changed)
{
if has_changed then
tcibd.dll0003.read.mcs001.tccu(qmptc015.chun,
qmptc021.cual, basu.tccu, unit.tccu)
if basu.tccu <> unit.tccu then
dal.set.error.message("qmptcs011526")
|* Algorithm and characteristic units must have the
|* same physical quantity
return(DALHOOKERROR)
endif
endif
}



Hope it helps!

toolswizard
6th November 2009, 18:50
If your non table field is declared as external, then for the dal place a if statment checking for the session name as you would only want the logic to take place for a certain session. Then if it is the correct session, you can import the field.