<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE smbxml SYSTEM "http://www.netsuite.com/xml/dtd/smb_4_06.dtd">
<!--
smbXML Vendor Record Import Example

Before attempting to import any example smbXML documents, NetSuite strongly suggests you read the smbXML Developer's Guide. This guide can be found on the NetSuite Web site at Partners > Developer Program > Technical Documentation. The Developer's Guide explains how to construct smbXML documents.

The Document Type Definition (DTD) defines the format used for smbXML documents imported into your NetSuite account. These documents can contain additions, updates and queries of NetSuite records and transactions. The DTD specifies required fields, field order and XML element and attribute structures. The DTD is your guideline for creating smbXML documents. The current DTD can be found on NetSuite's Web site at Partners > Developer Program > Technical Documentation.

This sample file provides a complete vendor record import example, including mandatory and optional vendor elements. A vendor record import contains several references to objects that must already exist in your NetSuite account. Any objects, available for import with smbXML, that are referenced in this vendor example are created prior to the example. This is necessary for the import to be successful.

Any referenced objects that cannot be created with smbXML must be created using the NetSuite user interface (UI) prior to importing the example. These situations are noted as they occur and instructions for creating the objects in the UI are included.-->

<!--
NetSuite IPR Software Notice
Copyright (c) 2000-2003 NetSuite, Inc. All Rights Reserved.-->

<smbxml missingFieldOverwrite="false">
	<!--The smbxml element may have multiple request elements.

Setting the missingFieldOverwrite attribute to false tells NetSuite to ignore missing elements on import and not to alter information in fields not included in the imported file. If this attribute is set to true, then any elements not included in your smbXML file will be erased upon import. Setting the missingFieldOverwrite attribute at the smbxml element level applies the setting to the entire import. This attribute can be overridden at the request element level. Detailed information on this attribute is provided in the smbXML Developer's Guide.-->
	<!--Multiple request elements are allowed in a single smbXML document. Each request may only have one add, addOrUpdate or query command. Each command may only have one record.-->
	<request>
		<!--Add an contact to be referenced on the vendor record.-->
		<addOrUpdate>
			<!--An addOrUpdate request looks for the existence of an object (in this case, a contact) matching the handle or ID of the object being added. If it finds a match the information is updated for the existing object. If there is no match, a new object is created. We want to make certain the contact record exists in the system prior to referencing it on the vendor record. If the contact record does not exist prior to the import of the vendor record, the record will fail to import. 

The following example represents a very minimal import for a contact record, but it is enough to allow us to import the vendor record below. Contact records may also be created through the UI at Lists > Contacts > New. For a complete example of a contact record import, see the smbXML Contact Record Example.-->
			<contact handle="CONT1425">
				<entityId>Julie Puckett</entityId>
			</contact>
		</addOrUpdate>
	</request>
	<!--Add a second contact record to be referenced on the vendor record.-->
	<request>
		<addOrUpdate>
			<contact handle="CONT1426">
				<entityId>Toby Cameron</entityId>
			</contact>
		</addOrUpdate>
	</request>
	<!--Add an expense account record to be referenced on the vendor record. -->
	<request>
		<addOrUpdate>
			<account handle="ACCT4256">
				<accountTypeRef>
					<name>Expense</name>
				</accountTypeRef>
				<name>Vending Supplies</name>
			</account>
		</addOrUpdate>
	</request>
	<!--Add a vendor category to be referenced on this vendor record. 

You can use smbXML to add a vendor category. However, an add request is used because vendor categories are not currently supported for update. An add request attempts to add an object (in this case, a vendor category) without checking first for a duplicate. 

If a vendor category already exists in NetSuite with this name, the import will create another vendor category with the same name. This causes an error when the category is referenced later in the import because the reference is not a unique name. To prevent this error, you can verify that a vendor category does not already exist with this name, or you can create the category through the UI.

To add a vendor category with smbXML, enter the following elements:
	<request>
		<add>
			<otherList>
				<type>vendor category</type>
				<name>Equipment &amp; Supplies</name>
			</otherList>
		</add>
	</request>	
	
