Adding a Fixed Bid Milestone Billing Schedule

The following example shows how to create a fixed bid milestone billing schedule. In this example, lines are created in the milestone sublist. (The only way to populate the milestone sublist is when creating a fixed bid milestone billing schedule. For more details, see Milestone Sublist.)

The milestone sublist determines when bills will be sent. Each line can reference a date that you manually specify or an existing milestone task record.

If you want your sublist lines to reference existing milestone tasks, use code like the following for each sublist line:

          // In C#:

RecordRef myMilestoneTask1 = new RecordRef();
myMilestoneTask1.type = RecordType.projectTask;
myMilestoneTask1.typeSpecified = true;
myMilestoneTask1.internalId = "3425";
myBillingSchedule.milestoneList.billingScheduleMilestone[0] = new BillingScheduleMilestone();
myBillingSchedule.milestoneList.billingScheduleMilestone[0].projectTask = myMilestoneTask1;
myBillingSchedule.milestoneList.billingScheduleMilestone[0].milestoneAmount = 45;
myBillingSchedule.milestoneList.billingScheduleMilestone[0].milestoneAmountSpecified = true; 

        

Any milestone task you reference must have as its parent the project identified in the billing schedule’s project body field. In other words, you can’t reference Project A in the project body field and then list milestone tasks from Project B in the sublist. If you do, the add operation fails.

You can also manually choose a date for each line in the milestone sublist, as shown in the following sample.

See also Milestone Sublist.

Note:

Be aware that even after you create a billing schedule, it is not automatically attached to any project record (even though you had to reference one when creating the schedule). You must manually attach the billing schedule to the project record. For details, see Attaching a Billing Schedule to a Project.

C#

          private void addFixedBidMilestoneBillingSchedule()
{

   // Create object.

   BillingSchedule myBillingSchedule = new BillingSchedule();


   // Set an external Id.

   myBillingSchedule.externalId = "103A";


   // Set the billing schedule type.

   myBillingSchedule.scheduleType = BillingScheduleScheduleType._fixedBidMilestone;
   myBillingSchedule.scheduleTypeSpecified = true;


   // Identify an existing project recorded listed at
   // Lists > Relationships > Projects.

   RecordRef projectRef = new RecordRef();
   projectRef.internalId = "1461";
   projectRef.type = RecordType.job;
   projectRef.typeSpecified = true;
   myBillingSchedule.project = projectRef;
     
   
   // Give the schedule a name.

   myBillingSchedule.name = "Milestone Schedule - w/Fixed Dates";
           

   // Create a sublist that can accommodate three lines
            
   myBillingSchedule.milestoneList = new BillingScheduleMilestoneList();
   myBillingSchedule.milestoneList.billingScheduleMilestone = new BillingScheduleMilestone[3];


   // Populate each line with a manually defined date and billing percentage.

   DateTime nextWeek = new DateTime(2014, 4, 5);
   myBillingSchedule.milestoneList.billingScheduleMilestone[0] = new BillingScheduleMilestone();
   myBillingSchedule.milestoneList.billingScheduleMilestone[0].milestoneDate = nextWeek;
   myBillingSchedule.milestoneList.billingScheduleMilestone[0].milestoneDateSpecified = true;
   myBillingSchedule.milestoneList.billingScheduleMilestone[0].milestoneAmount = 25;
   myBillingSchedule.milestoneList.billingScheduleMilestone[0].milestoneAmountSpecified = true;

   DateTime inTwoWeeks = new DateTime(2014, 4, 19);
   myBillingSchedule.milestoneList.billingScheduleMilestone[1] = new BillingScheduleMilestone();
   myBillingSchedule.milestoneList.billingScheduleMilestone[1].milestoneDate = inTwoWeeks;
   myBillingSchedule.milestoneList.billingScheduleMilestone[1].milestoneDateSpecified = true;
   myBillingSchedule.milestoneList.billingScheduleMilestone[1].milestoneAmount = 25;
   myBillingSchedule.milestoneList.billingScheduleMilestone[1].milestoneAmountSpecified = true;

   DateTime nextMonth = new DateTime(2014, 5, 5);
   myBillingSchedule.milestoneList.billingScheduleMilestone[2] = new BillingScheduleMilestone();
   myBillingSchedule.milestoneList.billingScheduleMilestone[2].milestoneDate = nextMonth;
   myBillingSchedule.milestoneList.billingScheduleMilestone[2].milestoneDateSpecified = true;
   myBillingSchedule.milestoneList.billingScheduleMilestone[2].milestoneAmount = 25;
   myBillingSchedule.milestoneList.billingScheduleMilestone[2].milestoneAmountSpecified = true;

  
   // Execute the add operation.

   _service.add(myBillingSchedule);

} 

        

SOAP Request

          <soapenv:Body>
   <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <record xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com" xsi:type="q1:BillingSchedule" externalId="103A">
         <q1:scheduleType>_fixedBidMilestone</q1:scheduleType>
         <q1:name>Milestone Schedule - w/Fixed Dates</q1:name>
         <q1:project internalId="1461" type="job" />
         <q1:milestoneList>
            <q1:billingScheduleMilestone>
               <q1:milestoneAmount>25</q1:milestoneAmount>
               <q1:milestoneDate>2014-04-05T00:00:00</q1:milestoneDate>
         </q1:billingScheduleMilestone>
            <q1:billingScheduleMilestone>
               <q1:milestoneAmount>25</q1:milestoneAmount>
               <q1:milestoneDate>2014-04-19T00:00:00</q1:milestoneDate>
         </q1:billingScheduleMilestone>
            <q1:billingScheduleMilestone>
               <q1:milestoneAmount>25</q1:milestoneAmount>
               <q1:milestoneDate>2014-05-05T00:00:00</q1:milestoneDate>
            </q1:billingScheduleMilestone>
         </q1:milestoneList>
      </record>
   </add>
</soapenv:Body> 

        

SOAP Response

          <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="34" externalId="103A" type="billingSchedule" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </addResponse>
</soapenv:Body> 

        

Related Topics

Billing Schedule
Billing Schedule Types
Billing Schedule Body Fields and Sublist Fields
Billing Schedule Supported Operations
Billing Schedule Code Samples
add
Adding a Fixed Bid Milestone Billing Schedule
Attaching a Billing Schedule to a Project
SuiteTalk SOAP Web Services Platform Overview
Advanced Billing Overview
Applying Billing Schedules

General Notices