Options

Select a register in LookUp Trigger

hunterhunter Member Posts: 19
Hi, i have a little problem, i'm using the next code into the trigger section
CLEAR(recDimValue);
   recDimValue.SETCURRENTKEY(Code);
   recDimValue.SETFILTER(recDimValue."Dimension Code",'OBJGASTO');
   recDimValue.SETFILTER(recDimValue.Code,'3000..3997|2000..2997');

   IF FORM.RUNMODAL(0,recDimValue,recDimValue.Code)=ACTION::LookupOK THEN BEGIN
      "Objeto del gasto":=recDimValue.Code;
   END;

but, always open the top of the records... i would like move the position to a determinate record...

for example:
Code = 3111

always open the top (Code 2000)

i'ts posible move the record to 3111 and preserve, the filter???:
recDimValue.SETFILTER(recDimValue."Dimension Code",'OBJGASTO');
recDimValue.SETFILTER(recDimValue.Code,'3000..3997|2000..2997');

Comments

  • Options
    kinekine Member Posts: 12,562
    You mean something like:
      recDimValue.GET('OBJGASTO','3111'); //get this record
    

    or
      recDimValue."Dimension Code" := 'OBJGASTO';
      recDimValue.Code := '3111';
      recDimValue.FIND('=<>'); //find same record or some nearest it
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    krikikriki Member, Moderator Posts: 9,090
    kine wrote:
    recDimValue.FIND('=<>'); //find same record or some nearest it
    But try to avoid '=<>'. They are performance killers if they are triggered a lot.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    hunterhunter Member Posts: 19
    :shock: :shock: amazing!!!
    very simple and very functional, that solve the problem, many thanks for your help :)
Sign In or Register to comment.