<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE smbxml SYSTEM "http://www.netsuite.com/xml/dtd/smb_4_06.dtd">
<!--
This SMBXML example shows how to add elements to lists.  It covers 
entities (customers, vendors, employees, and contacts) as well as 
items (inventory items, non-inventory items, other charge items, 
service items, and sales tax items).  We use the elements defined 
here throughout the rest of the  examples. There are some references 
that must exist in your account for these examples to work.

Vendor Category: 'Supplies' (Lists> Other Lists > Vendor Category)
Expense Account: 'Supplies Expense' (Lists > Accounts)
Terms: 'Net 30' (Lists > Other Lists > Terms)
Department: 'Sales' (Lists > Departments)
Store Categories: 'Breakfast', 'Lunch' (Lists > Site Categories)
Shipping Method: 'UPS' (Lists > Shipping Items)
Bank Account: 'Checking' (Lists > Accounts)

This example should be imported first because the transaction and query examples
reference these entities and items.
-->

<!--
NetSuite IPR Software Notice
Copyright (c) 2000-2003 NetSuite, Inc. All Rights Reserved. -->

<smbxml>
	<!-- Custom Lists and Custom Fields-->
	<!-- Custom Lists are used in Custom Fields and must be created before you can 
reference them.  For example, if you sold shirts, you could include custom fields 
like Size or Color on your inventory items. The attribute replaceValues is 
used to either replace the current list values ("true") or append these values to
the existing custom list ("false"). -->
	<request handle="add1">
		<addOrUpdate>
			<customList>
				<name>Sizes</name>
				<customListValues replaceValues="true">
					<customListValue>Small</customListValue>
					<customListValue>Medium</customListValue>
					<customListValue>Large</customListValue>
					<customListValue>X-Large</customListValue>
				</customListValues>
			</customList>
		</addOrUpdate>
	</request>
	<request handle="add2">
		<addOrUpdate>
			<customList>
				<name>Colors</name>
				<customListValues replaceValues="false">
					<customListValue>Blue</customListValue>
					<customListValue>Green</customListValue>
					<customListValue>White</customListValue>
					<customListValue>Red</customListValue>
				</customListValues>
			</customList>
		</addOrUpdate>
	</request>
	<request handle="add3">
		<addOrUpdate>
			<customList>
				<name>Occasion</name>
				<customListValues>
					<customListValue>Anniversary</customListValue>
					<customListValue>Baby Shower</customListValue>
					<customListValue>Birthday</customListValue>
					<customListValue>Corporate</customListValue>
					<customListValue>Graduation</customListValue>
					<customListValue>Other</customListValue>
					<customListValue>Reception</customListValue>
					<customListValue>Wedding Shower</customListValue>
				</customListValues>
			</customList>
		</addOrUpdate>
	</request>
	<!-- Custom Fields-->
	<!-- There are 5 "types" of custom fields - ENTITY, ITEM, BODY, COLUMN and EVENT
