Kinetic, Application Studio, Events, string edit before display?

this sounds like it should be easy, but…

I recently learned from support that if I want to format a text/message when displaying a slideout, I need to use <br> to cause line breaks (some people have been able to use \r\n but this does not work for me).

my situation is when a customer is specified or changed on an order, I check the Customer.Comment field and if there is content display the comment in a slideout.

problem is alot of these comments contain \r\n for line breaks, not <br> as I need for Kinetic.

I can’t really update the comments in the database because we are split between classic ui and kinetic web ui, so for classic I need \r\n.

I would like to be able to do a string replace after grabbing the comment from the database and before displaying it in the slideout.

So far I haven’t figured out what widget to use and how to go about it

thx, Scott

You’ll need to write a function to do the replace and send the comment back.
I have a function library for helper functions like that or splitting strings, etc.

I suppose you could write some JavaScript in the Row-Update expression field, but Brian has said those expression fields are being sandboxed heavily at some point, so I’m not sure how long that solution will last. The function should be more robust.

ok, yeah, that’s the one solution I had, but was just hoping for something a little cleaner.

like your idea of a separate library for little utility functions like that,
for example in this case I could have a function that takes the string, what to replace, and with what.

thanks, Scott

You’re probably gonna end up with a nice little library before all this is said and done.

Unless we can get @hmwillett to share hers…

@hmwillett … If it needs cleaning up, I hereby volunteer. :rofl:

Ben Stiller Smiling GIF by 20th Century Fox Home Entertainment

homer simpson GIF