Resource Allocation
For information on the availability of the Resource Allocations feature, please contact your account representative.
The resource allocation record lets you reserve an employee's time for a particular project.
The resource allocation record is defined in the actSched (scheduling) XSD, where it is called resourceAllocation.
ResourceAllocationSearch, ResourceAllocationSearchBasic, and ResourceAllocationSearchAdvanced are also exposed to SOAP web services.
In the UI, you access the resource allocation record by going to Activities > Scheduling > Resource Allocations. Alternatively, you can view the resource allocations for a particular project through the project record's Resources subtab (Lists > Relationships > Projects).
This record is available only if the Resource Allocations feature has been enabled at Setup > Company > Setup Tasks > Enable Features, on the Company tab. Note that this option will not be visible unless your account has been provisioned for this feature. For more details, contact your account representative.
For information about working with this record in the UI, see Resource Allocations.
Supported Operations
The following operations can be used with the resource allocation record.
add | addList | delete | deleteList | get | getDeleted | getList | getSelectValue | search | update | updateList | upsert | upsertList
You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.
Field Definitions
To create a new resource allocation record, you must reference two existing NetSuite records, as follows:
-
project — A reference to a project record defined at Lists > Relationships > Projects. Note that in some NetSuite accounts, projects are referred to as jobs.
-
allocationResource — A reference to an employee record, defined at Lists > Employees > Employees, for which the Project Record option has been checked. The Project Resource box is located on the Human Resources tab of the employee record.
You are also required to provide values for several other fields. Refer to the SOAP Schema Browser for details on all available body fields, sublist fields, search filters, and search joins. For details, see the SOAP Schema Browser’s resource allocation reference page.
For information on using the SOAP Schema Browser, see SOAP Schema Browser.
Code Samples
Refer to the following examples for help interacting with the resource allocation record.
Creating a Record
The following example shows how to create a resource allocation record.
Java
public void testAddResourceAllocation() throws Exception
{
// This operation requires a valid session
this.login(true);
ResourceAllocation resourceAllocation = new ResourceAllocation();
String extId = "TKO_"+rs();
resourceAllocation.setExternalId(extId);
RecordRef allocationResourceRef = new RecordRef();
allocationResourceRef.setInternalId("46");
resourceAllocation.setAllocationResource(allocationResourceRef);
RecordRef projectRef = new RecordRef();
projectRef.setInternalId("43");
resourceAllocation.setProject(projectRef);
resourceAllocation.setStartDate(Calendar.getInstance());
resourceAllocation.setEndDate(Calendar.getInstance());
resourceAllocation.setAllocationAmount(4.0);
resourceAllocation.setAllocationUnit(ResourceAllocationAllocationUnit._hours);
RecordRef allocationTypeHardRef = new RecordRef();
allocationTypeHardRef.setInternalId("1");
resourceAllocation.setAllocationType(allocationTypeHardRef);
c.addRecord(resourceAllocation);
}
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:passport soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="urn:messages_2017_1.platform.webservices.netsuite.com">
<ns2:email xmlns:ns2="urn:core_2017_1.platform.webservices.netsuite.com">nlbuild@netsuite.com</ns2:email>
<ns3:password xmlns:ns3="urn:core_2017_1.platform.webservices.netsuite.com">********</ns3:password>
<ns4:account xmlns:ns4="urn:core_2017_1.platform.webservices.netsuite.com">3604360</ns4:account>
<ns5:role internalId="37" xmlns:ns5="urn:core_2017_1.platform.webservices.netsuite.com"/>
</ns1:passport>
</soapenv:Header>
<soapenv:Body>
<add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record externalId="TKO_drPIik" xsi:type="ns6:ResourceAllocation" xmlns:ns6="urn:scheduling_2017_1.activities.webservices.netsuite.com">
<ns6:allocationResource internalId="46" xsi:type="ns7:RecordRef" xmlns:ns7="urn:core_2017_1.platform.webservices.netsuite.com"/>
<ns6:project internalId="43" xsi:type="ns8:RecordRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
<ns6:startDate xsi:type="xsd:dateTime">2013-04-08T08:48:30.249Z</ns6:startDate>
<ns6:endDate xsi:type="xsd:dateTime">2013-04-08T08:48:30.249Z</ns6:endDate>
<ns6:allocationAmount xsi:type="xsd:double">8.0</ns6:allocationAmount>
<ns6:allocationUnit xsi:type="ns9:ResourceAllocationAllocationUnit" xmlns:ns9="urn:types.scheduling_2017_1.activities.webservices.netsuite.com">_hours</ns6:allocationUnit>
<ns6:allocationType internalId="1" xsi:type="ns10:RecordRef" xmlns:ns10="urn:core_2017_1.platform.webservices.netsuite.com"/>
</record>
</add>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com">
<platformMsgs:nsId>WEBSERVICES_3604360_040820133886900932011092328_d580194f6302</platformMsgs:nsId>
</platformMsgs:documentInfo>
</soapenv:Header>
<soapenv:Body>
<addResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<writeResponse>
<platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
<baseRef internalId="7" externalId="TKO_drPIik" type="resourceAllocation" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
</writeResponse>
</addResponse>
</soapenv:Body>
</soapenv:Envelope>
Updating a Record
The following example shows how to update a resource allocation record.
Java
public void testUpdate() throws Exception
{
c.useRequestLevelCredentials();
ResourceAllocation resourceAllocation = new ResourceAllocation();
resourceAllocation.setInternalId("7");
resourceAllocation.setNotes("WS");
c.updateRecord(resourceAllocation);
}
SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:passport soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="urn:messages_2017_1.platform.webservices.netsuite.com">
<ns2:email xmlns:ns2="urn:core_2017_1.platform.webservices.netsuite.com">nlbuild@netsuite.com</ns2:email>
<ns3:password xmlns:ns3="urn:core_2017_1.platform.webservices.netsuite.com">********</ns3:password>
<ns4:account xmlns:ns4="urn:core_2017_1.platform.webservices.netsuite.com">3604360</ns4:account>
<ns5:role internalId="37" xmlns:ns5="urn:core_2017_1.platform.webservices.netsuite.com"/>
</ns1:passport>
</soapenv:Header>
<soapenv:Body>
<update xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record internalId="7" xsi:type="ns6:ResourceAllocation" xmlns:ns6="urn:scheduling_2017_1.activities.webservices.netsuite.com">
<ns6:notes xsi:type="xsd:string">WS</ns6:notes>
</record>
</update>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com">
<platformMsgs:nsId>WEBSERVICES_3604360_04052013633377230522277203_1e0d36f5119c6</platformMsgs:nsId>
</platformMsgs:documentInfo>
</soapenv:Header>
<soapenv:Body>
<updateResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<writeResponse>
<platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
<baseRef internalId="7" type="resourceAllocation" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
</writeResponse>
</updateResponse>
</soapenv:Body>
</soapenv:Envelope>