error in a trigger with multiple choice, alert and create command
Hi to all...
I writed this trigger that creates a new one task with a pre-determinated delay of days to chose...
but works only for the first choise...
I lost something in the the sintax..
--------------------------------
thi is my code:
---------------------
let a := 'DEAD LINE ATTIVITà';
let b := Preventivi;
let c := '3. Commissioni';
let d := '4. ASSISTENZE';
let e := 'Post-Vendita';
let f := CLIENTE;
let g := UTENTE;
let h := Fornitore;
let result := dialog("AGGIUNTA CONFERMA D'ORDINE", "tra quanti giorni fare conferma?", ["1", "2", "3", "7", "Annulla"]);
if result = "1" and Preventivi != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 1);
p.(Preventivi := b);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '3. Commissioni' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 1);
p.('3. Commissioni' := c);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '4. ASSISTENZE' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 1);
p.('4. ASSISTENZE' := d);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and 'Post-Vendita' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 1);
p.('Post-Vendita' := e);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "2" and Preventivi != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 2);
p.(Preventivi := b);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '3. Commissioni' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 2);
p.('3. Commissioni' := c);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '4. ASSISTENZE' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 2);
p.('4. ASSISTENZE' := d);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and 'Post-Vendita' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 2);
p.('Post-Vendita' := e);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "3" and Preventivi != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 3);
p.(Preventivi := b);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '3. Commissioni' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 3);
p.('3. Commissioni' := c);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '4. ASSISTENZE' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 3);
p.('4. ASSISTENZE' := d);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and 'Post-Vendita' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 3);
p.('Post-Vendita' := e);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "7" and Preventivi != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 7);
p.(Preventivi := b);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '3. Commissioni' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 7);
p.('3. Commissioni' := c);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and '4. ASSISTENZE' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 7);
p.('4. ASSISTENZE' := d);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "1" and 'Post-Vendita' != null then
alert("Conferma d'ordine aggiunta!");
let p := (create '_ WorkFlow');
p.('TODO.2' := 18);
p.('DEAD LINE ATTIVITà' := a + 7);
p.('Post-Vendita' := e);
p.(CLIENTE := f);
p.(UTENTE := g);
p.(Fornitore := h);
p.('Creato da' := userName());
p.('Creato il' := now())
else
if result = "allulla" then
alert("azione annullata")
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
7 replies
-
Ciao Yuri. Prova a controllare il ciclo if else perché credo ci sia un problema nella verifica delle condizioni. Potrebbe tornarni utile anche utilizzare esternamente uno "switch" e switchare "result" per poi creare i cicli if all'interno dei vari case: Questo un esempio:
------------------------------------
switch result docase 1:(if Preventivi != null then(alert("Conferma d'ordine aggiunta!");let p := (create '_ WorkFlow');p.('TODO.2' := 18);p.('DEAD LINE ATTIVITà' := a + 1);p.(Preventivi := b);p.(CLIENTE := f);p.(UTENTE := g);p.(Fornitore := h);p.('Creato da' := userName());p.('Creato il' := now()))elseif '3. Commissioni' != null then(alert("Conferma d'ordine aggiunta!");let p := (create '_ WorkFlow');p.('TODO.2' := 18);p.('DEAD LINE ATTIVITà' := a + 1);p.('3. Commissioni' := c);p.(CLIENTE := f);p.(UTENTE := g);p.(Fornitore := h);p.('Creato da' := userName());p.('Creato il' := now()))elseif '4. ASSISTENZE' != null then(alert("Conferma d'ordine aggiunta!");let p := (create '_ WorkFlow');p.('TODO.2' := 18);p.('DEAD LINE ATTIVITà' := a + 1);p.('4. ASSISTENZE' := d);p.(CLIENTE := f);p.(UTENTE := g);p.(Fornitore := h);p.('Creato da' := userName());p.('Creato il' := now()))elseif 'Post-Vendita' != null then(alert("Conferma d'ordine aggiunta!");let p := (create '_ WorkFlow');p.('TODO.2' := 18);p.('DEAD LINE ATTIVITà' := a + 1);p.('Post-Vendita' := e);p.(CLIENTE := f);p.(UTENTE := g);p.(Fornitore := h);p.('Creato da' := userName());p.('Creato il' := now()))elsevoidend),case 2:(...........)------------------------------------
Fabio
-
Grazie Fabio,
a quanto pare siamo solo 2 italiani a frequentare il forum...
..comunque: ottimo consiglio...credo che lo inserirò anche in altre formule altrettanto complesse...
Solo una domanda: tra il case 1 e case 2 ecc... si mette la virgola?
PS: grazie ancora..consiglio utilissimo
-
opss...
nel copia-incolla ho trascinato parecchie volte ” result=1”
...invece devono essere 4 abbinamenti per ogni risposta...
proverò anche a correggere questa cosa..
-
Ciao. :).. Più che pochi credo che si tenda a comunicare in inglese per permettere a tutti di beneficiare dei vari casi discussi qua... altrimenti sai che casino che ci verrebbe !!
Quindi, questa la sintassi dello switch:
switch Field docase 1: "Option 1"case 2: "Option 2"default: "Everything else"end.. quindi no, senza virgola
A presto
Fabio
-
-
Hello! I will need more information about your code. For what sites and tasks are you going to use it? I am looking for some skilled developer who would be able to create a code similar to the one used on the https://richprize.com/ online casino Rich Prize site. If you understand what I mean, we may get in touch for further discussion. Let me know if you are keep on this project. It is a paid offer.
Content aside
- 5 yrs agoLast active
- 7Replies
- 2462Views