The &amp; string can be added to insert an ampersand into you XML document. -->
	<!--Add a vendor record.-->
	<!--Below is a list of the mandatory and optional references used in a vendor record import. This list also includes information about where the objects being referenced may be created.

	Mandatory References:
		-	parentRef					created in the UI or via smbXML  (Parent references are only 													mandatory if the record is a child of another record.)
		-	currencyRef				created in the UI only  (Currency references are only mandatory if you 												use Multi-currencies.)
		
	Optional References:
		-	contactRef					created in the UI or via smbXML
		-	atlContactRef				created in the UI or via smbXML
		-	expenseAccountRef		created in the UI or via smbXML
		-	categoryRef				created in the UI or via smbXML
		-	termsRef					created in the UI only
		
Note that for each of these references, where allowed, we have chosen to use handle references. Handle references are more precise and easier to use.-->
	<request>
		<addOrUpdate>
			<!--We use an addOrUpdate command here to indicate that if a vendor record already existing for this vendor, the information should be updated. If a record does not exist, a new record will be created.-->
			<vendor handle="VEND0254">
				<!--The vendor element is used to indicate the object you are adding or updating with this request. You can use the handle attribute to create a handle for your record with the vendor element. Creating this handle allows you to reference this item in other smbXML documents using handle references. -->
				<entityId>Cameron's Vending Supply</entityId>
				<!--The entityId element is your vendor's name or ID number. This element is required unless you use auto-generated numbers. This element populates the Vendor field on vendor records and has a maximum length of 80 characters.-->
				<!--If this vendor record is a child of existing vendor records, you must include a parentRef or parentHandle for each parent record. If any of the parent records were created in the UI, a name reference must be used unless the parent handles can be determined with a query.

To use name references for parent records, enter the following elements:
				<parentRef>
					<parentName>Tammy Doe</parentName>
					<parentName>Janet Doe</parentName>
					<name>Candace Doe</name>
				</parentRef>

The top-level parent record is listed first and each level is listed in descending order. These parent records must exist in NetSuite prior to importing your file and the name references must match the record names identically.

To use handle references, enter the following elements:
<parentHandle handle="VEND0253"/>

This would be the handle for the lowest level parent record. With handle references, you do not have to include each level of the parent hierarchy, only the immediate parent handle.-->
				<companyName>Cameron's Vending Supply</companyName>
				<!--The companyName element is your vendor's legal name. This element is not required and the information entered populates the Company Name field on vendor records. This field has a maximum length of 83 characters.-->
				<legalName>Cameron's Vending Supply</legalName>
				<!--The legalName element is used to enter this vendor's legal name if it differs from the name entered for the companyName element. This element is not required and the information populates the Legal Name field on vendor records. This field has a maximum length of 83 characters. If you do not include a legal name, the name entered for companyName will populate this field. -->
				<categoryRef>
					<name>Equipment &amp; Supplies</name>
				</categoryRef>
				<!--The categoryRef element is a reference to a category that already exists in NetSuite. This element is not required and the information populates the Category field on vendor records. The category must exist prior to importing your file. This particular category was listed in a comment at the beginning of this example. The category must be added by inserting the smbXML from the comment or creating the category through the UI. To create a new category in the UI, go to Lists > Other Lists > New > Vendor Category.-->
				<contactHandle handle="CONT1425"/>
				<!--The contactHandle element is a handle reference to a contact record that already exists in NetSuite. This particular contact record was created at the beginning of this example file. If you do not know the handle for the contact record being referenced, you can use a name reference.

