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
308 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 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