Options

Is there any way to loop every column in selected row?

vinceliu666vinceliu666 Member Posts: 51
Hi , Does anyone knows is there any way to loop every column in selected row ? For example .. I set a filter to get Sales Line by Sales Header No. I want to loop every fields value and column name which selected row . The code just like ..

SalesLineRec.RESET;
SalesLineRec.SETFILTER("Document No",SalesHeaderRec."No.");
IF SalesLineRec.FINDFIRST THEN
REPEAT
...
( just like those code which i want to do )
Foreach ( DataRows Col in SalesLineRec.Rows )
if (Col="ItemNo" )
Do something
Loop
...
UNTIL SalesLineRec.NEXT=0;
 

 

Best Answers

Answers

  • Options
    vinceliu666vinceliu666 Member Posts: 51
    Thanks for your help very much.
  • Options
    vinceliu666vinceliu666 Member Posts: 51
    Hi SanderDk and TallyHo

    When I use the FieldRef to get record filed vaule or field name it works fine . But I get 0 when the filed is FlowField in record . For example , The Amout Filed is FlowField in Sales Header. It returns always 0 when I use the fieldRef.

    How could I do ? Do you have any ideal ?
  • Options
    vinceliu666vinceliu666 Member Posts: 51
    Hi , TallyHo:

    Yeap, you are right. It seems need to check the filedref.CLASS and CALCFIELD, before to read fieldRef.value. And then it woks fine.

    thanks for your help .
Sign In or Register to comment.