mibuso.com

Microsoft Business Solutions online community
It is currently Sat Dec 27, 2014 6:56 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Transfer data from RecordRef to temp Record?
PostPosted: Fri Aug 07, 2009 6:30 am 
Offline

Joined: Thu Jan 26, 2006 7:01 am
Posts: 143
Location: Slovenia
Country: Slovenia (si)
Hi. Does anyone know the way to transfer data from RecordRef variable to Record variable which is marked as temporary. Any suggestion much appreciated.


Top
 Profile  
 
 Post subject: Re: Transfer data from RecordRef to temp Record?
PostPosted: Fri Aug 07, 2009 8:08 am 
Offline

Joined: Fri Mar 30, 2007 11:50 am
Posts: 216
Location: Nieuwe Niedorp
Country: Netherlands (nl)
Hi,

You can do this with the settable command.
Code: Select all
RecRef.SETTABLE(TmpRecord);


To transfer all records to a temporary record you will have to make a loop:
Code: Select all
IF RecRef.FINDSET THEN
  REPEAT
    RecRef.SETTABLE(TmpRecord);
    TmpRecord.INSERT;
  UNTIL RecRef.NEXT = 0;

_________________
Reijer Molenaar
Freelance NAV Developer
Object Manager
TVblik


Top
 Profile E-mail  
 
 Post subject: Re: Transfer data from RecordRef to temp Record?
PostPosted: Fri Aug 07, 2009 9:20 am 
Offline

Joined: Thu Jan 26, 2006 7:01 am
Posts: 143
Location: Slovenia
Country: Slovenia (si)
Excellent reijermolenaar =D>, many thanks for the hint. However there is still a little modification needed :), because when you execute RecRef.SETTABLE(TmpRecord), the filters set on RecRef get spoiled by the filters from TmpRecord and if TmpRecord has no filters on it, it's like doing a RESET on RecRef. Therefore the coding should look like:
Code: Select all
IF RecRef.FINDSET THEN BEGIN
  TmpRecord.SETVIEW(RecRef.GETVIEW);
  REPEAT
    RecRef.SETTABLE(TmpRecord);
    TmpRecord.INSERT;
  UNTIL RecRef.NEXT = 0;
END;

PS: To Admins, I suggest this to be put in Tips/Tricks section.


Top
 Profile  
 
 Post subject: Re: Transfer data from RecordRef to temp Record?
PostPosted: Fri Aug 07, 2009 10:31 am 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Wed Jul 02, 2003 9:13 am
Posts: 7705
Location: Milan
Country: Italy (it)
[Topic moved from 'NAV/Navision' forum to 'NAV Tips & Tricks' forum]

arcull wrote:
PS: To Admins, I suggest this to be put in Tips/Tricks section.


PS: To Users, I suggest to use the reporting functionality (the red ! at the right of the post) to do that. :wink:
I happened to read this, but we don't read ALL posts. With the reporting functionality we always notice it.

_________________
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

»»» Mark your calendar: NAV TechDays 2015 - 19 & 20 November 2015 (!) ««« Visit the conference website: http://www.navtechdays.com


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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: