Thanks for reply, but the result is the same; it always shows me the message "must send interaction 3"m, even if I did it. This is the code.
Thanls in advance for help.
interaccion.INIT;
interaccion.RESET;
interaccion.SETCURRENTKEY("Contact No.","Correspondence Type","E-Mail Logged",Subject);
interaccion.SETRANGE("Contact No.",Cont."No.");
IF interaccion.FIND('-') THEN BEGIN
REPEAT IF interaccion."Interaction Template Code" = '3' THEN
CreateCustomer(ChooseCustomerTemplate)
ELSE
ERROR(must send interaction 3');
UNTIL interaccion.NEXT=0;
END;
Thank you very much, but it stops in interaccion.SETFILTER("Interaction Template Code",'%1',3); saying that is impossible to do the conversion Code:Integer and I can't save it.
Thanks for help.
Thanks for reply and for explanation. I know that i'm turning tiresome, I'm sorry.
If I put interaccion.SETFILTER("Interaction Template Code",'%1',FORMAT(3)); it says me that on ELSE instruction should be the END instruction; I'm trying put it but I can't find the way.
Thanks.
Indent your code to find out where to put the BEGIN and END (in this case not needed).
interaccion.INIT;
interaccion.RESET;
interaccion.SETCURRENTKEY("Contact No.","Correspondence Type","E-Mail Logged",Subject);
interaccion.SETRANGE("Contact No.",Cont."No.");
interaccion.SETFILTER("Interaction Template Code",'1%',FORMAT(3));
IF interaccion.FIND('-') THEN
CreateCustomer(ChooseCustomerTemplate) //no semicolon
ELSE
ERROR('must send interaction 3'); //semicolon to end the IF line
I'm sorry, now it works correct, but it goes on show me the message "must send interaction 3" even if I did it. It's a madness, I don't know what's the problem.
Thanks everybody for help.
But you put it there, so then you have to match it with an END. Every BEGIN must have a matching END. Either you remove the BEGIN at the start of the code as well as the END at the end of the code, or you add END and another BEGIN in the middle.
So either:
IF interaccion.FIND('-') THEN BEGIN
CreateCustomer(ChooseCustomerTemplate);
END ELSE BEGIN
ERROR(must send interaction 3');
END;
or
IF interaccion.FIND('-') THEN
CreateCustomer(ChooseCustomerTemplate)
ELSE
ERROR(must send interaction 3');
Personally I like the first one, because then you can add code without having to think about BEGIN and END statements.
Thanks everybody for help. Aswering your questions interaction 3 exist. I've tried all the convinations and the result always is the same, it always shows me the message "you must send interaction 3" even if I did it. I don't know what more can I do.
Thanks sincerely for help.
Comments
ERP Consultant (not just Navision) & Navision challenger
Try a REPEAT / UNTIL Next=0 after FIND('-')
Thanls in advance for help.
interaccion.INIT;
interaccion.RESET;
interaccion.SETCURRENTKEY("Contact No.","Correspondence Type","E-Mail Logged",Subject);
interaccion.SETRANGE("Contact No.",Cont."No.");
IF interaccion.FIND('-') THEN BEGIN
REPEAT IF interaccion."Interaction Template Code" = '3' THEN
CreateCustomer(ChooseCustomerTemplate)
ELSE
ERROR(must send interaction 3');
UNTIL interaccion.NEXT=0;
END;
interaccion.INIT;
interaccion.RESET;
interaccion.SETCURRENTKEY("Contact No.","Correspondence Type","E-Mail Logged",Subject);
interaccion.SETRANGE("Contact No.",Cont."No.");
interaccion.SETFILTER("Interaction Template Code",'%1',3);
IF interaccion.FIND('-') THEN BEGIN
CreateCustomer(ChooseCustomerTemplate)
ELSE
ERROR(must send interaction 3');
END;
Sunil
Thanks for help.
RIS Plus, LLC
If I put interaccion.SETFILTER("Interaction Template Code",'%1',FORMAT(3)); it says me that on ELSE instruction should be the END instruction; I'm trying put it but I can't find the way.
Thanks.
CreateCustomer(ChooseCustomerTemplate)
ELSE
ERROR(must send interaction 3') //remove semicolon
END;
Sunil
interaccion.INIT;
interaccion.RESET;
interaccion.SETCURRENTKEY("Contact No.","Correspondence Type","E-Mail Logged",Subject);
interaccion.SETRANGE("Contact No.",Cont."No.");
interaccion.SETFILTER("Interaction Template Code",'1%',FORMAT(3));
IF interaccion.FIND('-') THEN BEGIN
CreateCustomer(ChooseCustomerTemplate)
ELSE
ERROR('must send interaction 3')
END;
Sunil
interaccion.INIT;
interaccion.RESET;
interaccion.SETCURRENTKEY("Contact No.","Correspondence Type","E-Mail Logged",Subject);
interaccion.SETRANGE("Contact No.",Cont."No.");
interaccion.SETFILTER("Interaction Template Code",'1%',FORMAT(3));
IF interaccion.FIND('-') THEN
CreateCustomer(ChooseCustomerTemplate) //no semicolon
ELSE
ERROR('must send interaction 3'); //semicolon to end the IF line
Thanks everybody for help.
Sunil
RIS Plus, LLC
RIS Plus, LLC
Sunil
So either: or Personally I like the first one, because then you can add code without having to think about BEGIN and END statements.
RIS Plus, LLC
Thanks sincerely for help.
Thanks for reply.