$record = new Record();
$record->addFieldValue(Contacts::FirstName(), $firstName);
$record->addFieldValue(Contacts::LastName(), $lastName);
$record->addFieldValue(Contacts::Email(), $email);
$record->addFieldValue(Contacts::MailingCountry(), $country);
//My subform:
$record->addFieldValue(new Field("QuoteRequest"), [
"dateOfInquiry" => (new DateTime("now"))->format(DateTimeInterface::ATOM),
"subscriptionRequest" => $numSubscriptions
]);
//Get instance of BodyWrapper Class that will contain the request body
$bodyWrapper = new BodyWrapper();
//Set the list to Records in BodyWrapper instance
$bodyWrapper->setData([$record]);
$trigger = array("approval", "workflow", "blueprint");
$bodyWrapper->setTrigger($trigger);
//Get instance of RecordOperations Class that takes moduleAPIName as parameter
$recordOperations = new RecordOperations();
$headerInstance = new HeaderMap();
$rawResponse = $recordOperations->createRecords($moduleApiName->value, $bodyWrapper, $headerInstance);
return $this->getResponses($rawResponse);