To use a name reference for the contact above, enter the following elements:
				<contactRef>
					<name>Julie Puckett</name>
				</contactRef> -->
				<email>service@vending.com</email>
				<!--The email element is the e-mail address of this vendor. This element is not required. The information populates the E-mail field on vendor records and this field has a maximum length of 64 characters. The information entered in this field must conform to standard e-mail address format. I.e. name@domain.com -->
				<isEmailPDF>false</isEmailPDF>
				<isEmailHTML>true</isEmailHTML>
				<!--The isEmailPDF and isEmailHTML elements set the value of the E-mail Type field on vendor records. This field determines the default e-mail type for this vendor. When you send this vendor e-mail through NetSuite, this is the e-mail format that is used. When setting the values of these elements, you may only use true or false. If one element is set as true, the other must be set as false or excluded. Setting both elements as true produces an error and your import will fail. If you do not include these elements or set them both to false, the Type field is set to Default and e-mail to this vendor is sent in your default format. -->
				<phone>555-642-5474</phone>
				<!--The phone element is the primary telephone number for this vendor. This element is not required and the information populates the Phone field on vendor records. The Phone field has a maximum length of 21 characters and the information entered in this field must be in one of the following formats:
	- 999-999-9999
	- (999) 999-9999
	- 1-999-999-9999
	- 1 (999) 999-9999
	- 999-999-9999 ext 999 -->
				<fax>555-627-4575</fax>
				<!--The fax element is the fax number for this vendor. If you use NetSuite's faxing capabilities, this number is used when faxing transaction through NetSuite. You can set up NetSuite's faxing capabilities at Setup > Set Up Printing, Fax & E-mail. This element is not required and the information populates the Fax field on vendor records. The Fax field has a maximum length of 21 characters and the information entered in this field must be in one of the following formats:
	- 999-999-9999
	- (999) 999-9999
	- 1-999-999-9999
	- 1 (999) 999-9999
	- 999-999-9999 ext 999 -->
				<altPhone>555-650-4565</altPhone>
				<!--The altPhone field is a place to enter an additional telephone number for this vendor. This element follows the same guidelines as the phone element. -->
				<altContactHandle handle="CONT1426"/>
				<!--The altContactHandle is a place to reference an additional contact record. In this case, this particular contact record was created at the beginning of this example. The altContactHandle element follows the same guidelines as the contactHandle element. -->
				<comments>This is an example of a comment.&#xD;This sentence will appear on a new line.</comments>
				<!--The comments element is not required. The information entered populates the Comments field on vendor records. The Comments field is a multi-line string with a 999 characters maximum length. You may use the new line string &#xD; to separate lines. -->
				<printOnCheckAs>Cameron's Vending Supply</printOnCheckAs>
				<!--The printOnCheckAs element is used to indicate how this vendor's name should appear on checks. This element is not required and the information entered populates the Print on Check As field on vendor records. The maximum length for this field is 83 characters. If you do not include this element, the name entered in the Vendor field will print on checks. -->
				<accountNumber>145789</accountNumber>
				<!--The accountNumber element is used to record the account number that this vendor has assigned to you. This number appears in the Vendor # field on purchase orders. This element is not required and the information entered populates the Account field on vendor records. This field has a maximum length of 30 characters. -->
				<expenseAccountRef>
					<name>Vending Supplies</name>
				</expenseAccountRef>
				<!--The expenseAccountRef element is used to reference an expense account that already exists in NetSuite. This particular account was created at the beginning of this example. You can also create new accounts in the UI at Lists > Accounts > New. 

If this account record is a child of existing accounts, you must include a parentName for each parent record. Handle references are not available to use for account records, a name reference must be used.

To include parent account records, enter the following elements:
				<expenseAccountRef>
					<parentName>Operating Costs</parentName>
					<parentName>Supplies</parentName>
					<name>Vending Supplies</name>
				</expenseAccountRef>

The top-level parent record is listed first and each level is listed in descending order. These parent records must exist in NetSuite prior to importing your file and the name references must match the record names identically. -->
				<termsRef>
					<name>Due on receipt</name>
				</termsRef>
				<!--The termsRef element is a reference to terms that already exists in NetSuite. This element is not required and the information populates the Terms field on vendor records. The terms must exist prior to importing your file. Terms are only created through the UI. To create new terms, go to Lists > Other Lists > New > Term. -->
				<creditLimit>5000</creditLimit>
				<!--The creditLimit element is used to record your credit limit with this vendor. This element is not required and the information populates the Credit Limit field on vendor records. The information entered in this field must be a currency amount up to 9,999,999,999.99. -->
				<!--If you use Multiple Currencies, you can include the currencyRef element to reference a currency that already exists in NetSuite. You can enable this feature at Setup > Enable Features > General. This element is not required and the information populates the Currency field on vendor records. The currency record must exist prior to importing your file. 

If you do not set a currency for this vendor upon import, the vendor's currency defaults to your company's default currency. Once the vendor's currency is set, it cannot be changed. Currency records are only created through the UI. To create new currency records, go to Lists > Currencies > New.

