Report: How to get the content of a rec variable

mgerhartzmgerhartz 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.

Comments

  • ara3nara3n Member Posts: 9,255
    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";
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.