Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Automate Sales Order Transaction Import.

(0) ShareShare
ReportReport
Posted on by 5

I am currently working with Dynamics SL 2015 where i am trying to automate the generation of Sales Orders on a scheduled basis.

I have created a working Transaction import process using the relevant control and data files and I can verify it works as expected when I manually run them in the Transaction import screen.

Where i am having issues is in how to automate this task to run in the 2 methods I have attempted thus far.

In method 1 I tried to use the Application Server - where I set up all the parameters in the Transaction Import as I normally would. Then submit it to the Application Server to run at a scheduled time.
When the time comes the Application Server appears to make the call by opening the Sales Order screen but then it does not enter any data. The process just keeps running indefinitely until it is cancelled.

In method 2 I tried using a scheduled batch script below:
(as referenced from this Link )

if exist "S:\Transaction import\upload.csv" (
"S:\OM\4010000.exe" [TI]TM=3 [TI]TC="S:\Transaction import\SalesOrderControlFile.CTL" [TI]TD="S:\Transaction import\upload.csv"  [TI]TO="S:\Transaction import\Output.txt" [TI]TL=2 [TI]TE=1 [TI]Minimize=N
)
All the paths are correct and the batch file calls up the Sales Order screen, multiple other screens appear to flash then it closes the Sales order screen with nothing being written.

Would anyone be able to point me in the right direction for rectifying these issues or point me to a better solution?

  • Clayton.G Profile Picture
    10 on at
    RE: Automate Sales Order Transaction Import.

    Erich - Thank you very much for the insight! I'll check these items (it seems as though TI might not be able to find the import and or control file). Again, Thank you and Merry Christmas!!

  • Erich Strelow F Profile Picture
    16 on at
    RE: Automate Sales Order Transaction Import.

    It's been some time since I saw this, but we still use this system everyday. And we get exactly the same event log as yourself.

    A couple of things to consider:

    - Please remember to locate the datafile and control file in a location accesible by the Application Server process.

    - The temporary folder configured in the Application Server should also exist.

    - The transaction import needs an interactive Windows display in order to work. Technically, it's the Window Station, since the transaction import process match the GUI controls with their corresponding field. This is not true to other Application Server jobs, such as process manager or batch releases. So, an idle user session might still be able to perform some application tasks, but not the TI ones.

    - There's a bug in some Dynamics SL versions (KB 4086055) that launches the TI in the wrong company. The corresponding fix or update pack such address this.

  • Clayton.G Profile Picture
    10 on at
    RE: Automate Sales Order Transaction Import.

    Erich,

     I'm attempting to use your sample code to import transactions via application server.

    The transaction import is added to the queue in application server, and the application server attempts to perform the import but I'm receiving the following message.

    12/14/2022  04:57:20 PM  29279 Price Update         Updating request status                                                                        

    12/14/2022  04:57:20 PM  29279 Price Update         Retrieved Request From Queue                                                    

    12/14/2022  04:57:20 PM  29279 Price Update         Request Started                                                                          

    12/14/2022  04:57:20 PM  29279 Price Update         Start - CompanyID = XXXX                                                                

    12/14/2022  04:57:20 PM  29279 Price Update         Attempting to Login as User: CLAYTON                                                      

    12/14/2022  04:57:20 PM  29279 Price Update         Updated DBRec status to COMPLETE for request: CLAYTON                                  

    12/14/2022  04:57:20 PM  29279 Price Update         Verifying access of request                                                          

    12/14/2022  04:57:21 PM  29279 Price Update         Beginning processing of Transaction Import request                                      

    12/14/2022  04:57:27 PM  29279 Price Update         Processed Screen: 1025000                                          

    12/14/2022  04:57:27 PM  29279 Price Update         Exit - CompanyID = XXXX      

    12/14/2022  04:57:27 PM  29279 Price Update         Processing Results = NONE

    12/14/2022  04:57:27 PM  29279 Price Update         Log File Result = NONE

    12/14/2022  04:57:27 PM  29279 Price Update         Updated DBRec status to COMPLETE for request: 29279

    12/14/2022  04:57:27 PM  29279 Price Update         Updated app request info - id 29279

    12/14/2022  04:57:27 PM  29279 Price Update         Updating request status to complete

    12/14/2022  04:57:27 PM  29279 Price Update         End of Request

    =====================================================

    The transaction import is not being processed and no information is being written to error log. The transaction import is successful via batch file so that eliminates the data and control file configurations.

    Do you have any suggestions or have you experienced this behavior before?

  • Lgreaves Profile Picture
    5 on at
    RE: Automate Sales Order Transaction Import.

    Thank you for your response.

    I have not explored an OLE approach but i will try to wrap my head around it, the code itself appears simple enough.

    To follow up on my initial post.

    My environment has customizations applied to the Sales Order screen and that appears to be what is giving me issues with these 2 methods. Therefore I believe I have some more troubleshooting to do on my side........ woopie :(

  • Erich Strelow F Profile Picture
    16 on at
    RE: Automate Sales Order Transaction Import.

    I've done this many times with the method 1 (Application Server) with an OLE automation approach.

    In the following sample, a transaction import is launched on the 2427100 screen each morning, to keep a daily exchange rate. Please note that the screen really scheduled is the 98500 (the transaction import utility)

    Function PostJob(sDta)
    
    'sDta being the data file submitted
    
    Dim ctlfile 'Import control file
    Dim logfile 'Import log file
    Dim conn    'SL connection
    Dim server  'App Server instance
    
    'AppSrv will launch in a separate host
    'filenames should be UNC
    ctlfile="\\some\app_data\monedas.ctl"
    logfile="\\some\app_data\monedas.log"
    
    Set Conn=CreateObject("ASDevObj.S4DBConnect")
    With conn
      .S4Company= "MPCSA"
      .S4Database="MPCSYS"
      .S4Server="mysrv"
      .S4User="JDOE"
      .WindowsAuthentication=1 'Undocumented property. Allows for windows auth
      .S4DBOpen()
    End with
    
    Set server=CreateObject("ASDevObj.ASRequest")
    
    With server
      .AddCompany "MPCSA"
      .RequestName ="98500"
      .RequestDescription="Daily exchange rate import"
      .AddTIRec 1,sdta,ctlfile,logfile,"2427100",""
      .ReqType="P"
      .Priority=2
      .TIProcessing="2"
      .TILogInfo="1"
      .TIErrors="50"
      .Notification=15
      .ExecLocation=1
      .GenLocation=1
      .Submit()
    
      PostJob=.ID
    End With
    
    End Function

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans