why append fail?

Hi All,
I tried to append the value of two fields(text and combobox)
to another text field with the following

@SetField("target"; text1 + " " + combo1)

there are no error message while the target text field
still contain empty string. Moreover how can I append
the text of text1 and combo1 to the target text field
rather than overwrite it?
Who is Participating?
Bozzie4Connect With a Mentor Commented:
The field, target, should be "computed" and the formula should be :

text1+" "+combo1

That's it.

To append, do this (make it multivalue first)

@unique(@trim(@thisvalue:(text1+" "+combo1))

If you use R5, it's :

@unique(@trim(text:(text1+" "+combo1))

However, if it's a computed field, the value will append to itself a lot of times, so you probably only want to do the calculation on document save.  You can then put this formula in the querysave:

FIELD text := @unique(@trim(text:(text1+" "+combo1));

OR use this (in the computed field)

@if(@isdocbeingsaved;@unique(@trim(@thisvalue:(text1+" "+combo1));@thisvalue)
FIELD Target := Target : text1 + " " + combo1

Damn.  I need to type less or faster :-)

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

ZvonkoSystems architectCommented:
My proposal:

@SetField("target"; target + " " + text1 + " " + @Implode(combo1));

The @Implode is only necessary if your combo1 can have multiple values.

Bozzie is right: is it a computed field?
Default values of editable fields only get computed when new doc's are first created. That goed for computed when composed too!

Make sure that no other events write that field and check prior to / after save and/or refresh (F9).
Hi HemanthaKumar,
> FIELD Target := Target : text1 + " " + combo1

I am SURE you meant FIELD Target := Target : (Text1 + " " + combo1)
BUT damoncwk probably intents "append" to mean "concatenate the text as a single string" not "create a text list."  In that case, it should be FIELD Target := Target + " " + text1 + " " + combo1

I assume the question being asked in not "why append fail" -- meaning failure message, but "why do I lose the old value when I append new ones."  If the operation completely fails -- either no change, or result is completely blank, or there is an error message -- then we need more information before we can help.

yes.. that was my intention.
damoncwkAuthor Commented:
sorry that i am confused where should the FIELD Target := Target : text1 + " " + combo1
be placed.

damoncwkAuthor Commented:
when i try to do the following it failed
@Now + " " + combo1

if i make it text1 + " " + combo1 then it did get started
is there any conversion i need to do for the @Now function?

ZvonkoSystems architectCommented:
@Text(@Now) + " " + combo1

ZvonkoSystems architectCommented:
You can define the format of the date and time you want to have for the @Text() conversion.

This formula:
@Text(@Now;"D0S0") + " " + combo1

Yields this text:
28.04.2004 The Option

Here is the date conversion format description:

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.