Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why is my text moving to a new line when I enter a space in this field in a Notes Database form?

Posted on 2008-06-18
6
Medium Priority
?
317 Views
Last Modified: 2013-12-18
We have serveral databases experiencing the same issue.  I originally thought it was due to a change in part numbers in which they now contain a space but not sure.  The forms have an "Add Part" button. When we use a space in the part number it wraps to the next line.  The Field is Text, Computed for Display, Allow multiple records, Separate records when user enters Comma, Semicolon and New Line, Display separate Values with New Line. If I use dashes in the part number it works fine.  This isn't my area of expertise.  Not sure if the @Explode and @Implode are part of the issue.  

Here is the code:
@All;
tPartNum := @Prompt([OkCancelEdit]; "Part being returned"; "Enter Part Number"; "");
tPrompt1 := "How many "+ tPartNum + " were shipped?";
tPartsShip := @Prompt([OkCancelEdit]; "Part being returned"; tPrompt1; "");
tPrompt2 := "How many "+ tPartNum+ " are being returned?";
tAdvQty := @Prompt([OkCancelEdit]; "Part being returned"; tPrompt2; "");
tPrompt3 := "At what price were "+ tPartNum+ " sold?";
tUnitPrice := @Prompt([OkCancelEdit]; "Part being returned"; tPrompt3; "");
FIELD PartNum := @If(PartNum = NULL; tPartNum; @Explode(@Implode(PartNum)+@NewLine+tPartNum));
FIELD PartsShip := @If(PartsShip = NULL; tPartsShip; @Explode(@Implode(PartsShip)+@NewLine+tPartsShip));
FIELD AdvQty := @If(AdvQty = NULL; tAdvQty; @Explode(@Implode(AdvQty)+@NewLine+tAdvQty));
FIELD UnitPrice := @If(UnitPrice = NULL; tUnitPrice; @Explode(@Implode(UnitPrice)+@NewLine+tUnitPrice));
@Command([ViewRefreshFields]);
FIELD Restock := SubTot * 0.2;
@Command([ViewRefreshFields])

0
Comment
Question by:mail03lady
  • 3
  • 2
6 Comments
 
LVL 17

Expert Comment

by:fgrushevsky
ID: 21815802
You are correct - @explode seems to be the issue.
From Help:

@Explode( string ; separators )

string
Text. The string that you want to make into a text list.
separators
Text. Optional. One or more characters that define the end of an element in string. The default separators are " ,;" (space, comma, semicolon), which means that Lotus Domino adds a new element to the text list each time a space, comma, or semicolon occurs in the original string.

So when @explode "sees" space, it uses it to separate list entries, and then "Display separate entries with New Line" moves text to another string
0
 
LVL 17

Expert Comment

by:fgrushevsky
ID: 21815828
use @explode(@Implode(PartsShip)+@NewLine+tPartsShip;",;") if coma and semicolon are you separators
0
 

Author Comment

by:mail03lady
ID: 21816526
We got it to work partially using FIELD PartNum := @If(PartNum = NULL; tPartNum; PartNum+@NewLine+tPartNum); which works for the first and second time we use the Add button.  The third time it list:
Item 1
Item 3
Item 2
Item 3
Now we need to figure out how to handle more than two items.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mail03lady
ID: 21824437
Thanks for your comments:  We think we have a resolution.  We changed the line: FIELD PartNum := @If(PartNum = NULL; tPartNum; @Explode(@Implode(PartNum)+@NewLine+tPartNum));

To:  FIELD PartNum := @If(PartNum = NULL; tPartNum; @Explode(@Implode(PartNum;@NewLine)+@NewLine+tPartNum;@NewLine));
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 21832283
I could be mistaken, but you've got some might strange coding there... It seems like the original developer didn't know his Formula language.

This piece of code seems rather silly to me:
   @Explode(@Implode(PartNum)+@NewLine+tPartNum)

Could you try to replace it by:
   Partnum:tPartNum

The colon is the operator in Formula language to concatenate lists and elements into lists.
0
 

Author Closing Comment

by:mail03lady
ID: 31468506
Streamlined our solution
0

Featured Post

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.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

824 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