Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 5 of 5

Thread: Memo in JS?

  1. #1
    Senior Member
    Join Date
    Jun 2007
    Location
    Australia
    Posts
    197

    Default Memo in JS?

    Hey guys,

    I'm trying to email out the content of a Change record, all looks fine except for the output of any memo type fields.
    they come out with a piece of code at the front and soem seperators between each line.

    eg:
    [C++ object Datum] @0x155d6c18 - {"This is test text.", , "second line test text"}

    don't spose there is a neat way of printing out this text?

    Thanks!

  2. #2
    Senior Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    930

    Default

    The "memo" field is of the regulat SCArray type. How are you sending the emails? If you are using a js based script, you might need to "convert" the SCArray to a regular array.

  3. #3
    Senior Member
    Join Date
    Jun 2007
    Location
    Australia
    Posts
    197

    Default

    yeah, sending from JS, setting content and then writting an eventout all in the one neat little script.

    convert you say? will give it a go and report back. thanks!

  4. #4
    Senior Member glg's Avatar
    Join Date
    Aug 2004
    Location
    Chicago, IL, USA
    Posts
    714

    Default

    you just need to pull the lines out of it. easiest I think is to use a for loop, use field.length() to get the length of it, you can reference each line with field[i].

  5. #5
    Senior Member
    Join Date
    Apr 2006
    Location
    United States
    Posts
    178

    Default

    Another option is the following JS code:

    for (x in record.fieldname)
    retstr+=record.fieldname[x];

    and if you want line breaks:

    for (x in record.fieldname)
    retstr+="\n"+record.fieldname[x];

    I was tired of being handcuffed by the notification engine, so I now have an add-on for SM that will allow you to add notification lines to existing notification records without ever looking at the notification record. It's a completely seperate table and allows JS configuration for condition, subject, message, and recipients. At the same time, simple checkboxes determine if it's a page, whether to log an activity record, run in a TEST mode, or disable it altogether. You can even test the notification line as you build it...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts