baffled

ReinhardReinhard Member Posts: 249
First I reset and then set some ranges and filters on Shipping Binder
Then when I do
MESSAGE("Shipping Binder".GETFILTERS);
IF "Shipping Binder".FIND('-') THEN
  "Shipping Binder".printDoc
ELSE
  MESSAGE('This shipping configuration was not found in the database');

I always get the message indicating nothing was found in the shipping binder. however, when I go to this table and manually apply those filters there is definitely a record there. :-k :?:

Here is filter string:
Stage: 1, Package Qty. Max.: 1..|0, Package Qty. Min.: 0|..1, Dest. Country: INT|UG|'', Customer: '', Shipping Agent: NNR|NNR|''

Also when I debug I see that the message is accurate, both the filter string and that no record was found. Any idea why this may be happening? Why would a table behave differently when I enter it manually vs through code?

I know this may be a very hard question to answer. Hopefully someone sees something simple... :lol:

Comments

  • djswimdjswim Member Posts: 277
    Just a first impression, see what taking out the extraneous | at the end of those last two does. It's been a while but I believe I've had trouble with those before... that's all I see at first glance.
    "OMG ALL MY DATA IS GONE"
    "Show All..."
    "Oh..."
  • ReinhardReinhard Member Posts: 249
    definitely possible. did you notice that it is not just | but |'' (ie OR blank)

    I use blank to represent that this applies to all shipments, regardless of Dest. Country for example. Maybe I have to use a keyword like ALL instead of blank?
  • djswimdjswim Member Posts: 277
    Again, I'm sure someone will correct me if I'm wrong, but I think in that situation OR <blank> is not the same as ALL, it means if there isn't a code specified... meaning all the entries with <blank> in the Country or Shipping Agent... should be pretty easy to test using a report filter.
    "OMG ALL MY DATA IS GONE"
    "Show All..."
    "Oh..."
  • ReinhardReinhard Member Posts: 249
    no you're right, my explanation was just confusing.

    great signature too
  • kinekine Member Posts: 12,562
    1) Are you using .RESET before setting the filters? There is possibility that there are filters in another filtergroups which are not displayed when using the GETFITLERS function.
    2) There are situations when using MS SQL when some entries are not "visible". Which version and database you are using?
    3) Off-topic Tip: What you want to do when the entry is not found? Continue in processing? I never saw using Message when something is not found, may be only when debugging...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.