Salesmatrix

 

Using Scripts to Automate Imports

As well as providing the Import routine to build scripts, Salesmatrix allows saved scripts to be attached to customised buttons, in order to simplify future data imports.

There are up to four buttons that can be connected to particular scripts.

To activate these buttons two components need to be placed in the base directory of your Salesmatrix - a picture file for the button and a script file that is activated for this button. The base directory is installed, by default, on C:\Program Files\Salesmatrix\Scriptsv3.

The button pictures must be named "button1.jpg", "button2.jpg", "button3.jpg" or "button4.jpg".

In a similar fashion the script files that are activated behind these buttons must be called "scriptv31.smd", "scriptv32.smd", "scriptv33.smd" and "scriptv34.smd".

Editing Script Files

Each script file (*.Smd) file is stored as a text file. To modify the file, you can open it with a text editor like MS Word or WordPad. The following is a description of what is stored in the file:

Line NumberDescription Example
Line 1 Transaction Field that links to customerTrans Customer Link =INVHEADER.CUSTOMER.
Line 2 Transaction Field that links to Salesman FileTrans Sman Link =INVHEADER.SALESPER.
Line 3 Transaction Date FieldrTrans Date =INVHEADER.TRANDATE.
Line 4 Transaction Header to Line item Linking statementTrans Inv No =INVHEAD.INVNO=INVLINE.INVNO
Line 5 Transaction Field that links to Product FileTrans Prod Link =INVLINE.ITEM.
Line 6 Transaction Value FieldTrans Value =INVLINE.FAMTSALES.
Line 7 Transaction Cost FieldTrans Cost =INVLINE.COSTSALES.
Line 8 Transaction Units FieldTrans Units =INVLINE.QTYSOLD.
Line 9 Product Code field (must match transaction field)Prod Link =ICITEM.ITEMNO.
Line 10 Product Description fieldProd Name =ICITEM.DESC.
Line 11 Product Value Field (not required)Prod Value =ICITEM.SALEPRICE
Line 12 Product Cost Field (not required)Prod Cost =ICITEM.COST
Line 13 1st Product Category FieldProd Cat1 =ICITEM.CATEGORY.
Line 14 2nd Product Category FieldProd Cat2 =ICITEM.ALTSET.
Line 15 Customer Code field (must match transaction field)Cust Link =ARCUS.IDCUST.
Line 16 Customer Name fieldCust Name =ARCUS.TEXTSNAM.
Line 17 Customer Category 1Cust Cat1 =ARCUS.IDGRP.
Line 18 Customer Category 2Cust Cat2 =ARCUS.CODESTTE.
Line 19 Salesperson Code field (must match transaction field)Sman Link =ARSAP.CODESLSP.
Line 20 SalesPerson Name fieldSman Name =ARSAP.NAMEEMPL.
Line 21 SalesPerson Category 1Sman Cat2 =ARSAP.BRANCH
Line 22 SalesPerson Category 2Sman Cat1 =ARSAP.DEPT
Line 23 Product Selection StatementProd SQL =SELECT DISTINCT ICITEM.ITEMNO AS CID, ICITEM."DESC" AS CNAME, ICITEM.CATEGORY AS PCAT1, ICITEM.ALTSET AS PCAT2 FROM ICITEM ICITEM.
Line 24 Customer Selection statementCust SQL =SELECT DISTINCT ARCUS.IDCUST AS CID, ARCUS.TEXTSNAM AS CNAME, ARCUS.IDGRP AS CCAT1, ARCUS.CODESTTE AS CCAT2, ARCUS.CODEBRANCH as CCAT3, ARCUS.BUSTYPE as CCAT4, ARCUS.DiscLevel as CCAT5 FROM ARCUS ARCUS.
Line 25 Salesman selection statementSman SQL =SELECT DISTINCT ARSAP.CODESLSP AS CID, ARSAP.NAMEEMPL AS CNAME FROM ARSAP ARSAP.
Line 26 Transaction selection statementTran SQL =SELECT INVHEADER.CUSTOMER AS CCUSTID, INVHEADER.SALESPER AS CSMANID, INVHEADER.TRANDATE AS DTRANDATE, INVHEADER.ITEM AS CPRODID, INVLINE.FAMTSALES AS NVALUE, INVLINE.QTYSOLD AS NUNITS, INVLINE.FCSTSALES AS NCOST FROM INVLINE INVLINE, INVHEADER INVHEADER WHERE INVLINE.INVNO=INVHEADER.INVNO
Line 27 Special date format selection (can be left blank for standard MS ODBC Date formats)Dates ={ACCPAC}{Timestamp}
Line 28 Product DescriptionDesc1 =Products
Line 29Customer Description Desc2 =Clients
Line 30 Sales Person DescriptionDesc3 =Branches
Line 31 Product Category1 DescriptionCatP1= Type
Line 32 Customer Category1 DescriptionCatC1 =Region
Line 33 Sales Person Category1 DescriptionCatS1 =Type
Line 34 Product Category2 DescriptionCatP2 =Location
Line 35 Customer Category2 DescriptionCatC2 =Status
Line 36 Sales Person Category2 DescriptionCatS2 =State
Line 37 Customer Category3 DescriptionCatC3 =Branch
Line 38 Customer Category4 DescriptionCatC4 =BusType
Line 39 Customer Category5 DescriptionCatC5 =DiscLevel
Line 40 Customer Category3 Cust Cat3=ARCUS.CODEBRNCH
Line 41 Customer Category4 Cust Cat4 =ARCUS.BUSTYPE
Line 42 Customer Category5 Cust Cat5 =ARCUS.DiscLevel
Line 43 Tooltip text on Button rolloverTooltip =Imports from Accpac Advantage Series

Return to Main Menu


Copyright Infyra Pty Ltd