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
304 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
Comment Utility
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
Comment Utility
use @explode(@Implode(PartsShip)+@NewLine+tPartsShip;",;") if coma and semicolon are you separators
0
 

Author Comment

by:mail03lady
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:mail03lady
Comment Utility
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
Comment Utility
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
Comment Utility
Streamlined our solution
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now