Premahari
23rd May 2018, 14:44
Hi i have created one session for creating NCMR through AFS. IN that Session qmncm100.nctx(text field) is mandatory field while creating NCMR report. When i start my session, through form filter iam passing severity, symptoms,everything.But text field i'm passing is taken as 0. Can anyone please help. I have shared my code and image of form filter.

Premahari
23rd May 2018, 15:03
Hi i have shared the image of form filter where i'm passing the text values.

mark_h
23rd May 2018, 15:20
I am assuming you are referring to a real text field and not just a field defined as a string. I do not think you can create text via AFS using that method. I would create the record without text - then attach text using something like in this post http://www.baanboard.com/baanboard/showthread.php?t=66424&highlight=text. You can search the AFS forum on text to see what else you can find. Also since this is basically AFS question going to move this thread.

Premahari
23rd May 2018, 15:36
Hi Thanks for your reply. Can u please tell Is there any other way for passing text through AFS(not through form filter). Because I said i'm Going to create NCMR report through AFS, where text field is mandatory. Can u show me some example where passing text through AFS in some other ways.

mark_h
23rd May 2018, 23:25
There is no way I know of to pass text thru AFS that I am aware of. I have a lot of AFS sessions - but nothing even involved with text. On all of my other normal sessions I actually write the text to a file then use text.read to create it on the table. Something like below (in this case I am just copying standard type text to a few other tables).


function create.text(domain tcmcs.str16 some.field)
{
string temp.file1(500)
string kw1(17),kw2(17),kw3(17),kw4(17),tgrp(8),eopt(15)
long write.return, ret.code

temp.file1 = creat.tmp.file$(bse.tmp.dir$())
temp.file1 = strip$(temp.file1)
write.return = text.read("tdudi010.txtn", "2", kw1, kw2, kw3, kw4, tgrp, eopt, temp.file1, 0)
db.retry.point()
on case zoom.prog
case "tdpur4101m000":
db.eq(ttdpur040,db.delayed.lock)
break
case "tdpur1101m000":
db.eq(ttdpur001,db.delayed.lock)
break
case "tdexi0109m000":
db.eq(ttdexi001,db.delayed.lock)
break
endcase
write.return = text.write(some.field, "2", kw1, kw2, kw3, kw4, "purchase", "", temp.file1)
on case zoom.prog
case "tdpur4101m000":
db.update(ttdpur040,db.retry)
break
case "tdpur1101m000":
db.update(ttdpur001,db.retry)
break
case "tdexi0109m000":
db.update(ttdexi001,db.retry)
break
endcase
commit.transaction()
file.chmod(temp.file1,S_IRWXU)
ret.code = seq.unlink(temp.file1)
}