I created an Export Scenario and when I view the Screen from the Export Scenario screen it shows me exactly what I am expecting. (Thanks Naveen)
However, when I try to Process Export Scenario, I get an error.
The data gets “prepared” and this is exactly what I am wanting to export:
In case it helps, here is the definition of the data provider and Export Scenario
PARAMETERS
SCHEMA
EXPORT SCENARIO
The source of the data is from a Generic Inquiry.
For CSV provider, you have to link a file and that file name is used to create the export file. I don’t see that file link option in the Generic Inquiry Provider type, so maybe it just doesn’t know what file to export to?
Any ideas what that error is caused by?
Thanks,
Joe Schmucker
Best answer by Joe Schmucker
I ended up writing a custom data provider. I used the code from Sergey’s blog and modified a few lines.
In case anyone else needs to do what I am doing, this is what I did. I also put a flag in to not write the line if the value of the record is the same as the field header name. The Process Export Scenario screen refused to skip the header record even when the Skip Header was checked.
public void Write(IEnumerable<string> values) {
bool SkipHeader = false;
int valuesCount = values.Count(); string[] converted = new string[valuesCount];
int i = 0; foreach (string item in values) { string value = item ?? String.Empty;
I originally created it using CSV provider type. I am using a SQL view to create a single returned field containing a string. It is in the format required by the bank. I used a CSV template file with one field so the output is fine as long as there are no commas in the output string.
The problem with using the CSV type is that if the company name has a comma in it, the field is surrounded with Quotes. The output file cannot have quotes and must be an exact length.
Since this is a “positive pay” file to send to the bank, the payee name in the file must match exactly to what is printed on the check.
I thought about replacing the commas in the string with a period (in the SQL View) but I don’t know yet if the bank will accept that.
But I think that is beyond my skill set. The example he provided is based on CSV. I *might* be able to do it if I had that code based on an ACH provider as a starting point.
I am able to get the output I want using a SQL View as the table for my GI. I am just missing the ability to export the results from the GI to a text file without any additional formatting being applied by Acumatica.
I have tried setting up this scenario using other provider types with no success. I even tried SQL provider type but I got an error that “company ID” cannot be null when I ran the export.
Something this simple should not be so hard. :-) Creating a provider from scratch might be the only option I guess. But as I said, without an example code base, I’d be lost.
I ended up writing a custom data provider. I used the code from Sergey’s blog and modified a few lines.
In case anyone else needs to do what I am doing, this is what I did. I also put a flag in to not write the line if the value of the record is the same as the field header name. The Process Export Scenario screen refused to skip the header record even when the Skip Header was checked.
public void Write(IEnumerable<string> values) {
bool SkipHeader = false;
int valuesCount = values.Count(); string[] converted = new string[valuesCount];
int i = 0; foreach (string item in values) { string value = item ?? String.Empty;
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.