Lookup Problem

ravi_navisionravi_navision Member Posts: 102
Hi experts,


In my new table, for one of the field, I used the table relation property as : Vendor.No. WHERE (Vendor Posting Group=CONST(FREIGHT))

When I click on lookup for first time, it takes me to vendor list (first record). It's fine. After selecting a record, when I again click on lookup it takes me to the vendor list first record. I want to point to the same record in the vendor list which I selected earlier. Can I do this with any property?
~~ravi

Comments

  • garakgarak Member Posts: 3,263
    check in your Vendor List the Property "SourceTablePlacement"
    What is there the value :?:
    Do you make it right, it works too!
  • ravi_navisionravi_navision Member Posts: 102
    it is as <Saved>
    ~~ravi
  • garakgarak Member Posts: 3,263
    edited 2008-08-18
    ok, back to the question:

    you select a vendor, the courser is on the first rec. in your open list form -> you press OK and the "Vendor no." is now in your field.

    1. Then you leave the line and go to a blank line and you will there select a new Vendor
    or
    2. press F6 in your line where the "Vendor no." is inserted :?:

    If 2. and you press F6, in the opend Vendor List form the courser isn't on the vendor no from where youv'e selected :?:

    3. which version / which application?
    Do you make it right, it works too!
  • ravi_navisionravi_navision Member Posts: 102
    I select a vendor, the courser is on the first rec. in my open list form -> I selected 2 nd record -> press OK and the "Vendor no." is now in my field.

    Now I press f6 in my field -> list form opened , but the courser is again on the first rec (I want courser should point to 2nd record)
    ~~ravi
  • garakgarak Member Posts: 3,263
    is in your "Vendor List" Form. in OnOpenForm() Trigger source like findset, find('-') or findfirst ?

    because normaly the last selected record will be displayed (this was my reason for the property SourceTablePlacement)
    Do you make it right, it works too!
  • ravi_navisionravi_navision Member Posts: 102
    I checked the form. There is no code in onopen form. Properties are also same as of base form.

    still the same problem.
    ~~ravi
  • ravi_navisionravi_navision Member Posts: 102
    I tested for other examples (location). Those are working fine. I don't unserstand why it's not working for Vendor
    ~~ravi
  • ravi_navisionravi_navision Member Posts: 102
    Interesting
    If I remove the “Vendor Posting Group” from secondary key list of vendor table, the requirement what I need is working. But I can’t do that.
    ~~ravi
  • ravi_navisionravi_navision Member Posts: 102
    Hi garak,


    Can you give me any solution. we are using Nav4.01-SQL


    Thanks !
    ~~ravi
  • ravi_navisionravi_navision Member Posts: 102
    Can we solve with coding(on-lookup code)?
    ~~ravi
  • SavatageSavatage Member Posts: 7,142
    if you search the forum for Lookup (i know there are 1000's) but if you scroll thru the topics you should find your answer on how to do it with code.
  • garakgarak Member Posts: 3,263
    The problem is, with the Table relation Property like
    Vendor.No. WHERE (Vendor Posting Group=CONST(XYZ))
    

    you fired up an SQL statement like this (on this reason i ask you what u are using Native / SQL).
    SELECT  *,DATALENGTH("Picture") FROM "Database"."dbo"."CRONUS AG$Vendor" WITH (INDEX("$2"))  WHERE ("Vendor Posting Group"='XYZ') AND ("No_">='123456') ORDER BY "Vendor Posting Group","No_" 
    

    The problem here ist the order by statement. So, if you check your vendor list, the property SourceTableView is <Undefined>. If you change this to SORTING(No.) you problem is no problem. But note, now, ever you open the vendor list, the form will ever use the sort order No. And this could be a problem, if you open this form via Code like
    vendor.reset;
    vendor.setcurrentkey(YourKey);
    vendor.setrange(YourField,YourFilter);
    ....
    form.run(0,Vendor);
    
    and u will use a other sort order .....
    

    So if there are many datas in your filtercriteria (setrange) the form must reorder the records when opened ...

    Hope understandable.

    For the lookup trigger solution, search the forum, there are some post about this theme (author garak, savatage, waldo, kine, DenSter, etc ...)

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.