CU I've created, doesn't work good.

mark_christsmark_christs Member Posts: 156
Dear All,

I would like to ask you about CU I made that unable to work when I write it to C/AL editor of a form designer. The coding as follows:
record.COPY(Rec);
CurrForm.SETSELECTIONFILTER(record);
IF record.FIND('-') THEN BEGIN
record."field" := code;
CU.aaa(record,record);
END;

all records are in the C/AL Global

In the CU itselfs :
C/AL Global function(jjj : Record "xxx";AppltoDocType : Option;ApplytoDocNo2 : Code[20];ssss

nextlineno := nextlineno +10000;

record2.INIT;
record2."Document Type" := record1."Document Type";
record2."Document No." := record1."Document No.";
record2."hhh" := record1."hhh";
record2."Resource No." := record1."Resource No.";
record2."Allocation Date" := record1."Allocation Date";
record2.INSERT;

Createwww(VAR qqq : Record "ddd";jjj : Record "xxx")
IF NOT record1.RECORDLEVELLOCKING THEN
record1.LOCKTABLE(TRUE,TRUE);
nextline := record."field";
record2.SETRANGE("Document Type",record1."Document Type"::Order);
record2.SETRANGE("Document No.",record1."Document No.");
REPEAT
record2.SETRANGE("Document No.",record1."No.");
IF NOT record2.FIND('-') THEN
xxx(record,record2."Document Type"::Order,
record2."Document No.",record."Document Type",record."No.",
record.Description,nextline);
UNTIL record.NEXT = 0;

Record 1 = record 2 and record is not as same as record 1 and record 2.

My purpose with the coding is similar with form 5805 tab functions. I would welcome for your kindness to reply and answers. tku..



Rgds,

Comments

  • bobnavisionbobnavision Member Posts: 159
    hi Mark,

    Question is not very clear to me but what I understood was

    if you insert a record and do not commit the process, you won't find that record in your filter in the same process.

    I do not know I have answered your question or not!!
  • mark_christsmark_christs Member Posts: 156
    Dear Bob,
    tks for your reply. I just want to know the function of selectionfilter in the coding and how to operate it in a tablebox in a form and the form that their sourcetables either a line or header table. Then the 3 lines can be moved to another table or form line through using commandbutton.


    Rgds,
    Mark
Sign In or Register to comment.