Memo Line Break


Badge +3

Is it possible to add a line break to the memo field using smart forms or some sort of experssion?  Also it seems like memo has a limit to it. Can this be made any larger?

 


10 replies

Badge +5

Hi there Julio11,


 


First, may I ask where you are looking for this functionality and where you are seeing the limit on the memo field (Blackpearl/smartforms version and scenario background)? Sometimes functionality depends ont he version of K2 you are running so I want to be sure to give you relevant information.


 


Thanks!


-S


 

Badge +3

Hi Savannah,

 

I am looking for this functionality on my view. I want to create a view that captures the comment entries along with the time and user who entered them. I have that working properly but to make it more user friendly I would like to have it broken down as follows:

 

2014-05-12 @ 07:16:33Z By Julio11

This is my first comment....

 

2014-05-12 @ 08:16:33Z By Julio11

This is my second comment....

 

Is this possible without having to use a list view? Currently I am using a list view but I want to use a single memo section to make it user friendly. I am using the following: K2 Blackpearl 4.6.7 and K2 SmartForms 1.0.6. Thanks for following up.

Badge +3

Hi K2 Community,

 

Just wanted to update this. I was unable to find a line break action through k2. So what I ended up doing was writting a sproc that is kicked off and saves the item into the database with a line break. This makes comments in the Memo field easier to read.

 

Thanks

Badge +4

Really, there is no way to add a new line/carriage return in a memo field using an expression? I am running SmartForms version 1.0.6 

Badge +7

You can use the fix I did here:  XML Fix

 

You can either create a data label with the XML carriage return or you can probably put it into an expression.

Badge +4

Thanks daerne!

 

Placing the XML code 
 in a data label did the trick. I was then able to use the data label in an expression. (Putting the XML code directly in an expression does not work.)

Badge +7

Nice.

 

I knew the data label could handle it, but hadn't experiemented with the expression.  Bascially I'm finding out you can put some XML or Javascript into some of the controls that can handle that type of data.

 

For example, I modified the hyperlink control that when clicked it can show go into a print mode and display your printers by putting in javascrit into an expression that is tied to it:  

10853i6D40C86700F2E024.png

Badge +4

The trick of putting XML code 
 in a DataLabel and then using the DataLabel in an expression no longer works in the newer SmartForms versions. (4.6.10)

 

Anyone have any other ideas for a workaround?

 

Seems like we need a Newline option under Text in the expression builder, like there is for Empty String...

Badge +4

Here's what I ended up doing. If anyone has a better idea please post it.

 

1) created a new SmartObject called SpecialTextValues in the SmartForms Designer and added a Value field of type memo.

2) Using SSMS added a carriage return and line feed directly into the Value column in the SpecialTextValues table in the K2 database using the SQL Set Value = CHAR(13) + CHAR(10). (I tried creating a SmartForms View for this, but curiously if you enter just a single return in a TextArea control, the value of field is completely ignored on save. That is whatever text was there previously will remain after the save.)

3) On Form/View initialize execute the load method of the new SmartObject to load the value into a DataLabel control of type memo.

4) You can now use the DataLabel control in expressions to add a new line.

Badge

Regarding adding a line break to a memo field. I solved a similar problem using just expressions and it is still working under 4.6.11. I used the operators/text/url_decode function. This is intended for decoding url strings (obviously), but seems to work for this situation as well. Example:

12110iB76F43043CB9ECCB.png

 

Reply