Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Macro issue 1

Status
Not open for further replies.

TudorSmith

Programmer
Jan 14, 2002
245
GB
Hi

I am using Macro's to fire off emails when certain conditions arise within Problem Tickets. The issue I have is that the description field I am including in my email is drawn from a memo field (using VB terminology here) and so because the field contains carriage returns and new lines, I get certain ASCII characters in my email.

Here's my Evaluating Expression:
Code:
$L.message={"Description:"+brief.description in $L.new, "Building: "+building in $L.new, "Floor:"+floor in $L.new, "Room:"+room in $L.new, "Reported by:"+first.name.rb in $L.new+" "+last.name.rb in $L.new, "Contact Phone: "+contact.phone in $L.new, "Cost Centre: "+charge.code in $L.new, "Action:"+str(action in $L.new), "", "Email Date/Time Stamp: "+tod(), ""}

The value for action is my issue. here is the output to the email:
Code:
ServiceCenter Operator: WEATHERLEY_F

Description:Sat 23/02/02 - High temperature on Sat 23/02/02 in the above location please could 	
Building: 500
Floor:GROUND
Room:23
Reported by:KAREN ROGERS
Contact Phone: +44 1234 567890

Action:{\"Sat 23/02/02 - High temperature on Sat 23/02/02 in the above location please could 	\", \"you advise customer what happened?\"}

Email Date/Time Stamp: 25/02/2002 10:05:49

Does anyone know how I can strip out the following characters: { \ " }

I am using Service Center 3.0 sp5

Many thanks

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
What I have in place is that instead of creating the message by tacking the fields together in the macro, I created a format for the email. It's a simple format with labels I want and the fields I want in it. Then in the macro, use

$L.message=genout($L.new, &quot;your.email.format&quot;)

This makes the email message look like the format that you state. I use a multitext field for my actions field and it looks fine in emails, doesn't have extra characters or anything like that.
 
I think I've heard about this GENOUT() function. does the format blank after every email, or is it based on a table, that stores the information?

Do you have anymore information?

Regards

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
genout(file, format) will take relevant fields in a file variable that you feed it (in the case of a macro, $L.new) and use the format specified to come up with text.

I guess I don't understand your question. genout does nothing to change the data save in the table, it just creates a big formatted text string. Since you're then setting $L.message equal to its output, that will then be passed into an eventout record.
 
I had the same 'problem'

Its fixable...

Use this in your macro:
$L.message=strrep(strrep(str(substr(str(action in $L.new), 3, val(lng(str(action in $L.new))) - 4)), &quot;\&quot;&quot;, &quot;&quot;), &quot;,&quot;, &quot;\0A&quot;)

Works very good.

Let me know if everything worked out good.

Bye from Germany.
Frank
 
Sorry.. should be...

xxx in $L.message=strrep(strrep(str(substr(str(action in $L.new), 3, val(lng(str(action in $L.new)))- 4)), &quot;\&quot;&quot;, &quot;&quot;), &quot;,&quot;, &quot;\0A&quot;)


For xxx you have to putt YOUR current number of the array in.

Bye
frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top