STARTSESSION

juanbo82juanbo82 Member Posts: 8
Hi! I have a problem with STARTSESSION I need to do a VALIDATE when i change the company. I use STARTSESSION but i think that i have some mistakes:

In codeunit 50000 I do:

OK := STARTSESSION(SessionEvent.”Session ID”, CODEUNIT::ChangeCompany, CompanyDest, Prueba);
IF OK THEN
STOPSESSION(SessionEvent.”Session ID”, ‘Logoff cache stress test session’)
ELSE
ERROR(‘The session was not started successfully.’);

and in codeunit 50001 I do:

OnRun(VAR Rec : Record Prueba)
SalesOrderDes.SETRANGE(“No.”,Rec.No);
IF SalesOrderDes.FINDFIRST THEN BEGIN
SalesOrderDes.VALIDATE(“Sell-to Customer No.”,Rec.CompanyNo);
SalesOrderDes.MODIFY;
END;

Codeunit 50001 doesn't work and i don't know what is happening.

Any ideas?

Thanks and sorry for my english!

Best Answer

Answers

  • juanbo82juanbo82 Member Posts: 8
    Thanks!! Now it's working!!
Sign In or Register to comment.