Community

Line Counter Answered

Hi,

I found one post on this subject but it was for FlexCapture for invoices and I haven't been able to make it work for FlexiCapture v11 dist.  My question is how do I count and pass an invoice line number to a field so that I can export this information.  Most doc defs w/Flexilayout I create, I define regions for each line which are numbered, but I can't figure out how to pass that information to a field for export.  I imagine the answer involves a loop counter but I can't get it right.  Any ideas?  Below is the code from the other post:

Dim LineItemCount, LoopVar

 LineItemCount = me.Field("LineItemsCount").Value

 'Loop through every row in the LineItems group

For LoopVar = 0 To LineItemCount - 1    '- 1 because the rows start with zero

   me.Field("Position").Items.Item(LoopVar).Value = (LoopVar + 1)    '+ 1 to start numbering from 1

 Next

Fields "lineitemscount" and "position".   Knowing where these fields came from and their corresponding settings would be helpful.  Position appears to be a captured line item in Flexcap for invoices.  Is there a way to duplicate this in Flexicap v11?

Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Permanently deleted user

    Hello,

    Please create the “lineNumber” column in your table and on the Document Section level create your script rule as shown on the screenshot. Here is the code:

    Dim LineItemCount

     LineItemCount = me.Field("lineNumber").Items.Count

    For LoopVar = 0 To LineItemCount - 1

    me.Field("lineNumber").Items(LoopVar).Text = CStr(LoopVar + 1)

    Next

    screenshot

    0
  • Avatar
    Permanently deleted user

    Thank you!

    0

Please sign in to leave a comment.