UpdateProject - accountsIQ/API-Wiki GitHub Wiki
The UpdateProject
method modifies an existing Project in the Project Module instance associated to this entity.
public WSResultStatus UpdateProject(string token, string existingProjectCode, Project project)
Public Function UpdateProject(ByVal token As String,ByVal existingProjectCode As String, ByVal project As Project) As WSResultStatus
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
existingProjectCode | String | The project code in which to perform the update. If the value passed does not correspond to an existing project, an error stating this issue will be returned |
Project | Project | The updated Project information. |
The UpdateProject method will update an active Project on the Project Ledger system. It will use the Project Code as the key. If the user us trying to update the Project Code they will have to provide its original Project Code as the second parameter.
The operation returns a WSResultStatus object.
When the operation is successful, the Status property is OperationStatus.Success.
When the operation is unsucessful, the Status property is OperationStatus.Failure, and the ErrorCode property holds the precise error that happened.
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
// Assuming there's an existing project with Project Code = TSTMIL001
var updatedProjectInformation = new Project();
updatedProjectInformation.Name = "Updated Name";
updatedProjectInformation.AIQBICodeID = "DEPT2";
updatedProjectInformation.AIQCustomerCode = "CUSTOMER2";
var result = ws.UpdateProject(auth, "TSTMIL001", updatedProjectInformation);
Assert.Equal(OperationStatus.Success, result.Status);
}
Dim ws As New Integration
Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not Me.auth Is Nothing) Then
// Assuming there's an existing project with Project Code = TSTMIL001
var updatedProjectInformation = new Project();
updatedProjectInformation.Name = "Updated Name";
updatedProjectInformation.AIQBICodeID = "DEPT2";
updatedProjectInformation.AIQCustomerCode = "CUSTOMER2";
Dim result As OperationResult = ws.UpdateProject(auth, "TSTMIL001", updatedProjectInformation )
Assert.Equal(OperationStatus.Success, result.Status);
End If