Record found not matching record present

Resender
Member Posts: 119
Hello I'm currently developing a new functionality to one of our codeunits.
This codeunit is ment to send an email when an edi file is processed, all the code for it exists already. I just have to make sure the mail gets send to the right email address.
In order to find the email adress for an edi file we have to look up the department(Afdelingepartment in a table Subdossier(this was created by our own team).We can get the right
record by the currentkey dossiern° and subdossiern°,which we get out of the edi.
Well I've written the code but no mail is send, so I went to debug a test scenario.
Thge result is strange at least, we have a dossiern° and subdossiern° thats present in the table, but when execute the code
(lrecSubile being the recordvariable)
lrecSubfile.RESET;
lrecSubfile.SETCURRENTKEY(Dossiernr,Subdossiernr);
lrecSubfile.SETRANGE(Dossiernr,'BE070104043');
lrecSubfile.SETRANGE(Subdossiernr,'BE070104043-001');
IF lrecSubfile.FIND('-') THEN BEGIN
REPEAT
MESSAGE(lrecSubfile.Afdeling);
UNTIL lrecSubfile.NEXT =0;
END;
It gives me a blank result, anyone got an idea what could be wrong.
This codeunit is ment to send an email when an edi file is processed, all the code for it exists already. I just have to make sure the mail gets send to the right email address.
In order to find the email adress for an edi file we have to look up the department(Afdelingepartment in a table Subdossier(this was created by our own team).We can get the right
record by the currentkey dossiern° and subdossiern°,which we get out of the edi.
Well I've written the code but no mail is send, so I went to debug a test scenario.
Thge result is strange at least, we have a dossiern° and subdossiern° thats present in the table, but when execute the code
(lrecSubile being the recordvariable)
lrecSubfile.RESET;
lrecSubfile.SETCURRENTKEY(Dossiernr,Subdossiernr);
lrecSubfile.SETRANGE(Dossiernr,'BE070104043');
lrecSubfile.SETRANGE(Subdossiernr,'BE070104043-001');
IF lrecSubfile.FIND('-') THEN BEGIN
REPEAT
MESSAGE(lrecSubfile.Afdeling);
UNTIL lrecSubfile.NEXT =0;
END;
It gives me a blank result, anyone got an idea what could be wrong.
0
Comments
-
What is the fieldcalss of the lrecSubfile.Afdeling
the correct code islrecSubfile.RESET; lrecSubfile.SETCURRENTKEY(Dossiernr,Subdossiernr); lrecSubfile.SETRANGE(Dossiernr,'BE070104043'); lrecSubfile.SETRANGE(Subdossiernr,'BE070104043-001'); IF lrecSubfile.FINDSET THEN REPEAT MESSAGE(lrecSubfile.Afdeling); UNTIL lrecSubfile.NEXT =0;
0 -
The fieldclass is FlowField and FINDSET can't compile cause its not available0
-
Then you have to use CALCFIELDS to calculate flowfields
lrecSubfile.RESET; lrecSubfile.SETCURRENTKEY(Dossiernr,Subdossiernr); lrecSubfile.SETRANGE(Dossiernr,'BE070104043'); lrecSubfile.SETRANGE(Subdossiernr,'BE070104043-001'); IF lrecSubfile.FIND('-') THEN REPEAT lrecSubfile.CALCFIELDS(lrecSubfile.Afdeling); MESSAGE(lrecSubfile.Afdeling); UNTIL lrecSubfile.NEXT =0;
0 -
mohana_cse06 wrote:Then you have to use CALCFIELDS to calculate flowfields
lrecSubfile.RESET; lrecSubfile.SETCURRENTKEY(Dossiernr,Subdossiernr); lrecSubfile.SETRANGE(Dossiernr,'BE070104043'); lrecSubfile.SETRANGE(Subdossiernr,'BE070104043-001'); IF lrecSubfile.FIND('-') THEN REPEAT lrecSubfile.CALCFIELDS(lrecSubfile.Afdeling); MESSAGE(lrecSubfile.Afdeling); UNTIL lrecSubfile.NEXT =0;
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