Does anyone have code I could view for adding items into NetSuite. I'm attempting to add items (InventoryItem, SerializedInventoryItem, and NonInventorySaleItem), but NetSuite won't let me.
I want to make sure I have the correct means to doing it.
Public Function SetupInventoryItem(ByVal p_techDataItem As TD_BAL.BusinessObjects.vCombinedTable) As Boolean [INDENT] Dim tempItem As New InventoryItem Dim searchItem As InventoryItem Dim cogsRef As New RecordRef Dim assetRef As New RecordRef Dim incomeRef As New RecordRef Dim vendorRef As New RecordRef Dim wr As WriteResponse vendorRef.internalId = m_vendor.internalId vendorRef.type = RecordType.vendor cogsRef.internalId = m_cogsAccount.internalId cogsRef.type = RecordType.account assetRef.internalId = m_inventoryAssetAccount.internalId assetRef.type = RecordType.account incomeRef.internalId = m_ssIncomeAccount.internalId incomeRef.type = RecordType.account tempItem.cogsAccount = cogsRef tempItem.assetAccount = assetRef tempItem.incomeAccount = incomeRef tempItem.siteCategoryList = SearchCategories(p_techDataItem.CategoryID) tempItem.vendor = vendorRef tempItem.vendorName = p_techDataItem.ProdID tempItem.salesDescription = p_techDataItem.MarketingDescription tempItem.purchaseDescription = p_techDataItem.ProdDescriptionCPI If p_techDataItem.ProdUPC <> "" Then tempItem.upcCode = "True" tempItem.itemId = p_techDataItem.ProdUPC Else tempItem.upcCode = "False" tempItem.itemId = p_techDataItem.ProdID End If tempItem.manufacturer = p_techDataItem.ManufacturerName tempItem.isSpecialOrderItem = True tempItem.weight = p_techDataItem.ProdWeight tempItem.mpn = p_techDataItem.ManufacturerProdID tempItem.externalId = p_techDataItem.ProdID tempItem.internalId = p_techDataItem.ProdID tempItem.displayName = "" 'Purchase price tempItem.pricingMatrix = SetupPricing(p_techDataItem) 'Base price 'Online price 'tempItem.preferredStockLevel tempItem.reorderPoint = Math.Round(tempItem.preferredStockLevel * 0.5) Try searchItem = GetInventoryItem(p_techDataItem) If searchItem Is Nothing Then wr = m_nsService.add(tempItem) If wr.status.isSuccess = True Then LogNetSuite("Addition of item (" & tempItem.externalId & ") successful.") Else LogNetSuite("Addition of item (" & tempItem.externalId & ") failed. " & wr.status.statusDetail(0).message) End If Else wr = m_nsService.update(tempItem) If wr.status.isSuccess = True Then LogNetSuite("Update of item (" & tempItem.externalId & ") successful.") Else LogNetSuite("Update of item (" & tempItem.externalId & ") failed. " & wr.status.statusDetail(0).message) End If End If Return True Catch ex As System.Web.Services.Protocols.SoapException Return False End Try[/INDENT] End Function Error gives me: Addition of item (08681A) failed. You do not have permissions to set a value for element upccode due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.