Put email body into new doc

I am attempting to create ticket functionality so that when one of our support staff receives an email, they can do one of two things (either option works for me):1. Click a button on their Notes UI that grabs the contents of the “Body” field, creates a new notes doc in a different database, and inserts the Body contents.

  1. Click a button in the other database, have it prompt with a picklist, pull the contents of the “body” field based on the item chosen from the picklist and insert into the new document.

I already have lotusscript code that would handle option 1, but I can’t put lotusscript into a Notes UI button (the buttons on the toolbars). Placing the lotusscript into an agent isn’t an option since that would require modifying the mail database design.

For option 2 I’m attempting to figure out how to grab a document unique ID from a picklist choice. I figure that if I can get the unid, I can do a dblookup and pull the field that way.

Thoughts? Suggestions?

Subject: got it…sorta

I put the following commands into a Notes SmartIcon button:

@Command([EditDocument]);

@Command([EditGotoField];“Body”);

@Command([EditSelectAll]);

@Command([EditCopy]);

@Command([EditDocument]);

@Command([Compose];“”:“mydbname”;“formname”);

@Command([EditGotoField];“description”);

@Command([EditPaste])

Seems to do the trick…it grabs the entire body of the email and drops it into the new form.

Subject: but this wouldn’t work…

desc:=@GetField(“Body”);sender:=@GetField(“From”);

@Command([Compose];“”:“dbname”;“formname”);

@SetField(“description”;desc);

@SetField(“callerName”;sender)

Subject: Fields inherit values

There’s a form design option you can use to tell the form to read values from the current document that’s active before you compose, and you can then use those values in field default formulas. There’s also a form option to get a copy of the entire parent document into a rich text field (like when you forward a document).

If that’s not practical for whatever reason, see the @UpdateFormulaContext function.

Alternately, use LotusScript to create your new document in memory before you start to edit it, copy over field values, and use the EditDocument method to start editing it.

Subject: interesting ideas

I hadn’t considered using the inheritance option…it’s certainly an interesting thought. The only annoying part there is that that would require a new form that matched the regular form, except with inheritance checked on and all fields set to initialize at their own values.

That said…the “@UpdateFormulaContext” may do the trick beautifully. I’ll have to play around with that, but it certainly looks like it can be immensely helpful!

Subject: The fields on the inheriting form DO NOT need to match

The default formula for a field can refer to any field name in the parent doc.