-
Notifications
You must be signed in to change notification settings - Fork 2
CreateProject
Leandro Rowies edited this page Oct 20, 2021
·
5 revisions
The CreateProject
method creates a new Project in the Project Module instance associated to this entity.
public WSResultStatus CreateProject(String token, Project project)
Public Function CreateProject(ByVal token As String, ByVal project As Project) As WSResultStatus
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
Project | Project | The Project to create. |
The CreateProject method will create a new active Project on the Project Ledger system.
The operation returns a WSResultStatus object.
When the operation is successful, the Status property is OperationStatus.Created.
When the operation is unsucessful, the Status property is OperationStatus.Failure or NotCreated, and the ErrorCode property holds the precise error that happened.
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
var newMilestoneProject = new Project
{
Name = "Test Milestone Project 1",
ProjectCode = "TST-MILESTONE-001",
BillingType = ProjectBillingType.Milestone,
PricingType = ProjectPricingType.ActivityRate,
Status = ProjectStatus.Confirmed,
AIQBICodeID = "DEPARTMENT1",
AIQCustomerCode = "CUSTOMER1",
CalendarRBGColour = RBGCalendarColour.RGB_000000,
CategoryNote = "Category is the default.",
Description = "Description as a quick overview note.",
StatusNote = "Note regarding the status of this project.",
ProjectManagerEmployeeNumber = "MANAGER-001"
};
var result = ws.CreateProject(auth, newMilestoneProject);
Assert.Equal(OperationStatus.Created, result.Status);
}
Dim ws As New Integration
Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not Me.auth Is Nothing) Then
var newMilestoneProject = new Project
{
Name = "Test Milestone Project 1",
ProjectCode = "TST-MILESTONE-001",
BillingType = ProjectBillingType.Milestone,
PricingType = ProjectPricingType.ActivityRate,
Status = ProjectStatus.Confirmed,
AIQBICodeID = "DEPARTMENT1",
AIQCustomerCode = "CUSTOMER1",
CalendarRBGColour = RBGCalendarColour.RGB_000000,
CategoryNote = "Category is the default.",
Description = "Description as a quick overview note.",
StatusNote = "Note regarding the status of this project.",
ProjectManagerEmployeeNumber = "MANAGER-001"
};
Dim result As OperationResult = ws.CreateProject(auth, newMilestoneProject)
Assert.Equal(OperationStatus.Created, result.Status);
End If