• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to link more than one variable to the e-mail text?

New Here ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Hi, not sure why it does not work.

If think it's a simple question, but I can't find a solution on how to include more than one variable-set into the e-mail text...

The action button works, if I have either "Datenpflege" or "Schriftverkehr" in the script. But it doesn't work when I have both in the script.

var

Datenpflege=""; 

var c1 = this.getField("Mietvertrag").valueAsString!="Off"; 

var c2 = this.getField("Kündigung").valueAsString!="Off";

var c3 = this.getField("Nachtrag").valueAsString!="Off";

var c4 = this.getField("Laufzeit").valueAsString!="Off";

var c5 = this.getField("Indexmiete").valueAsString!="Off";

var c6 = this.getField("Umsatzmiete").valueAsString!="Off";

var c7 = this.getField("Staffelmiete").valueAsString!="Off";

var c8 = this.getField("Sonstiges").valueAsString!="Off";

var c9 = this.getField("Korrektur").valueAsString!="Off";

if (c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Mietvertrag";

else if (!c1 && c2 && !c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Kündigung";

else if (!c1 && !c2 && c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Nachtrag";

else if (!c1 && !c2 && !c3 && c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Laufzeit";

else if (!c1 && !c2 && !c3 && !c4 && c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Indexmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && c6 && !c7 && !c8 && !c9) Datenpflege= "Umsatzmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && c7 && !c8 && !c9) Datenpflege= "Staffelmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 && c8 && !c9) Datenpflege= "Sonstiges";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 &&!c8 && c9) Datenpflege= "Korrektur";

var mySubject=this.getField("FirmaNr").value+"//"+this.getField("ObjNr").value+"//Stammdaten Vermietungsverträge//"+Datenpflege;

var

Vertragsprüfung=""; 

var k1 = this.getField("erforderlich").valueAsString!="Off";

var k2 = this.getField("nerforderlich").valueAsString!="Off"; 

if (k1 && !k2)Vertragsprüfung= "Für das weitere Vorgehen ist eine iMS Vertragsprüfung erforderlich.";

else if (!k1 && k2)Vertragsprüfung= "Für das weitere Vorgehen ist keine iMS Vertragsprüfung erforderlich.";

var

Schriftverkehr=""; 

var t3 = this.getField("Schriftverkehr").valueAsString!="Off"; 

if (t3)Schriftverkehr= "Vom DM-Team wurde Schriftverkehr am iMS Vertrag, unter der Vertragsnummer ("+this.getField("Vtg-Nr").value+") hinterlegt.";

else if (!t3)Schriftverkehr= "Es wurde kein Schriftverkehr am iMS Vertrag hinterlegt.";

var

body='Hallo'+this.getField("MitarbeiterPM").value+',\n\nanbei erhalten Sie Ihren bearbeiteten Antrag zurück.'+Vertragsprüfung+'Bitte entnehmen Sie den Bearbeitungsstatus aus dem Dokument. Gegebenenfalls fallen für Sie hieraus weitere Arbeitsschritte an.\n'+Schriftverkehr+'\n\nBeste Grüße,\n\nIhr Datenmanagement-Team';

this.mailDoc(false,"","","",mySubject,body)

TOPICS
Acrobat SDK and JavaScript

Views

466

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Change the name of the variable Vertragsprüfung to Vertragspruefung.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

still not working

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

It's no good changing your code and saying it's not working. We can't see what you've done. Please repost the changed code, and any error messages in the console. Also please don't just say "not working", please say what you expect, and what actually happens.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Sry, it's my first java script...
There is no error message, but if I click the action button, nothing happens, it's expected that an e-mail opens instead.


var

Datenpflege=""; 

var c1 = this.getField("Mietvertrag").valueAsString!="Off"; 

var c2 = this.getField("Kündigung").valueAsString!="Off";

var c3 = this.getField("Nachtrag").valueAsString!="Off";

var c4 = this.getField("Laufzeit").valueAsString!="Off";

var c5 = this.getField("Indexmiete").valueAsString!="Off";

var c6 = this.getField("Umsatzmiete").valueAsString!="Off";

var c7 = this.getField("Staffelmiete").valueAsString!="Off";

var c8 = this.getField("Sonstiges").valueAsString!="Off";

var c9 = this.getField("Korrektur").valueAsString!="Off";

if (c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Mietvertrag";

else if (!c1 && c2 && !c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Kündigung";

else if (!c1 && !c2 && c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Nachtrag";

else if (!c1 && !c2 && !c3 && c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Laufzeit";

else if (!c1 && !c2 && !c3 && !c4 && c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Indexmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && c6 && !c7 && !c8 && !c9) Datenpflege= "Umsatzmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && c7 && !c8 && !c9) Datenpflege= "Staffelmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 && c8 && !c9) Datenpflege= "Sonstiges";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 &&!c8 && c9) Datenpflege= "Korrektur";

var mySubject=this.getField("FirmaNr").value+"//"+this.getField("ObjNr").value+"//Stammdaten Vermietungsverträge//"+Datenpflege;

var

Vertragspruefung=""; 

var k1 = this.getField("erforderlich").valueAsString!="Off";

var k2 = this.getField("nerforderlich").valueAsString!="Off"; 

if (k1 && !k2)Vertragspruefung= "Für das weitere Vorgehen ist eine iMS Vertragsprüfung erforderlich.";

else if (!k1 && k2)Vertragspruefung= "Für das weitere Vorgehen ist keine iMS Vertragsprüfung erforderlich.";

var

Schriftverkehr=""; 

var t3 = this.getField("Schriftverkehr").valueAsString!="Off"; 

if (t3)Schriftverkehr= "Vom DM-Team wurde Schriftverkehr am iMS Vertrag, unter der Vertragsnummer ("+this.getField("Vtg-Nr").value+") hinterlegt.";

else if (!t3)Schriftverkehr= "Es wurde kein Schriftverkehr am iMS Vertrag hinterlegt.";

var

body='Hallo'+this.getField("MitarbeiterPM").value+',\n\nanbei erhalten Sie Ihren bearbeiteten Antrag zurück.'+Vertragspruefung+'Bitte entnehmen Sie den Bearbeitungsstatus aus dem Dokument. Gegebenenfalls fallen für Sie hieraus weitere Arbeitsschritte an.\n'+Schriftverkehr+'\n\nBeste Grüße,\n\nIhr Datenmanagement-Team';

this.mailDoc(false,"","","","",mySubject,body)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Let's check : do you know how to check the console? No error message will pop up, as many people expect.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Uncaught TypeError: this.getField is not a function

var

Datenpflege=""; 

var c1 = this.getField("Mietvertrag").valueAsString!="Off"; 

var c2 = this.getField("Kündigung").valueAsString!="Off";

var c3 = this.getField("Nachtrag").valueAsString!="Off";

var c4 = this.getField("Laufzeit").valueAsString!="Off";

var c5 = this.getField("Indexmiete").valueAsString!="Off";

var c6 = this.getField("Umsatzmiete").valueAsString!="Off";

var c7 = this.getField("Staffelmiete").valueAsString!="Off";

var c8 = this.getField("Sonstiges").valueAsString!="Off";

var c9 = this.getField("Korrektur").valueAsString!="Off";

if (c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Mietvertrag";

else if (!c1 && c2 && !c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Kündigung";

else if (!c1 && !c2 && c3 && !c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Nachtrag";

else if (!c1 && !c2 && !c3 && c4 && !c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Laufzeit";

else if (!c1 && !c2 && !c3 && !c4 && c5 && !c6 && !c7 && !c8 && !c9) Datenpflege= "Indexmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && c6 && !c7 && !c8 && !c9) Datenpflege= "Umsatzmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && c7 && !c8 && !c9) Datenpflege= "Staffelmiete";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 && c8 && !c9) Datenpflege= "Sonstiges";

else if (!c1 && !c2 && !c3 && !c4 && !c5 && !c6 && !c7 &&!c8 && c9) Datenpflege= "Korrektur";

var mySubject=this.getField("FirmaNr").value+"//"+this.getField("ObjNr").value+"//Stammdaten Vermietungsverträge//"+Datenpflege;

var

Vertragspruefung=""; 

var k1 = this.getField("erforderlich").valueAsString!="Off";

var k2 = this.getField("nerforderlich").valueAsString!="Off"; 

if (k1 && !k2)Vertragspruefung= "Für das weitere Vorgehen ist eine iMS Vertragsprüfung erforderlich.";

else if (!k1 && k2)Vertragspruefung= "Für das weitere Vorgehen ist keine iMS Vertragsprüfung erforderlich.";

var

Schriftverkehr=""; 

var t3 = this.getField("Schriftverkehr").valueAsString!="Off"; 

if (t3)Schriftverkehr= "Vom DM-Team wurde Schriftverkehr am iMS Vertrag, unter der Vertragsnummer ("+this.getField("Vtg-Nr").value+") hinterlegt.";

else if (!t3)Schriftverkehr= "Es wurde kein Schriftverkehr am iMS Vertrag hinterlegt.";

var

body='Hallo'+this.getField("MitarbeiterPM").value+',\n\nanbei erhalten Sie Ihren bearbeiteten Antrag zurück.'+Vertragspruefung+'Bitte entnehmen Sie den Bearbeitungsstatus aus dem Dokument. Gegebenenfalls fallen für Sie hieraus weitere Arbeitsschritte an.\n'+Schriftverkehr+'\n\nBeste Grüße,\n\nIhr Datenmanagement-Team';

this.mailDoc(false,"","","","",mySubject,body)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

Execute following in the console:

this.getField("Mietvertrag");

What did you get?

What version of Adobe Acrobat do you use? Did you create the form in Adobe Acrobat?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2018 Jun 30, 2018

Copy link to clipboard

Copied

LATEST

How did you create the PDF file and the fields in it?

On Sat, Jun 30, 2018, 13:40 tobiasr99355356 <forums_noreply@adobe.com>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines