Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: fiuman007 am 16.02.05 - 15:32:31

Titel: MailSend prompt
Beitrag von: fiuman007 am 16.02.05 - 15:32:31
Also,

ich will beim klicken eines Senden Buttons so eine PromptBestätigung bekommen wer alles die  Mail bekommen hat. Dabei soll die mail nur verschickt werden wenn sich ein bestimmtes Feld geändert hat.

Also diese Feldänderungerkennung funktioniert so:

Im PostOpen:

@Command([EditDocument]);
@SetField("modConformDelivery"; ConformDelivery);
@SetField("modCoordinator"; Coordinator);
@SetField("modProductionStart"; ProductionStart)


Dann kommt eben der Mailversand und das Prompt:

Im QuerySave


_Subject :="Projekt: " + ProjectNo + " / Kunde: " + Customer + " / Neuer Entwicklungsauftrag";

_Subject2 := "Projekt: " + ProjectNo + " / Kunde: " + Customer + " / Lieferdatum: " + @Text(ConformDelivery);

_Subject3 := "Projekt: " + ProjectNo + " / Kunde: " + Customer + " / Produktionsstart: " + @Text(ProductionStart);


@If(@IsNewDoc; ""; modCoordinator != Coordinator;
@MailSend(Coordinator;"";"";_Subject;"Document Link: ";"";[IncludeDoclink]);"");

@If(@IsNewDoc; ""; modConformDelivery != ConformDelivery;
@MailSend(Sales; Sales2; ""; _Subject2;"Document Link: ";"";[IncludeDoclink]);"");

@If(@IsNewDoc; ""; modProductionStart != ProductionStart;
@MailSend(ContactQS; ContactProduction; ContactCC; _Subject3;"Document Link: ";"";[IncludeDoclink]);"");


@Prompt([Ok];"MailSend";"Das Dokument wurde an folgende Personen geschickt: " + @Implode (@Name ([CN]; ContactQS)) + " ; "  + @Implode(@Name ([CN]; ContactProduction))  + " ; " + @Implode(@Name ([CN]; ContactCC)) + " ; " + @Implode(@Name ([CN]; Sales)) + " ; " + @Implode(@Name ([CN]; Sales2)) + " ; " + @Implode(@Name ([CN]; Coordinator)))




Das Problem ist nun:  Es werden immer alle Namen ausgelesen, auch wenn an manche die Mail schon vorher verschickt wurde. Also z.B. wenn alle Felder belegt sind, gibt er alle 6 Namen aus, obwohl er tatsächlich nur an z.B. 2 User was schickt.

Wie erreiche ich es dass beim Prompt nicht alle Namen ausgelesen werden sondern, eben nur die, an die gerade verschickt wurde.... ?  Huh..... hoffentlich verstehts jemand was ich meine

Titel: Re: MailSend prompt
Beitrag von: klaussal am 16.02.05 - 15:37:49
Ich würde da mit @if und do arbeiten. Im Do-Zweig den entsprechenden prompt rein.

klaus
Titel: Re: MailSend prompt
Beitrag von: fiuman007 am 16.02.05 - 15:43:11
Da ist dann das Problem dass ich 2-3 Prompts hintereinander bekomme .....
Titel: Re: MailSend prompt
Beitrag von: koehlerbv am 16.02.05 - 15:50:48
Warum "merkst" Du Dir nicht die Empfänger in einer Liste ? Die erforderlichen Vergleiche führst Du doch schon vor den @MailSends aus.

Bernhard
Titel: Re: MailSend prompt
Beitrag von: fiuman007 am 16.02.05 - 15:53:43
Puh. Wie geht so was? 

Also die Empfänger isnd halt Namen Felder. Die sich ständig auch ändern können.

Wie soll ich die dann "merken"?  Und wie soll ich die dann für MailSend ansprechen ?

 ???
Titel: Re: MailSend prompt
Beitrag von: koehlerbv am 16.02.05 - 16:11:13
Das hast Du schon:
Code
@If(@IsNewDoc; ""; modCoordinator != Coordinator;
@MailSend(Coordinator;"";"";_Subject;"Document Link: ";"";[IncludeDoclink]);"");

