ACH file format edit

Need some help modifying below code to return only the first 22 characters from the VendorName.

orderedColExpressionList.Add(() => EISFCommon.GetFormattedString(ttRow.VendorName));

Thanks

Substring(index, length) will work for what you want to do.

int n = Math.Min(ttRow.VendorName.Length, 22);
orderedColExpressionList.Add(() => EISFCommon.GetFormattedString(ttRow.VendorName.Substring(0,n)));

Hi Jason,
I am getting below error when I update the code.

There is at least one compilation error.
Payment_Generic_character22.cs(197,28): error CS1061: ‘Payment_Generic’ does not contain a definition for ‘FindFirstCompany’ and no extension method ‘FindFirstCompany’ accepting a first argument of type ‘Payment_Generic’ could be found (are you missing a using directive or an assembly reference?)

Any thoughts on this?

Thanks

The EIs have four basic components:

  1. Project: compiles everything and says what to include
  2. Main: does the actual work
  3. Queries: handles lookups/getting data back from the database for the main script
  4. Resources: helper functions such as string formatting

Your compiler is telling you that the Payment_Generic_character22.cs file doesn’t contain the FindFirstCompany method. However, this method is available in the Payment_Generic.Queries.cs as an extension of the main file. Did you break a link in either the project or the queries file when you renamed the main file? Or did you copy the Payment_Generic file to a new folder and not the .Queries file with it?

2 Likes

Thank you Jason. It works.