To reference a currency record, enter the following elements:
				<currencyRef>
					<name>U.S. dollar</name>
				</currencyRef> -->
				<taxIdNum>FE-2021456</taxIdNum>
				<!--The taxIdNum element is used to record this vendor's federal tax id number. For individuals this is usually their social security number. This element is not required unless you issue a 1099 to this vendor. The information entered populates the Tax ID field on vendor records. This field has a maximum length of 15 characters. -->
				<is1099Eligible>true</is1099Eligible>
				<!--The is1099Eligible element is used to indicate if this vendor should receive a 1099 income statement form. Any vendor that you pay more than $600 in a year should receive a 1099 form. This element is not required and the information populates the 1099 Eligible field on vendor records. Because this field is a check box and records a true or false value, you must enter either true or false for this element. -->
				<isInactive>false</isInactive>
				<!--The isInactive element is used to indicate if a vendor is inactive. This element is not required and the information populates the Vendor is Inactive field on vendor records. Because this field is a check box and records a true or false value, you must enter either true or false for this element. If you choose to enter true for this element, the vendor record is inactive. The record will not appear in lists or be available on transactions. -->
				<openingBalance>1500</openingBalance>
				<!--The openingBalance element is used to record any initial balance you have with this vendor. This element is not required and the information populates the Opening Balance field on vendor records. If you choose to enter an opening balance, an open bill for that amount is created for this vendor. The information entered in this field must be a currency amount up to 9,999,999,999.99. -->
				<!--If you use Accounting Periods, you must have an open period for the date entered in the Opening Balance Date field. If you do not have a valid open period, you will receive and error when importing your smbXML file. To include an opening balance date for this vendor, enter the following element:		
				<openingBalanceDate>07/25/02</openingBalanceDate>
				
The openingBalanceDate element is used to record the effective date of the balance listed in the Opening Balance field. This element is not required and the information populates the Opening Balance Date field on vendor records. The date entered for this element must be entered in one of the following formats:
		- MM/DD/YY
		- MM/DD/YYYY

smbXML will only accept one of these two formats. Dates entered in any other format will return an error. If you use another date format in your account, NetSuite will convert the date to be consistent with your chosen format. To choose a date format for your NetSuite account, go to Setup > General Preferences. -->
				<!--If you use the Marketing Automation feature, you can unsubscribe vendors from marketing campaigns with smbXML. However, you cannot subscribe vendors to marketing campaigns using smbXML. To enable Marketing Automation, go to Setup > Enable Features > CRM. Check the Marketing Automation box, agree to NetSuite's term and click Save. To unsubscribe a vendor from marketing campaigns, enter the following elements:
				<unsubscribe>false</unsubscribe>
				
The unsubscribe element should always contain a false entry, otherwise you will receive an error when importing your smbXML file. -->
				<addressList>
					<!--The addressList element is used to indicate to NetSuite that you are beginning a list of addresses for this vendor record. In NetSuite, it is possible to enter multiple addresses for a single vendor record. This element is only required if you are including addresses in your import. -->
					<addressLine>
						<!--The addressLine element is used to indicate to NetSuite that you are beginning a line in your address list. This element should be placed before each individual address. This element is only required if you are including addresses in your import. -->
						<addressName>Home Office</addressName>
						<!--The addressName element is used to name this particular address. This is the name that appears in the address select field on transactions. This element is not required and the information populates the Label field on vendor records. The maximum length for this field is 50 characters. -->
						<attention>Julie Puckett</attention>
						<!--The attention element is used to add a specific person's name to this address. This element is not required and the information populates the Attention column of the address list on vendor records. The maximum length for this field is 50 characters. -->
						<addressee>Cameron's Vending Supply</addressee>
						<!--The addressee element is used to add the name of this vendor. This element is not required and the information populates the Addressee column of the address list on vendor records. The maximum length for this field is 50 characters. -->
						<line1>5256 Market Street</line1>
						<!--The line1 element is used to enter the first line of the street address. This element is not required and the information populates the Address 1 column of the address list on vendor records. The maximum length for this field is 50 characters. -->
						<line2>Suite 42</line2>
						<!--The line2 element is used to enter additional address information���such as a suite or box number. This element is not required and the information populates the Address 2 column of the address list on vendor records. The maximum length for this field is 50 characters. -->
						<city>San Jose</city>
						<!--The city element is used to enter the city for this address. This element is not required and the information populates the City column of the address list on vendor records. The maximum length for this field is 50 characters. -->
						<state>CA</state>
						<!--The state element is used to choose a state or province for this address. This element is not required and the information populates the Province/State column of the address list on vendor records. 

