web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Using Function Start Session and assign Automatically a new session ID

(0) ShareShare
ReportReport
Posted on by 462

Dea All,

Iam trying to fire STARTSESSION function in Navision 2016. I have a CU which will insert for me a new record in a table.

I am using the function like this:

***********************************

OK:= STARTSESSION(SessionID, CODEUNIT::"Mza_Insert_In_Table", 'TestCompany','');

IF OK THEN
  STOPSESSION(SessionID, 'Record was inserted');
ELSE
 ERROR('Session was stopped')

************************************

Each time I run this code I get this error: "Avariable was expected" and Navision aims to field "Session ID"

 

------ > "Session ID" is a variable of type Int. I thought navision will assign the the session ID Automatically! or I have to assign the session ID manually? If yes how can I do it?

*This post is locked for comments

I have the same question (0)
  • Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    You have to create a C/AL variable for SessionID. After the session is started, the ID is assigned to the SessionID variable after the session is started successfully.

    Hope it helps.

  • M.Zayed Profile Picture
    462 on at

    Thanks for the replay. But can you explain more in details please. I already  Created a C/Al variable of type INT  for the SessionID in the code which you see above. but still its not working?

  • Verified answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi Zayed,

    You can write this code like this.

    STARTSESSION(SessionEvent."Session ID",CODEUNIT::"Parallel Processing 2",COMPANYNAME,ItemLedgerEntryTMP01);

    SessionEvent is a Temporary Table which's ID is 2000000111, Session Event.

    Hope it helps.

  • M.Zayed Profile Picture
    462 on at

    Thanks A lot :), its working now :)

  • Verified answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    Also please check this blog post: krikinav.wordpress.com/.../parallel-processing-in-dynamics-nav which explains about Parallel Processing in NAV, which heavuly uses STARTSESSION.

    Hope it helps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans