Adding a Milestone Task Example

The following example shows how to add a milestone task.

C#

          private void addMilestone()
{


   //Create object

   ProjectTask newMilestoneTask = new ProjectTask();


   // Set a value for title, which is required, and externalId, which is preferred.
   // Because this is a milestone task, omit an estimatedWork value.

   newMilestoneTask.title = "Phase I Goals Met";
   newMilestoneTask.externalId = "125I";


   // Every milestone task must be associated with a project record. Identify that record here.

   RecordRef projectRef = new RecordRef();
   projectRef.internalId = "1146";
   newMilestoneTask.company = projectRef;

   _service.add(newMilestoneTask);

} 

        

SOAP Request

          <soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Header>
        <passport xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <email xmlns="urn:core_2017_1.platform.webservices.netsuite.com">user@netsuite.com</email>
            <password xmlns="urn:core_2017_1.platform.webservices.netsuite.com">**********</password>
            <account xmlns="urn:core_2017_1.platform.webservices.netsuite.com">12345</account>
            <role internalId="3" xmlns="urn:core_2017_1.platform.webservices.netsuite.com"/>
        </passport>
        <preferences xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"/>
    </soap:Header>
    <soap:Body>
        <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <record externalId="125I" xsi:type="q1:ProjectTask" xmlns:q1="urn:scheduling_2017_1.activities.webservices.netsuite.com">
                <q1:title>Phase I Goals Met</q1:title>
                <q1:company internalId="1146"/>
            </record>
        </add>
    </soap:Body>
</soap:Envelope> 

        

SOAP Response

          <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
        <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2017_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_1013519_09132013399478101126866537_780d0420bb560</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 xsi:type="platformCore:RecordRef" type="projectTask" externalId="125I" internalId="2821" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
            </writeResponse>
        </addResponse>
    </soapenv:Body>
</soapenv:Envelope> 

        

Related Topics

Project Task
Project Tasks Versus Milestone Tasks
Project Task Supported Operations
Project Task Field Definitions
Project Task Permissions
Adding a Project Task Example
Using Project Management
Creating a Project Task Record
Assigning Resources to Project Tasks
Enabling Project Features

General Notices