When entering information for this element, the standard, two-letter state or province abbreviations must be used. If these abbreviations are not used, it will not result in an error. However, the Province/State field will remain blank upon import. For a complete list of state and province abbreviations, see the Appendix of the smbXML Developer's Guide. -->
						<zipCode>94435</zipCode>
						<!--The zipCode element is used to enter a postal zip code for this address. This element is not required and the information populates the Zip column of the address list on vendor records. The maximum length for this field is 13 characters. -->
						<country>US</country>
						<!--The county element is used to choose a country for this address. This element is not required and the information populates the Country column of the address list on vendor records. 

When entering information for this element, the standard, two-letter country codes must be used. If these abbreviations are not used, it will not result in an error. However, the Country field will remain blank upon import. For a complete list of country codes, see the Appendix of the smbXML Developer's Guide. -->
						<phone>555-642-5474</phone>
						<!--The phone element is used to enter a contact number for this address. This element in not required and the information populates the Phone field of the address list on vendor records. The maximum length for this field is 21 characters. The previous formatting requirements introduced for phone number fields do not apply to this element. -->
						<defaultBilling>true</defaultBilling>
						<!--The defaultBilling element is used to indicate that this address is the default billing address for this vendor. This element is not required and the information populates the Default Billing column of the address list on vendor records. Because this field is a check box and records a true or false value, you must enter either true or false for this element. If you do not include this element, the default setting for this field is true. -->
						<defaultShipping>false</defaultShipping>
						<!--The defaultShipping element is used to indicate that this address is the default Shipping address for this vendor. This element is not required and the information populates the Default Shipping column of the address list on vendor records. Because this field is a check box and records a true or false value, you must enter either true or false for this element. If you do not include this element, the default setting for this field is true. -->
						<addressText>Accounts Receivable&#xD;Julie Puckett&#xD;5256 Market Street&#xD;Suite 42&#xD;San Jose, CA  94435</addressText>
						<!--The addressText element is used to enter the exact information you want to appear in address fields on transactions when this address is chosen for this vendor. This element is not required and the information populates the Address column of the address list on vendor records. If you do not enter any information for this element, the information entered for attention, addressee, line1, line2, city, state, zipCode and country is entered in this field. -->
					</addressLine>
					<!--Add another address for this vendor record. -->
					<addressLine>
						<addressName>Warehouse</addressName>
						<attention>Warehouse Manager</attention>
						<addressee>Toby Cameron</addressee>
						<line1>25 Prince Street</line1>
						<line2>Building 4</line2>
						<city>San Jose</city>
						<state>CA</state>
						<zipCode>94435</zipCode>
						<country>US</country>
						<phone>555-650-4565</phone>
						<defaultBilling>false</defaultBilling>
						<defaultShipping>true</defaultShipping>
						<addressText>Warehouse Manager&#xD;Toby Cameron&#xD;25 Prince Street&#xD;Building 4&#xD;San Jose, CA  94435</addressText>
					</addressLine>
				</addressList>
			</vendor>
		</addOrUpdate>
	</request>
</smbxml>
<!--
	To import an XML file:
	1. Click the Transactions tab.
	2. On the Transactions tab, under the Other heading, click Submit XML Document.
	3. Click Browse.
	4. Locate your smbXML field and select it.
	5. Click Submit. 
	
	You will see a status bar with the import progress. Once the import is complete, a message appears below the status bar indicating if there are any errors. You will also have the opportunity to download and view the XML response file from NetSuite. The response file lists any errors you may have received and acknowledgements for successful imports.

If you received any errors, you can edit your file to correct the errors and import the file again. Any requests that were successful do not need to be imported again. 

For more information about constructing and importing XML documents, see the Developer's Guide on the NetSuite Web site at Partners > Developer Program > Technical Documentation. -->