Predator
24th June 2011, 18:54
Hi,
Can customer defined field apply in program scripts, after compile it prompt error...customer defined field not allowed.
Please advise.
TQ
Mic
ulrich.fuchs
24th June 2011, 19:33
No they cannot be used anywhere besides a form. You can't write them, you can't read them, you can't print them. What's implemented of CDFs so far is completely useless, even if the idea in itself is not bad.
Predator
25th June 2011, 18:26
Hi,
Thank you. Very Good comment.
Mic
kishoremeher
27th June 2011, 06:38
Hi,
U can use customer defind field in a program script in a indirect way. While selecting the table where the customer defind field is used, you need to assign it in a variable and use that variable in place of that customer defined field.
Kishore
kishoremeher
27th June 2011, 06:38
Hi,
U can use customer defind field in a program script in a indirect way. While selecting the table where the customer defind field is used, you need to assign it in a variable and use that variable in place of that customer defined field.
Kishore
JaapJD
27th June 2011, 09:55
Good post of Kishore. Some additions:
- In report scripts you can use them as well, but you cannot use them as print expression. You you need to declare another variable and assign the cdf to it.
- You can use also the get.var and put.var functions to handle them indirectly. Using the put.var you can even update the cdf from a program script.
Example:
string a(20)
db.retry.point()
select tdpur401.*
from tdpur401 for update
where ...
selectdo
a = "some value"
put.var(pid, "tdpur401.cdf_<..>", a)
db.update(ttdpur401, db.retry)
endselect
commit.transaction()
v_kewl
1st July 2011, 07:36
Hi, You Just need to declare CFD fields in your Program scripts and then after you can use that for Read/ Write operations.
E.g;.
Declaration:
|* Below is your new CDF field of type String
extern domain tcmcs.str30 tcibd001.new_C
function read_function()
{
read.tcibd001()
temporary_variable = tcibd001.new_C
}
function write_function()
{
tcibd001.new_C = "Some new Value"
db.update(ttcibd001, db.retry)
commit.transaction()
}
....
Just you need to do is a extra declarion of the field.
--
Gaurav