Need to have a character string in a repeating group reference the same region

  • 96 Views
  • Last Post 14 February 2018
  • Topic Is Solved
andy_d posted this 07 February 2018

I am currently dealing with a conundrum that I just can't figure out. Before I continue, I need to let everyone know that I can not alter or add scripts to the Document Definition since it's set by the company I work for. I only have access to create and edit FlexiLayouts for specific vendors. One of the blocks in the FlexiLayout is a repeating group block that is used to accept invoice lines and this group has text blocks within it like "Description", "UnitPrice", "CountryOfOrigin", etc. My problem lies with the following invoice format:

 

Country of Origin: China

Line number      Description            Qty            Unit Price            Total

001                     Item A                     2               $1.00                  $2.00

002                     Item B                     3               $1.00                  $3.00

 

As you can see, the country of origin, China, belongs to both lines 001 and 002. I'm trying to figure out if it's possible to make a Character String within a repeating group to reference the country of origin for each invoice line. I tried the following code in the advanced pre-search section of my country of origin character string element, but unfortunately it didn't work (rgInvoiceLineData is the repeating group, csLinePosition is a character string element for the line number, csCO is a character string element for the country of origin defined earlier in the tree outside of the repeating group):

 

Order By: Standard | Newest | Votes
andy_d posted this 07 February 2018

cont...

if rgInvoiceLineData.CurrentInstance.csLinePosition.IsNull then{

    Dontfind();

}

else{

   //Create a empty Rect to the left of the csLinePosition element

 

    let leftPoint = rgInvoiceLineData.CurrentInstance.csLinePosition.Rect.Left() -100dot;

    let rightPoint = rgInvoiceLineData.CurrentInstance.csLinePosition.Rect.Left() -15dot;

    let topPoint = rgInvoiceLineData.CurrentInstance.csLinePosition.Rect.Top();

    let bottomPoint = rgInvoiceLineData.CurrentInstance.csLinePosition.Rect.Bottom();

    let a = Rect(leftPointtopPointrightPointbottomPoint);

    let b = csCO.Rect;

   //Create a Rect array which contains the Rect for the empty Rect and the Rect of the country of origin

    let fullRegion = RectArray(a);

    fullRegion.Add(b);

   // 

    RestrictSearchArea(fullRegion);

}

 

This works for the first instance, but every subsequent instance it just makes the empty Rect and restricts the search area to only that Rect. I tried unchecking the Exclude search areas of previous instances in the rgInvoiceLineData repeating group element, but it didn't change the result. Is there any way to make a repeating character string element that would find the country of origin? Any help that anyone could possibly provide would be amazing.

 

Thanks,

 

 

Andy D.

Ekaterina posted this 09 February 2018

Hello,

This issue should be resolved on the FC level. On the FLS level it is impossible.

  • Liked by
  • andy_d
andy_d posted this 14 February 2018

Thanks Ekaterina.

It wasn't the answer I was hoping for, but at least I don't have to keep banging my head against the wall trying to figure out this problem.

Andy D.

Close