Friday, July 5, 2019

PHP Toolkit version 2012.2 and later version > Add Partner record using PHP



Ability to add partner record via PHP web services


<?php




require_once '../PHPToolkit/NetSuiteService.php';
print_r("test");
$service = new NetSuiteService();
$partner = new Partner();
$partner->entityId = "Partner Test";
$partner->isPerson = false;
$partner->companyName = "Partner Company";
$partner->email = "partnercompany@test.com";
$partner->giveAccess = "true";
$partner->accessRole = new RecordRef();
$partner->accessRole->internalId = "1033";
$partner->password = "test123";
$partner->password2 = "test123";
$partner->requirePwdChange = true;


$request = new AddRequest();
$request->record = $partner;


$addResponse = $service->add($request);


if (!$addResponse->writeResponse->status->isSuccess) {
    echo "ADD PARTNER ERROR";
} else {
    echo "ADD PARTNER SUCCESS, id " . $addResponse->writeResponse->baseRef->internalId;
}


?> 

No comments:

Post a Comment