Dann machst Du einfach folgendes daraus:
Code
@If(@IsNewDoc; ""; modCoordinator != Coordinator;
@MailSend(Coordinator;"";"";_Subject;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modCoordinator != Coordinator; @Trim (_recipients : Coordinator); _recipients);

Für Deinen Prompt hast Du dann den zu "implodierenden" Inhalt von _recipients.

Bernhard
Titel: Re: MailSend prompt
Beitrag von: fiuman007 am 16.02.05 - 16:22:53
Ok. Sollen dann aber alle 3 Abfragen so sein:

@If(@IsNewDoc; ""; modCoordinator != Coordinator;
@MailSend(Coordinator;"";"";_Subject;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modCoordinator != Coordinator; @Trim (_recipients : Coordinator); _recipients);


@If(@IsNewDoc; ""; modConformDelivery != ConformDelivery;
@MailSend(Sales; Sales2; ""; _Subject2;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modConformDelivery != ConformDelivery; @Trim (_recipients : Sales & Sales2); _recipients);

@If(@IsNewDoc; ""; modProductionStart != ProductionStart;
@MailSend(ContactQS; ContactProduction; ContactCC; _Subject3;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modProductionStart != ProductionStart; @Trim (_recipients : ContactQS & ContactProduction & ContactCC); _recipients);

also überall _recipients ?

Und Prompt bleibt dann gleich, oder soll ich dann da den _recipients irgendwo einfügen ?

@Prompt([Ok];"MailSend";"Das Dokument wurde an folgende Personen geschickt: " + @Implode (@Name ([CN]; ContactQS)) + " ; "  + @Implode(@Name ([CN]; ContactProduction))  + " ; " + @Implode(@Name ([CN]; ContactCC)) + " ; " + @Implode(@Name ([CN];  Sales)) + " ; " + @Implode(@Name ([CN]; Sales2)) + " ; " + @Implode(@Name ([CN]; Coordinator)))



Weil wenn ich es jetzt so lasse, dann passiert genau das selbe wie vorher. Er gibt im Prompt alle Namen die belegt sind aus, obwohl es nur an 1-2 verschickt wird.....



Titel: Re: MailSend prompt
Beitrag von: koehlerbv am 16.02.05 - 16:32:30
also überall _recipients ?

Und Prompt bleibt dann gleich, oder soll ich dann da den _recipients irgendwo einfügen ?

Ja natürlich. Deshalb habe ich ja auch das @Trim schon mit eingebaut, damit es keine "leeren" Empfänger gibt.

Bernhard
Titel: Re: MailSend prompt
Beitrag von: fiuman007 am 16.02.05 - 16:54:28
Sorry Bernhard aber irgendwie kapier ich es nicht,

also ich habe jetzt bei allen 3 Abfragen das _recipients eingebaut.

Code
@If(@IsNewDoc; ""; modCoordinator != Coordinator;
@MailSend(Coordinator;"";"";_Subject;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modCoordinator != Coordinator; @Trim (_recipients : Coordinator); _recipients);


@If(@IsNewDoc; ""; modConformDelivery != ConformDelivery;
@MailSend(Sales; Sales2; ""; _Subject2;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modConformDelivery != ConformDelivery; @Trim (_recipients : Sales & Sales2); _recipients);

@If(@IsNewDoc; ""; modProductionStart != ProductionStart;
@MailSend(ContactQS; ContactProduction; ContactCC; _Subject3;"Document Link: ";"";[IncludeDoclink]);"");
_recipients_ := @If (modProductionStart != ProductionStart; @Trim (_recipients : ContactQS & ContactProduction & ContactCC); _recipients);

Passt es so?  Und wo soll ich jetzt diese _recipients beim Prompt einbauen?


So schaue mein bisheriger Prompt aus?

Code
@Prompt([Ok];"MailSend"; "Das Dokument wurde an folgende Personen geschickt: " + @Implode (@Name([CN]; ContactQS)) + " ; "  + @Implode(@Name ([CN]; ContactProduction))  + " ; " + @Implode(@Name ([CN]; ContactCC)) + " ; " + @Implode(@Name ([CN];  Sales)) + " ; " + @Implode(@Name ([CN]; Sales2)) + " ; " + @Implode(@Name ([CN]; Coordinator)))


So wie es jetzt ist, wird gar kein Empfänger angezeigt ? ......  :(   Irgendwie blick ich des alles nicht durch ...



Titel: Re: MailSend prompt
Beitrag von: koehlerbv am 16.02.05 - 16:59:54
Du musst Listenwerte mit ":" verknüpfen und nicht mit "&".

Dein Prompt gibt dann nur noch @Implode (_recipients) aus.

Bernhard