mibuso.com

Microsoft Business Solutions online community
It is currently Thu May 23, 2013 8:16 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: ID of current object
PostPosted: Thu Aug 06, 2009 11:34 am 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7501
Location: Milan
Country: Italy (it)
Sometimes it is necessary to have the ID of current object.
If you use record-references, in it you have an function that returns the ID of the table you are using, but it does not exist in codeunits,.... (it DOES exist in REPORTS).

To make it a little easier, it is best to create a function that returns the ID.
If you use it a lot and copy the object to another ID, you just have to change it in that function.


Code: Select all
CurrentObjectID() OintCurrentCodeunit : Integer
// CurrentObjectID
// Returns ID of current object
// PARAMETERS:
//   RETURN-VALUE : ID of current object

EXIT(CODEUNIT::"RCD Processing");

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
 Post subject: Re: ID of current object
PostPosted: Mon Aug 10, 2009 2:42 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Mon Dec 11, 2006 10:34 am
Posts: 2863
Location: Bergamo
Country: Italy (it)
it is so simple that it took me 5 minutes to understand it...(i mean it's a long time for one line of code) :D
I couldn't figure out what is the "RCD Processing"...it is only a sample!!! #-o
Nice, indeed...it makes the code easier to read and to write


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: