Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Transaction Import

(0) ShareShare
ReportReport
Posted on by

A couple questions right off when the control file says if Type = N or if type = D what does that pertain to?

We have been working with a client to get their data imported but errors are plaguing us any insight would be helpful.  We can enter the data on the screens np.:

'System Message 8011: ========Begin Processing of a level1 Data Line========
'level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,941.95,,A,,,,,,,,,7000,10047002,,,,,,,,HC,,,,,,,,,,,,,
'System Message 8005: New Record Requested

'System Message 6478: Invalid Company, Account, SubAccount combination.

'System Message 8002: Error In Field: capacct Value:

'System Message 8004: Data File Record/Line Number: 2 Column: 84
'level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,941.95,,A,,,,,,,,,7000,10047002,,,,,,,,HC,,,,,,,,,,,,,

'System Message 6478: Invalid Company, Account, SubAccount combination.

'System Message 8002: Error In Field: capsub Value:

level0,"",201810,H,3203.84
level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,941.95,,A,,,,,,,NP,,7000,10047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,155.20,,A,,,,,,,NP,,7035,10047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,38.24,,A,,,,,,,NP,,7035,10047004,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,247.66,,A,,,,,,,NP,,7085,10047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,93.40,,A,,,,,,,NP,,7095,10037006,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/02/2018,470F8329F5014FA9B34E,,04/02/2018,15,737.60,,A,,,,,,,NP,,7145,10047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,B022,,04/03/2018,597E95C9DE314CFFAF0B,,04/03/2018,15,174.70,,A,,,,,,,PR000095440,,5010,30047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/03/2018,597E95C9DE314CFFAF0B,,04/03/2018,15,591.88,,A,,,,,,,PR000095440,,7085,30047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/03/2018,597E95C9DE314CFFAF0B,,04/03/2018,15,91.75,,A,,,,,,,PR000095440,,7145,30047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/03/2018,597E95C9DE314CFFAF0B,,04/03/2018,15,94.48,,A,,,,,,,PR100091700,,5010,30047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,A039,,04/03/2018,597E95C9DE314CFFAF0B,,04/03/2018,15,19.00,,A,,,,,,,PR100091700,,7145,30047002,,,,,,,,HC,,,,,,,,,,,,,
level1,"",VO,,,08/31/2016,998C3216A9F24094ADF9,,08/31/2016,15,17.98,,A,,,,,,,NP,,7115,,,,,,,,,HC,,,,,,,,,,,,,

'ControlMacroType: VBAComplete
' VBComponent: ThisScreen, ComponentType: 100 **********************************************************
'03010 Control Macro
Sub ProcessImportLine( LevelNumber%, Retval% )
select Case LevelNumber
case TI_Start

call AliasConstant( "Level0", "Batch" )

call AliasConstant( "Level1", "Document" )

call AliasConstant( "Level4", "Transaction" )

call AliasConstant( "Level5", "Duplicate" )

call AliasConstant( "Level6", "TranDetail" )

call AliasConstant( "Level7", "DocTerms" )

call AliasConstant( "Level8", "PORecipt" )

case 0 ' 0 of 8

'Level 0 if of Type N
' cbatnbrb is a key field for level 0
' Field mask is UUUUUU
serr = SetObjectValue( "cbatnbrb", ImportField(1) )

' cperpost is a Period Field
' NOTE -- This field is a required field
serr = SetObjectValue( "cperpost", ImportField(2) )

'Currently Disabled cstatus

' cbatchandling is an Combo Box
' Values are H;Hold,B;Release Later,R;Release Now,N;No Action
' NOTE -- This field is a required field
serr = SetObjectValue( "cbatchandling", ImportField(3) )

'Currently Disabled cdrtot

serr = SetObjectValue( "cctrltot", ImportField(4) )

'Currently Disabled cdispcpny


case 1 ' 1 of 8

'Level 1 if of Type N
' crefnbrh is a key field for level 1
' Field mask is UUUUUU
serr = SetObjectValue( "crefnbrh", ImportField(1) )

' cdoctype is an Combo Box
' Values are VO;Voucher,AD;Debit Adjustment,AC;Credit Adjustment
' NOTE -- This field is a required field
serr = SetObjectValue( "cdoctype", ImportField(2) )

' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cvendid", ImportField(3) )

' Field mask is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
serr = SetObjectValue( "xuser1", ImportField(4) )

' cdocdate is a Date Field Type
' NOTE -- This field is a required field
serr = SetObjectValue( "cdocdate", ImportField(5) )

' Field mask is XXXXXXXXXXXXXXX
serr = SetObjectValue( "cinvcnbr", ImportField(6) )

