Searching for a column in a Tabular (List) Form

TomMorathTomMorath Member Posts: 2
Can you programatically locate to a column in a Tabular (List) Form?

The user would click a search button and a dialog would be displayed to allow them to search the field Captions (instead of values within a column).
The focus would be placed in the first column of the current record where a Field Caption was matched.

Also could you arrange the columns of Tabular (List) Form in alphabetic order prgramatically?

Comments

  • krikikriki Member, Moderator Posts: 9,118
    I am not sure this will work and even if it works, it's a lot of work:

    You have to create a temptable where you put all fields in to let the user select a column. To fill the table, you would have to put all fields in it manually. Something like (per field!) (if some fields are not in the table, you have to create a unique ID and a textconstant with the ML-captions)
    tmpColumn."Unique ID" := FIELDNO("MyField1");
    tmpColumn."Field Caption" := FIELDCAPTION("MyField1");
    tmpColumn.INSERT(FALSE);

    to activate the field after searching it (this is the part I don't know if it works)
    tmpColumn.RESET;
    CASE FORM.RUNMODAL(FORM::"MyForm",tmpColumn) = ACTION::LookupOK OF
    FIELDNO("MyField1"): Currform."MyField1".ACTIVATE;
    FIELDNO("MyField2"): Currform."MyField2".ACTIVATE;
    ... and so on...
    END;

    Arrange fields on tabular form : Yes it is possibile but with LOTS of programming. Something like this:
    tmpColumn.RESET;
    tmpColumn.SETCURRENTKEY("Field Caption");
    tmpColumn.ASCENDING(FALSE);
    tmpColumn.FIND('-');
    REPEAT
    // put first the last record at the beginning, then the record before it and so on
    CASE tmpColumn."Unique ID" OF
    FIELDNO("MyField1"): CurrForm."MyField".XPOS := 0;
    FIELDNO("MyField2"): CurrForm."MyField".XPOS := 0;
    ... and so on...
    END;
    UNTIL tmpColumn.next


    Enjoy yourself programming this if you have a lot of fields.......
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.