RMH148
(RMH148)
January 30, 2023, 4:11pm
1
I see information about using -EXPORT to extract BAQ data, but I do not see how to pass a parameter to the BAQ.
My BAQ prompts for a start and end date. How do I feed it those dates?
start C:\Epicor\ERPDT\Client-Pilot\DMT.exe -User=name -Pass=%PW% -Export -BAQ=“baqName” -Target=“C:\temp\001.csv” -NoUI -UseFieldNames
NateS
(Nate Schoonover)
January 30, 2023, 5:31pm
2
As far as I know, you cannot use parameters with a DMT BAQ export. you have to set the parameters manually as criteria in the BAQ and change it when you need to before you export again.
I would love to hear that I am wrong!
RMH148
(RMH148)
January 30, 2023, 5:33pm
3
Thanks for the reply. I’m thinking that the REST API will need to be the approach.
Thanks again,
ckrusen
(Calvin Krusen)
January 30, 2023, 5:34pm
4
You could make your BAQ use values from a UD table in place of the parameters.
Then just do two DMT’s. The first to set the parameters in the UD table, and the second to run the BAQ export.
RMH148
(RMH148)
January 30, 2023, 5:39pm
5
Sound like a good possibility
Thank You,
RMH148
(RMH148)
January 30, 2023, 5:45pm
6
What would the update Baq look like if I cannot pass parameter via powershell.
I did not want to open dmt and manually enter start and end date for extract.
R
ckrusen
(Calvin Krusen)
January 30, 2023, 6:17pm
7
I guess it would be a three step process in your powershell
Create the CSV file to that will be uploaded via the firs DMT call. This could be very simple. I think the following would work in a batch file
ECHO "Key1","Date01","Date02" > param.csv
ECHO "PARAMS","%1","%2" >> param.csv
Cal the DMT to update the UD table with params.csv
Call the DMT to run the BAQ
If you want to get fancy you could make your DM always link to the UD table and figure out which values (parameters or linked values) to use. If paramters are blank use what is in the UD table, else use the params