simpson
2nd May 2007, 17:51
When we have a text field in a table which is the maintable of the session we can delete the textfield by delete all characters of the text.
When we do the same on a textfield which is not a field of the maintable then the textnumber still exists after deleting all text characters.
How can we solve this problem?
Thank You
Simpson
learner
2nd May 2007, 17:59
Hi,
If i have understood your question then you would like to DELETE a text field of a diff. table other than your main table via Programming script.
Assuming you have a session on tdsls400 sales Order header where in
tdsls400 is your M.Table and now u r also accessing tdsls401 ( sales order line ) table in your P.Script and you would like to delete the text present in tdsls401 even though its not ur main table.
i guess you can use standard function to achieve the same
long text.delete( string text_field(17), string lang )
just pass the name of the text field as first arguement to this function i.e. tdsls401.txta and that should ideally solve your issue. also your User language.
Regards
Learner
simpson
2nd May 2007, 20:11
HI Learner,
Thank you for your answer.
Assume main table is tdsls400.
There is a text field in tdsls401.
The user deleted all the characters of the text. So the the text is empty.
If tdsls401 was the main table then the value of the text field in tdsls401 would be zero. BaaN does this automatically.
Now tdsls401 is not the main table. We empty the text. And nothing happens automatically. How do we put the value zero in the text field? How do we know that the user deleted all the characters of the text.
Thank you for assisting
Simpson
en@frrom
3rd May 2007, 13:08
I haven't tried to update test fields of different tables in standard functionality, however, if your problem is testing the user's input, then that's not difficult..
Example:
domain tcbool txt.empty
domain tcmcs.long ret, i
domain tcmcs.str132 txt.sls401(100)
txt.empty = true
ret = set.mem(txt.sls401, "")
ret = text.to.buf("tdsls401.txta", "1", 100, txt.sls401)
for i = 1 to 100
if not isspace(txt.sls401(1,i)) then
txt.empty = false
i = 100
endif
endfor
if empty then
ret = text.delete(tdsls401.txta, "")
endif
Hope this helps...
Regards,
Eli Nager
simpson
4th May 2007, 17:30
Hi,
Thanks a lot for giving me a quickly answer for this problem. Because the purchase text was not a field of the main table of the specific program, I had to program it myself for deleting text and creating text. The text tables(tttxt001, tttxt002 and tttxt010) were updated automaticly, the pointer in the purchase table(text number in tdipu001) was not.
Kind regards,
Simpson