Hello All,
Trying to use transaction import with a .CSV and .CTL to setup new Inventory Item in SL 2011... but I get an error and i believe my issue in the Macro dealing with Level1 (the button "Site Details..." that is clicked to set the site details..)
Sample of the Log
'System Message 8026: Insertion of new records on this level are NOT allowed
'System Message 2: Data must be entered in this field
'System Message 8002: Error In Field: cdfltsiteid Value:
'System Message 8004: Data File Record/Line Number: 24 Column: 0
sample of my CSV:
Level0,BB100001,4 HOLE DOCK BUMPER,BUMPER,F,P,F,NN,EXEMPT,AC,1,N,EA,EA,EA,4.95,1300,000000,5200,000000,4200,000000,000000,000000
Level1,GHCWHS,,,,
Below is my .CTL:
'$include: "bsl.dh"
'10250 Control Macro
Sub ProcessImportLine( LevelNumber%, Retval% )
select Case LevelNumber
case TI_Start
call AliasConstant( "Level0", "InventoryItem" )
call AliasConstant( "Level1", "CompanyDefaults" )
case 0 ' 0 of 1
'Level 0 if of Type N
' cinvtid is a key field for level 0
' Field mask is UUUUUUUUUUUUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cinvtid", ImportField(1) )
' Field mask is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
serr = SetObjectValue( "cdescr", ImportField(2) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cclassid", ImportField(3) )
'Currently Disabled cMfgClassID
' cinvttype is an Combo Box
' Values are C;Component Part,L;Labor,F;Finished Good,M;Machine Overhead,D;Other Direct Costs,O;Other type of Item,R;Raw Material,S;Subassembly
' NOTE -- This field is a required field
serr = SetObjectValue( "cinvttype", ImportField(4) )
' csource is an Combo Box
' Values are M;Manufactured,O;Outsourced,P;Purchased
' NOTE -- This field is a required field
serr = SetObjectValue( "csource", ImportField(5) )
' cvalmthd is an Combo Box
' Values are F;FIFO ,L;LIFO ,A;Average Cost ,S;Specific Identification ,T;Standard Cost ,U;User-Specified Cost
' NOTE -- This field is a required field
serr = SetObjectValue( "cvalmthd", ImportField(6) )
' clotsertrack is an Combo Box
' Values are NN;None,LI;Lot Numbered,SI;Serial Numbered
serr = SetObjectValue( "clotsertrack", ImportField(7) )
' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cslstaxcat", ImportField(8) )
' ctransstatus is an Combo Box
' Values are AC;Active,NP;No Purchase,NU;No Usage,OH;On Hold,IN;Inactive,DE;Delete
serr = SetObjectValue( "ctransstatus", ImportField(9) )
'Currently Disabled cKitType
' cstkitem is an Check Box
' Values are 1 for ON and 0 for OFF
' Values are CHECKED for ON and UNCHECKED for OFF
' NOTE -- This field is a required field
serr = SetObjectValue( "cstkitem", ImportField(10) )
' cchkordqty is an Check Box
' Values are Y for ON and N for OFF
' Values are CHECKED for ON and UNCHECKED for OFF
' NOTE -- This field is a required field
serr = SetObjectValue( "cchkordqty", ImportField(11) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cstkunit", ImportField(12) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cpounit", ImportField(13) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "csounit", ImportField(14) )
' NOTE -- This field is a required field
serr = SetObjectValue( "cstkbaseprc", ImportField(15) )
'Currently Disabled cpstdcost04
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cinvtacct", ImportField(16) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cinvtsub", ImportField(17) )
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "ccogsacct", ImportField(18) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "ccogssub", ImportField(19) )
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cDfltSalesAcct", ImportField(20) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cDfltSalesSub", ImportField(21) )
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cPPVAcct", ImportField(22) )
' Field mask is UUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cPPVSub", ImportField(23) )
case 1 ' 1 of 1
'Level 1 if of Type C
' cDfltInvtID is a key field for level 1
' cDfltCpnyID is a key field for level 1
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cdfltsiteid", ImportField(1) )
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cdfltPickBin", ImportField(2) )
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cdfltputawaybin", ImportField(3) )
' Field mask is 9999-9999
serr = SetObjectValue( "cpjt_entity", ImportField(4) )
case TI_Finish
End Select
End Sub
' The following shows the correct syntax to
' PRESS a button
' These object names are specific to this screen.
' Button object name Button05OK, Caption &OK
' serr = SetObjectValue( "Button05OK", "PRESS" )
' Button object name ButtonXRef, Caption Item &XRef...
' serr = SetObjectValue( "ButtonXRef", "PRESS" )
' Button object name ButtonHistory, Caption Item &History...
' serr = SetObjectValue( "ButtonHistory", "PRESS" )
' Button object name ButtonSiteDetail, Caption &Site Detail...
' serr = SetObjectValue( "ButtonSiteDetail", "PRESS" )
' Button object name cmdFindItem, Caption
' serr = SetObjectValue( "cmdFindItem", "PRESS" )
*This post is locked for comments