CFront.Net – Searching for records - Error 1246279
Lulu00
Member Posts: 7
There is a post on the forum with a similar problem but it hasn’t been asnswered so I have created another topic.
I am using the Cfront.Net Api within an Asp.net aaplication.
I get the error 1246279 with no descripttive message when searching for records in some tables :
It’s the only set filter.
The record exists. I tried to allow all Navision errors but it doesn’t change anything.
Now, if I change the number to:
It works. But number 1001 makes an error.
I once had an error message:
Which is a false statement.
If anyone has experienced the same issue and dealt with it I would appreciate any help given.
I am using the Cfront.Net Api within an Asp.net aaplication.
I get the error 1246279 with no descripttive message when searching for records in some tables :
cFront.SetFilter(table, 3, "=37615"); cFront.FindRecord(table, record, false, false);
It’s the only set filter.
The record exists. I tried to allow all Navision errors but it doesn’t change anything.
Now, if I change the number to:
cFront.SetFilter(table, 3, "=2889"); cFront.FindRecord(table, record, false, false);
It works. But number 1001 makes an error.
I once had an error message:
1246279 - Error Message: There is no Purchase Line within the filter. Filters: Document No.: =2889
Which is a false statement.
If anyone has experienced the same issue and dealt with it I would appreciate any help given.
0
Answers
-
for me it seems like the C/Front takes whole string as the document no.
Try to use justcFront.SetFilter(table, 3, "37615"); cFront.FindRecord(table, record, false, false);
or try to add aphostrophecFront.SetFilter(table, 3, "='37615'"); cFront.FindRecord(table, record, false, false);
0 -
Sorry! I forgot to mention that have already been trying different syntaxes (including the one you give):
cFront.SetFilter(table, 3, "='37615'"); cFront.SetFilter(table, 3, "=37615"); cFront.SetFilter(table, 3, "'37615'");
I tried using the SetRange method too.0 -
And still same result or some differences? Have you tried the version with just:
cFront.SetFilter(table, 3, "37615");
0 -
Double post.0
-
Yes I tried that one too (the first one I tried in fact, forgot to mention it).
And I get the same error message each time.When I restart the asp.net test server, the first time I run the code the message is more detailed (like the one in the first post):Error Code: 1246279 - Error Message: There is no Purch. Inv. Line within the filter. Filters: Document No.: 37615
0 -
1) To be sure... please check, on which DB you are connected.
2) In your first message you are working with the table "Purchase Line". In your last message you are talking about table "Purch. Inv. Line". Which table you checked for existency of this record??? Open the DB through Navision client and check the correct table for correct record once again...0 -
1) Triple checked at least!
2) I have been playing with different tables, and the last error message is correct actually there is no such record. I got mixed up somewhere.
I have redone my testing again and know it seems to work !//Purchase header table int table = cFront.OpenTable(38); int record = cFront.AllocRecord(table); cFront.SetFilter(table, 3, "='37615'"); cFront.FindSet(table, record, false, false);
I can use any of the following syntax :cFront.SetFilter(table, 3, "='37615'"); cFront.SetFilter(table, 3, "'37615'"); cFront.SetFilter(table, 3, "37615"); cFront.SetFilter(table, 3, "=37615");
Now the error message I mentioned:1246279 - Error Message: There is no Purchase Line within the filter. Filters: Document No.: =2889
Is actually valid (am I mad?). I think I’ve been making up all this (maybe I need some rest ?).Thanks for asking me to redo everything !
I noticed a strange behaviour from the Api where I got error messages related to tables I wasn’t trying to access (but I had just before). In fact the error message was the last I had regardless of the new parameters.
Restarting the asp.net test server seemed to solve the problem.
Actually I just trapped this behaviour !//39 = Purchase Line int table = cFront.OpenTable(39); cFront.SetFilter(table, 3, "2889");
Throws an error: it’s valid.//38 = Purchase header int table = cFront.OpenTable(38); cFront.SetFilter(table, 3, "2889");
Throws the same error but the table is different (there should be an error though) !Error Code: 1246279 - Error Message: There is no Purchase Line within the filter. Filters: Document No.: 2889
I restart the Asp.net test server, run the code and I get:Error Code: 1246279 - Error Message: There is no Purchase Header within the filter. Filters: No.: 2889
Which is valid. The only thing I can say is that I don’t call the CloseTable or CloseTable methods yet (debugging stage). The test server even get’s unstable and crashes after a while (tries to write in protected memory).
Also, I don’t understand why an error is raised with the following code ://Purchase header table int table = cFront.OpenTable(38);//123 int record = cFront.AllocRecord(table); cFront.SetFilter(table, 3, "2889"); cFront.Allow(NavisionAllowedError.RecordNotFound); cFront.Allow(NavisionAllowedError.RecordExists); cFront.Allow(NavisionAllowedError.TableNotFound); cFront.Allow(NavisionAllowedError.KeyNotFound); cFront.FindFirstRecord(table, record); cFront.FindSet(table, record, false, false);
Gets the following error :Error Code: 1246279 - Error Message: There is no Purchase Line within the filter. Filters: Document No.: 2889
Why is the error raised (or the Allow method is unclear for me) ?
Thanks again for you answers to what was obviously only wrong in my poor mind.0 -
Check the documentation for the CFront. If you want to suppress the error, you need to use the return value from the function... something like:
Cf.AllowRecordNotFound Ret = Cf.FunctionThatSearchesForRecord If Ret <> TRUE Then ' handle error
0 -
Thanks a lot !
Not a very constructive topic but I really spent a lot of time lost in my false errors before posting here.
:oops:
Not to be cheeky but the 85132272 error code allowed by the Allow method is not really the same as the 1246279 raised error code.0 -
Take it easy... :-)
It is common, that if you do not know where is the problem, after "look from outside" you find it... (I am asking my co-workers nearly each day for help and right after the question, I see the error clearly...).
I am not using C/Front, I do not know the error nos. or their meanings. But for me it seems like if you are not using the return value, you will have error although you set to allow the error... 8)0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
