Solved

why append fail?

Posted on 2004-04-27
11
223 Views
Last Modified: 2013-12-18
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?
Thanks.
0
Comment
Question by:damoncwk
  • 3
  • 2
  • 2
  • +3
11 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10931425
FIELD Target := Target : text1 + " " + combo1

~Hemanth
0
 
LVL 15

Accepted Solution

by:
Bozzie4 earned 125 total points
ID: 10931452
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)
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10931463
Damn.  I need to type less or faster :-)

0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 63

Expert Comment

by:Zvonko
ID: 10932393
My proposal:

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

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


0
 
LVL 13

Expert Comment

by:CRAK
ID: 10932794
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).
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10932978
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.


0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10933048
yes.. that was my intention.
0
 

Author Comment

by:damoncwk
ID: 10936621
Hi,
sorry that i am confused where should the FIELD Target := Target : text1 + " " + combo1
be placed.

 
0
 

Author Comment

by:damoncwk
ID: 10936653
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?

Thanks
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10936700
@Text(@Now) + " " + combo1

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10936737
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:
http://www-12.lotus.com/ldd/doc/domino_notes/6.5.1/help65_designer.nsf/855dc7fcfd5fec9a85256b870069c0ab/80f7f6e0b4159e9685256e000049cd38?OpenDocument



0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question