(must be capitalized). An ENTITY custom field can be used on entities like customers, 
vendors, contacts etc. An ITEM custom field can be used on items like inventory,
non-inventory, service items, etc.  A BODY custom field is used in the body of the 
transaction, and a COLUMN custom field is used in the itemLine section of a transaction.  EVENT
custom fields are used in CRM for tasks, events and cases. BODY and COLUMN custom fields can
use the parentField as a source of the custom field, an example of this is Preparation Info below.  
There are 12 "fieldTypes" for your custom fields - Currency, Date, Decimal Number, Email Address,
Free-Form Text, Hyperlink, Integer Number, List, Phone Number, Text Area, Time Of Day.  The 
Hyperlink field must be fully qualified (example http://www.oraclesmallbusiness.com).  If you are 
using a "List" fieldType, then you must specify which list by using the customListName element.
-->
	<request handle="add4">
		<addOrUpdate>
			<customField>
				<name>Occasion</name>
				<type>ENTITY</type>
				<fieldType>List</fieldType>
				<customListName>Occasion</customListName>
				<addToCustomer>true</addToCustomer>
				<addToVendor>true</addToVendor>
				<addToEmployee>true</addToEmployee>
				<addToOtherName>true</addToOtherName>
				<addToContact>true</addToContact>
				<addToCRMGroup>false</addToCRMGroup>
			</customField>
		</addOrUpdate>
	</request>
	<request handle="add5">
		<addOrUpdate>
			<customField>
				<name>Preparation Info</name>
				<type>ITEM</type>
				<fieldType>Free-Form Text</fieldType>
				<addToInventoryPart>true</addToInventoryPart>
				<addToNonInventoryPart>true</addToNonInventoryPart>
				<addToService>false</addToService>
				<addToOtherCharge>true</addToOtherCharge>
				<addToGroup>false</addToGroup>
				<addToKit>true</addToKit>
			</customField>
		</addOrUpdate>
	</request>
	<request handle="add6">
		<addOrUpdate>
			<customField>
				<name>Occasion</name>
				<type>BODY</type>
				<fieldType>List</fieldType>
				<customListName>Occasion</customListName>
				<addToPurchase>true</addToPurchase>
				<addToSale>true</addToSale>
				<addToJournal>true</addToJournal>
				<addToExpenseReport>true</addToExpenseReport>
				<addToStandardForms>true</addToStandardForms>
			</customField>
		</addOrUpdate>
	</request>
	<request handle="add7">
		<addOrUpdate>
			<customField>
				<name>Preparation</name>
				<type>COLUMN</type>
				<fieldType>Free-Form Text</fieldType>
				<parentField>Preparation Info</parentField>
				<addToExpense>true</addToExpense>
				<addToPurchase>true</addToPurchase>
				<addToSale>true</addToSale>
				<addToJournal>true</addToJournal>
				<addToExpenseReport>true</addToExpenseReport>
				<addToTime>true</addToTime>
				<addToStore>true</addToStore>
				<addToPickingTicket>true</addToPickingTicket>
				<addToPackingSlip>true</addToPackingSlip>
				<addToStandardForms>true</addToStandardForms>
			</customField>
		</addOrUpdate>
	</request>
	<request handle="add8">
		<addOrUpdate>
			<customField>
				<name>Quarterly Mailing</name>
				<type>ENTITY</type>
				<fieldType>Check Box</fieldType>
				<addToCustomer>true</addToCustomer>
				<addToVendor>true</addToVendor>
				<addToEmployee>true</addToEmployee>
				<addToOtherName>true</addToOtherName>
				<addToContact>true</addToContact>
				<addToCRMGroup>true</addToCRMGroup>
			</customField>
		</addOrUpdate>
	</request>
	<!--Entities-->
	<!-- Following are some Entity examples.  If a ...Ref is used, the name must exist in your account.  
	In the vendor example below, you must already have a Vendor Category named "Supplies",
	an expense account named "Supplies Expense" and terms of "Net 30". The opening 
	balance, and opening balance date elements can only be used upon creation of the customer
	or vendor entity. You can not update an entity with opening balance data (same as in the UI). 
	The custom field "Quarterly Mailing" has been added to this vendor. Since "Quarterly Mailing" 
	has a fieldType of Check Box the only valid values are "true" or "false". -->
	<!-- Before the contact can be referenced in vendor example it must be created.  Here
	is a simple contact record.-->
	<request handle="add9">
		<addOrUpdate>
			<contact handle="MS">
				<entityId>Matthew Sullivan</entityId>
				<contactTypeList>
					<contactTypeRef>
						<name>Vendor</name>
					</contactTypeRef>
				</contactTypeList>
			</contact>
		</addOrUpdate>
	</request>
	<!-- Vendor Example -->
	<!-- In this vendor example, we are referencing the simple contact created above by it's handle.-->
	<request handle="add10">
		<addOrUpdate>
			<vendor handle="SDI">
				<entityId>Sullivan Distributors, Inc.</entityId>
				<companyName>Sullivan Distributors, Inc.</companyName>
				<categoryRef>
					<name>Supplies</name>
				</categoryRef>
				<contactHandle handle="MS"/>
				<email>msullivan@sullivandist.com</email>
				<isEmailPDF>true</isEmailPDF>
				<phone>(312) 906-9999</phone>
				<fax>(312) 906-9976</fax>
				<altPhone>(312) 906-8715</altPhone>
				<printOnCheckAs>Sullivan Distributors</printOnCheckAs>
				<accountNumber>120863-94</accountNumber>
				<expenseAccountRef>
					<name>Supplies Expense</name>
				</expenseAccountRef>
				<termsRef>
					<name>Net 30</name>
				</termsRef>
				<creditLimit>15000.00</creditLimit>
				<taxIdNum>97-5123654</taxIdNum>
				<is1099Eligible>false</is1099Eligible>
				<openingBalance>1587.65</openingBalance>
				<openingBalanceDate>01/01/01</openingBalanceDate>
				<addressList>
					<addressLine>
						<addressName>default bill address</addressName>
						<attention>Matthew Sullivan</attention>
						<addressee>Sullivan Distributors, Inc.</addressee>
						<line1>50 S Wacker Drive</line1>
						<line2>Suite 50</line2>
						<city>Chicago</city>
						<state>IL</state>
						<zipCode>60606-7410</zipCode>
						<country>US</country>
						<phone>(312) 906-9999</phone>
						<defaultBilling>true</defaultBilling>
					</addressLine>
				</addressList>
				<customFieldValues>
					<customFieldValue name="Quarterly Mailing">true</customFieldValue>
				</customFieldValues>
			</vendor>
		</addOrUpdate>
	</request>
	<!-- Employee Example -->
	<!-- In this employee example, the special character "&#xD;" is used to create new lines in the
	address element. -->
	<request handle="add11">
		<addOrUpdate>
			<employee handle="AHitchcock">
				<entityId>Angela Hitchcock</entityId>
				<salutation>Ms.</salutation>
				<firstName>Angela</firstName>
				<middleName>A</middleName>
				<lastName>Hitchcock</lastName>
				<initials>AAH</initials>
				<socialSecurityNumber>341-48-9797</socialSecurityNumber>
				<departmentRef>
					<name>Sales</name>
				</departmentRef>
				<isSalesRep>true</isSalesRep>
				<email>angela@christyscatering.com</email>
				<phone>(847) 205-6820</phone>
				<comments>Works from home</comments>
				<accountNumber>10582</accountNumber>
				<hireDate>03/27/2001</hireDate>
				<isInactive>false</isInactive>
				<employeeTypeRef>
					<name>Regular Employee</name>
				</employeeTypeRef>
				<approvalLimit>10000</approvalLimit>
				<addressList>
					<addressLine>
						<addressName>home address</addressName>
						<addressee>Angela Hitchcock</addressee>
						<line1>1175 Long Meadow Rd</line1>
						<city>Northbrook</city>
						<state>IL</state>
						<zipCode>60062-1522</zipCode>
						<country>US</country>
						<phone>(847) 205-6820</phone>
						<addressText>Angela Hitchcock&#xD;1175 Long Meadow Roadd&#xD;Northbrook IL 60062-1522</addressText>
					</addressLine>
				</addressList>
			</employee>
		</addOrUpdate>
	</request>
	<!-- Customer Example -->
	<request handle="add12">
		<addOrUpdate>
			<customer handle="BTS">
				<entityId>Bailey's Training Services</entityId>
				<companyName>Bailey's Training Services</companyName>
				<salesRepHandle handle="AHitchcock"/>
				<email>tmaharaj@BTS.com</email>
				<phone>(847) 259-0990</phone>
				<fax>(847) 259-0991</fax>
				<altPhone>(847)514-9852</altPhone>
				<comments>Deliver to rear entrance</comments>
				<accountNumber>BT1057</accountNumber>
				<termsRef>
					<name>Net 30</name>
				</termsRef>
				<creditLimit>15000.00</creditLimit>
				<resaleNumber>98-8541967</resaleNumber>
				<priceLevelRef>
					<name>Sales Price 1</name>
				</priceLevelRef>
				<status>CUSTOMER-Closed Won</status>
				<addressList>
					<addressLine>
						<addressName>default bill address</addressName>
						<addressee>Bailey's Training Services</addressee>
						<line1>950 E. Algonquin Road</line1>
						<line2>Suite 101</line2>
						<city>Arlington Heights </city>
						<state>IL</state>
						<zipCode>60005-1457</zipCode>
						<country>US</country>
						<phone>(847) 259-0990</phone>
						<defaultBilling>true</defaultBilling>
						<addressText>Bailey's Training Services&#xD;950 E. Algonquin Road&#xD;
				Arlington Heights IL 60005</addressText>
					</addressLine>
					<addressLine>
						<addressName>default ship address</addressName>
						<addressee>Bailey's Training Services</addressee>
						<line1>950 E. Algonquin Road</line1>
						<line2>Suite 101</line2>
						<city>Arlington Heights </city>
						<state>IL</state>
						<zipCode>60005-1457</zipCode>
						<country>US</country>
						<phone>(847) 259-0990</phone>
						<defaultShipping>true</defaultShipping>
						<addressText>Bailey's Training Services&#xD;950 E. Algonquin Road&#xD;
				Arlington Heights IL 60005</addressText>
					</addressLine>
				</addressList>
				<customFieldValues>
					<customFieldValue name="Occasion">Wedding Shower</customFieldValue>
					<customFieldValue name="Quarterly Mailing">false</customFieldValue>
				</customFieldValues>
			</customer>
		</addOrUpdate>
	</request>
	<!-- Items -->
	<!-- All items are basically the same with each item type having various element sets as defined in the dtd.  -->
	<!-- 'Breakfast' is the parent item of 'Basic Plus' and is referenced by the parentHandle.  The
	custom field "preparation info" is free-form text and can have any value. -->
	<request handle="add13">
		<addOrUpdate>
			<nonInventoryResaleItem handle="Breakfast">
				<name>Breakfast</name>
			</nonInventoryResaleItem>
		</addOrUpdate>
	</request>
	<request handle="add14">
		<addOrUpdate>
			<nonInventoryResaleItem handle="BasicPlus">
				<name>Basic Plus</name>
				<parentHandle handle="Breakfast"/>
				<isOnline>true</isOnline>
				<salesDescription>Coffee, decaf, juice, fruit, pastry, muffins</salesDescription>
				<incomeAccountRef>
					<name>Sales</name>
				</incomeAccountRef>
				<itemPriceList>
					<itemPriceLine>
						<itemPriceTypeRef>
							<name>Base Price</name>
						</itemPriceTypeRef>
						<itemPrice>56.25</itemPrice>
					</itemPriceLine>
					<itemPriceLine>
						<itemPriceTypeRef>
							<name>Online Price</name>
						</itemPriceTypeRef>
						<itemPrice>53.25</itemPrice>
					</itemPriceLine>
				</itemPriceList>
				<isTaxable>true</isTaxable>
				<storeDisplayName>Basic Plus</storeDisplayName>
				<storeCategoryList>
					<storeCategoryRef>
						<name>Breakfast</name>
					</storeCategoryRef>
					<storeCategoryRef>
						<name>Lunch</name>
					</storeCategoryRef>
				</storeCategoryList>
				<storeDescription>Basic Plus</storeDescription>
				<storeDetailedDescription>Coffee, decaf, juice, fruit, pastry, muffins</storeDetailedDescription>
				<customFieldValues>
					<customFieldValue name="Preparation Info">serves 10</customFieldValue>
				</customFieldValues>
			</nonInventoryResaleItem>
		</addOrUpdate>
	</request>
	<request handle="add15">
		<addOrUpdate>
			<serviceSaleItem handle="Serving">
				<name>Serving</name>
				<salesDescription>Additional Serving</salesDescription>
				<rate>18.00</rate>
			</serviceSaleItem>
		</addOrUpdate>
	</request>
	<!-- Example of how to create an account. -->
	<request>
		<addOrUpdate>
			<account>
				<accountTypeRef>
					<name>Accounts Receivable</name>
				</accountTypeRef>
				<name>Internet Sales</name>
				<parentRef>
					<name>Accounts Receivable</name>
				</parentRef>
			</account>
		</addOrUpdate>
	</request>
	<request>
		<addOrUpdate>
			<account>
				<accountTypeRef>
					<name>Accounts Receivable</name>
				</accountTypeRef>
				<name>Phone Sales</name>
				<parentRef>
					<name>Accounts Receivable</name>
				</parentRef>
			</account>
		</addOrUpdate>
	</request>
	<!-- Missing Field overwrite -->
	<!-- This attribute of the request element is used to determine if you want any fields that you omitted to 
	be overwritten with blanks. The default is true. Previously in the examples we created a customer with 
	a handle of "BTS". If we created the following xml and changed the name of our customer to "Bill's 
	Training Services" and did NOT specify that the missingFieldOverwrite="false" we would overwrite
	all of the information in the customer record with blanks and only change the name. If you just wanted
	to change the name of this customer you would set the missingFieldOverwrite="false".
		
	<request>
		<addOrUpdate>
			<customer handle="BTS">
				<entityId>Bill's Training Services</entityId>
			</customer>
		</addOrUpdate>
	</request>
	
	In the example below, missingFieldOverwrite is used to update the prices of our 'Basic Breakfast' item.-->
	<request missingFieldOverwrite="false">
		<addOrUpdate>
			<nonInventoryResaleItem handle="BasicPlus">
				<name>Basic Plus</name>
				<itemPriceList>
					<itemPriceLine>
						<itemPriceTypeRef>
							<name>Base Price</name>
						</itemPriceTypeRef>
						<itemPrice>55.25</itemPrice>
					</itemPriceLine>
					<itemPriceLine>
						<itemPriceTypeRef>
							<name>Online Price</name>
						</itemPriceTypeRef>
						<itemPrice>52.25</itemPrice>
					</itemPriceLine>
				</itemPriceList>
			</nonInventoryResaleItem>
		</addOrUpdate>
	</request>
</smbxml>
