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
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

763 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