' Field mask is UUUUUUUUUUUUUUUU
serr = SetObjectValue( "cSubContract", ImportField(7) )

' cinvcdate is a Date Field Type
serr = SetObjectValue( "cinvcdate", ImportField(8) )

'Currently Disabled cdocbal

' Field mask is UU
serr = SetObjectValue( "cterms", ImportField(9) )

serr = SetObjectValue( "corigdocamt", ImportField(10) )

serr = SetObjectValue( "cdiscbal", ImportField(11) )

' cstatusd is an Combo Box
' Values are A;Active ,H;Hold
' NOTE -- This field is a required field
serr = SetObjectValue( "cstatusd", ImportField(12) )

' Field mask is MMMMMMMMMM
serr = SetObjectValue( "cponbr", ImportField(13) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cporcptnbr", ImportField(14) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cPPRefNbr", ImportField(15) )

' cdiscdate is a Date Field Type
serr = SetObjectValue( "cdiscdate", ImportField(16) )

' cduedate is a Date Field Type
serr = SetObjectValue( "cduedate", ImportField(17) )

' cpaydate is a Date Field Type
' NOTE -- This field is a required field
serr = SetObjectValue( "cpaydate", ImportField(18) )

' Field mask is UU-999999-UUUU
serr = SetObjectValue( "cProjectId_Hdr", ImportField(19) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cDflt_LCCode", ImportField(20) )

'Currently Disabled cmasterdoctype

'Currently Disabled cmasterdocnbr

'Currently Disabled capcpny3

' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "capacct", ImportField(21) )

' Field mask is 999-99-999
' NOTE -- This field is a required field
serr = SetObjectValue( "capsub", ImportField(22) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "capcheckacct", ImportField(23) )

' cExcludeFreight is an Check Box
' Values are 1 for ON and 0 for OFF
' Values are CHECKED for ON and UNCHECKED for OFF
serr = SetObjectValue( "cExcludeFreight", ImportField(24) )

' Field mask is 999-99-999
serr = SetObjectValue( "capchecksub", ImportField(25) )

' Field mask is UUUUUU
serr = SetObjectValue( "cchknbr", ImportField(26) )

' ccheckdate is a Date Field Type
serr = SetObjectValue( "ccheckdate", ImportField(27) )

serr = SetObjectValue( "cchkamt", ImportField(28) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "capplyrefnbr", ImportField(29) )

' SafComboDocType is an Combo Box
' Values are HC;Hand Check,EP;Electronic Payment
serr = SetObjectValue( "SafComboDocType", ImportField(30) )

'Currently Disabled cBWAmt

' cdfltdetail(0) is an Option Button
' Value is 0 to select button with caption " &Do not default"
' cdfltdetail(1) is an Option Button
' Value is 1 to select button with caption " Default and &Append to current detail"
' cdfltdetail(2) is an Option Button
' Value is 2 to select button with caption " Default and &Replace current detail"
serr = SetObjectValue( "cdfltdetail", ImportField(31) )

'Currently Disabled ccpny04

'Currently Disabled crefnbrh04

'Currently Disabled cdocreftype

'Currently Disabled cvendid04

'Currently Disabled cinvcnbr04

'Currently Disabled cinvcdate04

'Currently Disabled cdocbal04

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdoctaxid", ImportField(32) )

serr = SetObjectValue( "Tx_cdoctaxable", ImportField(33) )

serr = SetObjectValue( "Tx_cdoctax", ImportField(34) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdoctaxid(1)", ImportField(35) )

serr = SetObjectValue( "Tx_cdoctaxable(1)", ImportField(36) )

serr = SetObjectValue( "Tx_cdoctax(1)", ImportField(37) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdoctaxid(2)", ImportField(38) )

serr = SetObjectValue( "Tx_cdoctaxable(2)", ImportField(39) )

serr = SetObjectValue( "Tx_cdoctax(2)", ImportField(40) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdoctaxid(3)", ImportField(41) )

serr = SetObjectValue( "Tx_cdoctaxable(3)", ImportField(42) )

serr = SetObjectValue( "Tx_cdoctax(3)", ImportField(43) )

'Currently Disabled Tx_cdoctaxtot


case 4 ' 4 of 8

'Level 4 if of Type D
'Currently Disabled ccpny

' clinetype is an Combo Box
' Values are N;Invoice,C;Misc Charge,F;Freight,S;PO,D;Drop Ship,R;Receipt,P;PPV,T;Tax
' NOTE -- This field is a required field
serr = SetObjectValue( "clinetype", ImportField(1) )

' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cacct", ImportField(2) )

' Field mask is UU-999999-UUUU
serr = SetObjectValue( "cprojectid", ImportField(3) )

' Field mask is UUUUUU-UUUUUU
serr = SetObjectValue( "ctaskid", ImportField(4) )

' Field mask is 999-99-999
' NOTE -- This field is a required field
serr = SetObjectValue( "csub", ImportField(5) )

serr = SetObjectValue( "cqty", ImportField(6) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cunitdesc", ImportField(7) )

serr = SetObjectValue( "cunitprice", ImportField(8) )

serr = SetObjectValue( "ctranamt", ImportField(9) )

'Currently Disabled cInvtID

' Field mask is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
serr = SetObjectValue( "ctrandesc", ImportField(10) )

' Field mask is XXXXXXXXXXXXXXX
serr = SetObjectValue( "cextrefnbr", ImportField(11) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "ctaxcat", ImportField(12) )

' Field mask is MMMMMMMMMM
serr = SetObjectValue( "ctaxiddflt", ImportField(13) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cemployeeid", ImportField(14) )

' Field mask is UUUU
serr = SetObjectValue( "claborclass", ImportField(15) )

' cBillable is an Combo Box
' Values are ;Yes,N;No
serr = SetObjectValue( "cBillable", ImportField(16) )

' cboxnbr is an Combo Box
' Values are 1;1 - Rents,2;2 - Royalties,3;3 - Other Income,4;4 - Federal Income Tax Withheld,5;5 - Fishing Boat Proceeds,6;6 - Medical and Health Care Payments,7;7 - Nonemployee Compensation,8;8 - Payments in Lieu of Dividends/Interest,10;10 - Crop Insurance Proceeds,13;13 - Excess Golden Parachute Payments,14;14 - Gross Proceeds Paid to an Attorney, 15;15a - Section 409A Deferrals,25;15b - Section 409A Income,;<None>
serr = SetObjectValue( "cboxnbr", ImportField(17) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "cLCcode", ImportField(18) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdettaxid", ImportField(19) )

serr = SetObjectValue( "Tx_cdettaxable", ImportField(20) )

serr = SetObjectValue( "Tx_cdettax", ImportField(21) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdettaxid(1)", ImportField(22) )

serr = SetObjectValue( "Tx_cdettaxable(1)", ImportField(23) )

serr = SetObjectValue( "Tx_cdettax(1)", ImportField(24) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdettaxid(2)", ImportField(25) )

serr = SetObjectValue( "Tx_cdettaxable(2)", ImportField(26) )

serr = SetObjectValue( "Tx_cdettax(2)", ImportField(27) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "Tx_cdettaxid(3)", ImportField(28) )

serr = SetObjectValue( "Tx_cdettaxable(3)", ImportField(29) )

serr = SetObjectValue( "Tx_cdettax(3)", ImportField(30) )

'Currently Disabled Tx_cdetrow


case 5 ' 5 of 8

'Level 5 if of Type D
' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "cvendid", ImportField(1) )

' Field mask is UU
serr = SetObjectValue( "cterms", ImportField(2) )

'Currently Disabled crefnbrdupinv

'Currently Disabled cdocdatedupinv

'Currently Disabled cdoctypedupinv

'Currently Disabled cinvcnbrdupinv

'Currently Disabled ccuryid

'Currently Disabled cperentdupinv

'Currently Disabled cponbrdupinv

'Currently Disabled cvendiddupinv

'Currently Disabled cstatusdupinv

'Currently Disabled corigdocamtdupinv


case 6 ' 6 of 8

'Level 6 if of Type C
'Currently Disabled cExpCpnyID

'Currently Disabled clinetype04

'Currently Disabled cunitdesc04

serr = SetObjectValue( "cinvcqty04", ImportField(1) )

serr = SetObjectValue( "cinvcunitcost04", ImportField(2) )

'Currently Disabled cinvcextcost04

'Currently Disabled cinvtid04

'Currently Disabled cAltID

'Currently Disabled cponbr04

'Currently Disabled cpolineref

'Currently Disabled cqty04

'Currently Disabled cunitcost04

'Currently Disabled cextcost04

'Currently Disabled crcptnbr

'Currently Disabled crcptlineref

'Currently Disabled crcptqty

'Currently Disabled cqtyvar04

'Currently Disabled cextcostvar04

'Currently Disabled csiteID04

' cfinalvoucher is an Check Box
' Values are 1 for ON and 0 for OFF
' Values are CHECKED for ON and UNCHECKED for OFF
serr = SetObjectValue( "cfinalvoucher", ImportField(3) )


case 7 ' 7 of 8

'Level 7 if of Type D
serr = SetObjectValue( "cinstallnbr", ImportField(1) )

serr = SetObjectValue( "cnbrdays", ImportField(2) )

' cinstalldate is a Date Field Type
serr = SetObjectValue( "cinstalldate", ImportField(3) )

serr = SetObjectValue( "cinstallamt", ImportField(4) )

' Field mask is UUUUUUUUUU
' NOTE -- This field is a required field
serr = SetObjectValue( "crefnbrdt", ImportField(5) )

'Currently Disabled cinstallmnttot


case 8 ' 8 of 8

'Level 8 if of Type D
' cCurrReceiptSelected is an Check Box
' Values are 1 for ON and 0 for OFF
' Values are CHECKED for ON and UNCHECKED for OFF
serr = SetObjectValue( "cCurrReceiptSelected", ImportField(1) )

' Field mask is UUUUUUUUUU
serr = SetObjectValue( "creceiptnbr", ImportField(2) )


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 cbuttondupinv, Caption &OK
' serr = SetObjectValue( "cbuttondupinv", "PRESS" )

' Button object name cbutton_ReviseDetail, Caption &OK
' serr = SetObjectValue( "cbutton_ReviseDetail", "PRESS" )

' Button object name cmdOK07, Caption &OK
' serr = SetObjectValue( "cmdOK07", "PRESS" )

' Button object name bPrevious, Caption &<
' serr = SetObjectValue( "bPrevious", "PRESS" )

' Button object name bNext, Caption &>
' serr = SetObjectValue( "bNext", "PRESS" )

' Button object name Command6, Caption &OK
' serr = SetObjectValue( "Command6", "PRESS" )

' Button object name Tx_ButtonOK1, Caption &OK
' serr = SetObjectValue( "Tx_ButtonOK1", "PRESS" )

' Button object name cTermsDetOK, Caption OK
' serr = SetObjectValue( "cTermsDetOK", "PRESS" )

' Button object name TemplateFormBtnPaste, Caption Paste
' serr = SetObjectValue( "TemplateFormBtnPaste", "PRESS" )

' Button object name TemplateFormBtnSave, Caption Save
' serr = SetObjectValue( "TemplateFormBtnSave", "PRESS" )

' Button object name TemplateFormBtnDelete, Caption Delete
' serr = SetObjectValue( "TemplateFormBtnDelete", "PRESS" )

' Button object name TemplateFormBtnClose, Caption Close
' serr = SetObjectValue( "TemplateFormBtnClose", "PRESS" )

' Button object name Button_Tax, Caption Ta&x...
' serr = SetObjectValue( "Button_Tax", "PRESS" )

' Button object name bMultPrePay, Caption Multiple Pre-Payments...

' serr = SetObjectValue( "bMultPrePay", "PRESS" )

' End VBComponent **********************************************************

*This post is locked for comments

  • John Lian Profile Picture
    22 on at
    RE: Transaction Import

    Sounds like your field mapping is not correct, most likely for the account field.    Anyway, when you run the TI, you can uncheck the "Run Minimize" box, which allows you to see the data going into the fields as it happens.  That should help you track down the issue.

  • Community Member Profile Picture
    on at
    RE: Transaction Import

    Yes I know the level4 is needed but we were still getting the error pertaining to the acct sub account with level4

  • John Lian Profile Picture
    22 on at
    RE: Transaction Import

    Your file is missing LEVEL4, which map to the transaction details (grid) portion, The file should look like this, where there may be 1 or more LEVEL4 entries per LEVEL1 (document).  

    LEVEL0....

    LEVEL1...

    LEVEL4...

    LEVEL4...

    LEVEL1...

    LEVEL4...

    Follow the fields in LEVEL4 of the macro to build your file.  For example, first field is line type (can leave blank), second is account, etc...

  • Community Member Profile Picture
    on at
    RE: Transaction Import

    Does anyone know why we are getting this:

    System Message 6478: Invalid Company, Account, SubAccount combination.

    We enter by hand without an issue.  I saw a bug fix with something similar but the client says that it doesn't match their version.

  • Suggested answer
    Ram Peru Profile Picture
    2,830 on at
    RE: Transaction Import

    Hello sbcole4,

    Type N is referring to the Header Level.  Type D is referring to the Detail Level. For instance take a example of Voucher and adjustment entry screen. Header Level holds the Batch Information. Document-level holds the reference number & Vendor Information. Detail Level holds the transaction details.

    Hope this explains.

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 > 🔒一 Microsoft Dynamics SL (Archived)

#1
Community Member Profile Picture

Community Member 136

#2
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 102 Super User 2025 Season 1

#3
REUser Profile Picture

REUser 8

Featured topics

Product updates

Dynamics 365 release plans