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
Ramesh Naidu PRamesh Naidu P 

create Product along with Price in single REST Call

Hi

create Product along with Price in single 

please help me.
Navee RahulNavee Rahul
Hi ramesh,

this may be your REST class for Creating the Production


 
@RestResource(urlMapping='/getServiceName/*')
global with sharing class FileRestServices{

    @HttpGet
    global static List<Files__c> doGet() {
        RestContext.response.addHeader('Content-Type', 'text/plain');
        String ProductName  = RestContext.request.params.get('ProductName');
        String FamilyName  = RestContext.request.params.get('FamilyName');
        String ProductCode  = RestContext.request.params.get('ProductCode');
        String CreatedBy      = RestContext.request.params.get('CreatedBy');
        
        String userId = RestContext.request.params.get('Authorization');       

        sObject sObj = Schema.getGlobalDescribe().get(Product).newSObject() ;  
        sObj.put('Name' , ProductName ) ;  
        sObj.put('Family' , FamilyName) ; 
        sObj.put('ProductCode' , ProductCode ) ;  
        sObj.put('CreatedBy' , CreatedBy) ;  
        insert sObj ;
        
    }
}

Thanks
D Naveen Rahul.
Ramesh Naidu PRamesh Naidu P
Hi 

https://ap2.salesforce.com/services/data/v20.0/sobjects/Product2
using above i had send only product information. i need send price along with the product information

 
Ramesh Naidu PRamesh Naidu P
Any one can help me. i want insert at time two or more Object data using salesforce