Untitled

 avatar
user_3824920
plain_text
6 months ago
491 B
2
Indexable
SObjectType contactType = Schema.getGlobalDescribe().get('Contact');


 Map<String, Object> requestBody = (Map<String, Object>) JSON.deserializeUntyped(RestContext.request.requestBody.toString());

    SObject newContact = contactType.newSObject();

  
    newContact.put('FirstName', 'John'); // Change this value as needed
    newContact.put('LastName', 'Doe'); // Change this value as needed
    newContact.put('AccountId', acc.Id); // Associate with the current Account


Editor is loading...
Leave a Comment