On lookup trigger (form)

apickard
apickard Member Posts: 42
Hi guys,
I am wasting a lot of time on something which I believe is trivial to solve. Can anyone help me?

I've got a field (of type Code) which has it's On lookup trigger working perfectly - (if no code is inseted on the On lookup trigger). However I need to insert some code on the On lookup trigger so that lookup form displays only a set of filtered records.

This filtering is working fine, however the lookup form does not display the Ok and Cancel Button, and user cannot select any record from this lookup list.

Any help please?

Comments

  • Shedman
    Shedman Member Posts: 194
    You need to seed LookupMode(TRUE) on the form that you use for lookup.
  • apickard
    apickard Member Posts: 42
    Shedman,
    thanks a lot, it works - buttons are showing.
  • apickard
    apickard Member Posts: 42
    However when selecting a value/record from the filtered list it does not pick/return the value selected to the originating form. Any ideas?
  • Shedman
    Shedman Member Posts: 194
    edited 2008-07-18
    Please post your code.

    What you need to do after the selection is copy the value from the record that was used in the lookup to your current record.
    IF LookupForm.RUNMODAL = ACTION::LookupOK THEN
      Rec.Field := LookupRec.FIELD;
    
  • garak
    garak Member Posts: 3,263
    Do you make it right, it works too!
  • apickard
    apickard Member Posts: 42
    Hi Shedman,
    thanks a lot - issue solved, however had to add also the following line
    Form.Getrecord
    before the assignment statement.

    Garak,
    apologies for that however I noticed my mistake and added a comment stating that I've copied my original post to the correct forum. Unfortunately once posted I did not have the facility to delete my original post. Thanks anyway