function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Henrique RodriguesHenrique Rodrigues 

How to insert records from a thirdy-party software

Hello, i'm developing a web service to receive a list from a third-party software, but when my class receive the list, nothing happens. How can i insert records with this way in salesforce? This is my code, can anyone evaluate to see what is wrong, please?
 
global class IntegrationWSCustomerItem {
    
    global class CustomerItemResponse {
         webservice String Oracle_Code;
         webservice Id Salesforce_ID; 
         webservice Boolean Status;
         webservice String Description;
    }
    global class CustomerItemRequest {
        webservice String Account_Code;
        webservice String Application_Code;
        webservice String Code_Product_Customer;
        webservice String Oracle_Code;
        webservice String Product_Code;
        webservice String Subsegment_Code;
        
    }
    
    webservice static List<CustomerItemResponse> createCustomerItem(List<CustomerItemRequest> customer_entrada){
        
        IntegrationUtils.WSLog('Customer_Item', JSON.serialize(customer_entrada));
        List<CustomerItemResponse> Result = new List<CustomerItemResponse>();
        List<Customer_Item__c> Customer_Item = new List<Customer_Item__c>();
        //List<CustomerItemRequest> cir = new List<CustomerItemRequest>();
        
        
        
       for (CustomerItemRequest cir : customer_entrada) {
           Customer_Item__c ci = new Customer_Item__c();
          	ci.Account__c = cir.Account_Code;
            ci.Application__c = cir.Application_Code;
            ci.Code_Product_Customer__c = cir.Code_Product_Customer;
            ci.Oracle_Code__c = cir.Oracle_Code;
            ci.Product__c = cir.Product_Code;
            ci.Subsegment__c = cir.Subsegment_Code;
         	Customer_Item.add(ci);   
        }
       
		return new List<CustomerItemResponse>();
        
    }
    
}

 
Best Answer chosen by Henrique Rodrigues
Nayana KNayana K
It seems like you have missed insert statement after the for loop. 

if(!Customer_Item.isEmpty())
         insert Customer_Item;