public static void UpdateItem(NonInventoryResaleItem objItem)
 {
     try
     {
         WriteResponse writeRes = _service.update(objItem);
         if (writeRes.status.isSuccess)
         {
             //_out.writeLn("\nSales order created successfully\nSales Order Internal ID=" + ((RecordRef)writeRes.baseRef).internalId);
         }
         else
         {
             //_out.error(getStatusDetails(writeRes.status));
         }
     }
     catch (Exception)
     {
     }
 }
        public static NonInventoryResaleItem GetItem(string strProductId)
        {
            NonInventoryResaleItem objItem = new NonInventoryResaleItem();
            try
            {
                ItemSearchBasic objItemSearchBasic = new ItemSearchBasic();
                objItemSearchBasic.vendorCode = new SearchStringField();
                objItemSearchBasic.vendorCode.@operator = SearchStringFieldOperator.startsWith;
                objItemSearchBasic.vendorCode.searchValue = strProductId;// "CST34434A_B";
                objItemSearchBasic.vendorCode.operatorSpecified = true;

                objItemSearchBasic.isInactive = new SearchBooleanField();
                objItemSearchBasic.isInactive.searchValue = false;
                objItemSearchBasic.isInactive.searchValueSpecified = false;

                ItemSearch objItemSearch = new ItemSearch();
                objItemSearch.basic = objItemSearchBasic;
                SearchResult objSearchResult = _service.search(objItemSearch);
                if (objSearchResult.recordList != null && objSearchResult.recordList.Length == 1)
                {
                    if (objSearchResult.recordList[0] is NonInventoryResaleItem)
                    {
                        objItem = (NonInventoryResaleItem)objSearchResult.recordList[0];
                        //RecordRef objRecord = new RecordRef();
                        //objRecord.internalId = objItem.internalId;
                        //objRecord.type = RecordType.nonInventoryResaleItem;
                        //objRecord.typeSpecified = true;
                        //ReadResponse objResponse = _service.get(objRecord);
                        //objItem = (NonInventoryResaleItem)objResponse.record;
                    }
                }
            }
            catch (Exception)
            {
            }
            return objItem;
        }