Report: How to get the content of a rec variable

mgerhartz
Member Posts: 50
Hey Guys,
I just have a simple question. I'll try to explain the situation:
I've a to create a report which has just one DataItem <Structure>. The section should show me some informations, based on fields of the DataItem Structure and some based on differend Tables, which are not stored in the DataItem table. To get access to these informations, I created two varibles with the type of record (MailingGroup_Rec and Contact_Rec). These variables have subtypes of the necessary tables. Now, I wrote the following code into the OnAfterGetRecord Trigger of the DataItem <Structure>:
MailingGroup_Rec.GET(MailingGroup_Rec."Contact No.");
Position := MailingGroup_Rec."Mailing Group Description";
Name := MailingGroup_Rec."Contact Name";
Contact_Rec.GET(Contact_Rec."No.");
email := Contact_Rec."E-Mail";
The variables Position, Name and email are Text variables and should get the informations from the record variables.
When I tried to run the report, I got the following message:
"The Contact Mailing Group does not exist. Identifaction fields and values: Contact No.='', Mailing Groupe Code=''.
Any Idea. I'm pretty sure that's just a little mistake.
I just have a simple question. I'll try to explain the situation:
I've a to create a report which has just one DataItem <Structure>. The section should show me some informations, based on fields of the DataItem Structure and some based on differend Tables, which are not stored in the DataItem table. To get access to these informations, I created two varibles with the type of record (MailingGroup_Rec and Contact_Rec). These variables have subtypes of the necessary tables. Now, I wrote the following code into the OnAfterGetRecord Trigger of the DataItem <Structure>:
MailingGroup_Rec.GET(MailingGroup_Rec."Contact No.");
Position := MailingGroup_Rec."Mailing Group Description";
Name := MailingGroup_Rec."Contact Name";
Contact_Rec.GET(Contact_Rec."No.");
email := Contact_Rec."E-Mail";
The variables Position, Name and email are Text variables and should get the informations from the record variables.
When I tried to run the report, I got the following message:
"The Contact Mailing Group does not exist. Identifaction fields and values: Contact No.='', Mailing Groupe Code=''.
Any Idea. I'm pretty sure that's just a little mistake.
0
Comments
-
in this line
MailingGroup_Rec.GET(MailingGroup_Rec."Contact No.");
MailingGroup_Rec."Contact No." is blank. you are trying to get the record you are pointing to which is blank.
my guess maybe it should be something like this
MailingGroup_Rec.GET(Structure."Contact No.",Structure."Mailing Groupe Code");
Position := MailingGroup_Rec."Mailing Group Description";
Name := MailingGroup_Rec."Contact Name";
Contact_Rec.GET(Structure."Contact No.");
email := Contact_Rec."E-Mail";0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions