CreateDepartment - accountsIQ/API-Wiki GitHub Wiki

The CreateDepartment is used to create a new BI Code (or Department) in the system. You can amend it later on with UpdateDepartment.

Declaration

C#

public WSResultStatus CreateDepartment(String token, String id, String description, String analysisCode1, String analysisCode2, String analysisCode3, String analysisCode4, String analysisCode5, String analysisCode6)

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
departmentID String The unique and immutable code for this BI Code / Department. This must not already exist in the system.
description String The description of the BI Code / Department. This appears on listings and reports.
analysisCode1 String Optionally link this BI Code to a BI Element of the first BI Dimension. This is used to classify the same data movement in up to 6 different BI Dimensions.
analysisCode2 String Optionally link this BI Code to a BI Element of the second BI Dimension. This is used to classify the same data movement in up to 6 different BI Dimensions.
analysisCode3 String Optionally link this BI Code to a BI Element of the third BI Dimension. This is used to classify the same data movement in up to 6 different BI Dimensions.
analysisCode4 String Optionally link this BI Code to a BI Element of the fourth BI Dimension. This is used to classify the same data movement in up to 6 different BI Dimensions.
analysisCode5 String Optionally link this BI Code to a BI Element of the fifth BI Dimension. This is used to classify the same data movement in up to 6 different BI Dimensions.
analysisCode6 String Optionally link this BI Code to a BI Element of the sixth BI Dimension. This is used to classify the same data movement in up to 6 different BI Dimensions.

You do not need to send any analysis code ID (BI Dimension Element code), or you can send one or multiple of them. You can send for instance the third and fourth dimension code without sending the first or second.

Example

The following example creates an invoice, a receipt and perform an allocation:

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if( auth != null )
{
	var result = ws.CreateDepartment(auth, "IE-PL1", null, null, "Ireland", "Product Line 1", null, null);
    if(result.Status != OperationStatus.Created) throw new Exception("");

    var department = ws.GetDepartmentList(auth).Result.First(d => d.DepartmentID == "IE-PL1");
}

See Also

⚠️ **GitHub.com Fallback** ⚠️