Regex expression to replace watermark 'Ref:MSG4933059_WCGfhSStyWyW2H046QN1' with null or empty

Priya Bonam
Tera Expert

I want to remove the watermark from the scheduled mail report.

Tried with this however '_WCGfhSStyWyW2H046QN1' is getting generated in report

Before insert BR for sys_email table.

current.body = String(current.body).replace(/Ref\:MSG(?:[0-9]*)/i,"");
current.body_text = String(current.body_text).replace(/Ref\:MSG(?:[0-9]*)/i,"");

 

Pleas suggest regex exp to clear this watermark.

 

 

1 ACCEPTED SOLUTION

Priya Bonam
Tera Expert

current.body = String(current.body).replace(/Ref\:MSG(?:[0-9]*)/i,"").replace(/_/g, "").replace(/\d[a-zA-Z]{2,10}.*\d[a-zA-Z]{2,10}/,"");

current.body_text = String(current.body_text).replace(/Ref\:MSG(?:[0-9]*)/i,"").replace(/_/g, "").replace(/\d[a-zA-Z]{2,10}.*\d[a-zA-Z]{2,10}/,"");

it worked for me.

View solution in original post

4 REPLIES 4

Sagar Pagar
Tera Patron

Hi,

Have you tried with omit watermark check box.

 

Thanks,

Sagar Pagar 

The world works with ServiceNow

Priya Bonam
Tera Expert

There is no field on the scheduled email of report.Please suggest

Priya Bonam
Tera Expert

current.body = String(current.body).replace(/Ref\:MSG(?:[0-9]*)/i,"").replace(/_/g, "").replace(/\d[a-zA-Z]{2,10}.*\d[a-zA-Z]{2,10}/,"");

current.body_text = String(current.body_text).replace(/Ref\:MSG(?:[0-9]*)/i,"").replace(/_/g, "").replace(/\d[a-zA-Z]{2,10}.*\d[a-zA-Z]{2,10}/,"");

it worked for me.

Hi Priya,

 

It did not work for me.

After executing the report. The watermark is removed.

However, when the user replies from the email report, the watermark is available again.