-
-
Save TheShubhamVsnv/fe6c2a9851f79ad57139e3ba20465cd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Define the HTTP POST method to create contact | |
@HttpPost | |
global static Contact createContact(String contactFirstName, String contactLastName) { | |
Contact con = new Contact( | |
FirstName = contactFirstName, | |
LastName = contactLastName | |
); | |
try { | |
insert con; | |
} catch (Exception e) { | |
// Handle exception during contact creation or sending | |
System.debug('Error: ' + e.getMessage()); | |
} | |
return con; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment