-
Notifications
You must be signed in to change notification settings - Fork 2
GetAnalysisDimensionSetup
devaiq edited this page May 10, 2019
·
1 revision
The GetAnalysisDimensionSetup
function returns the analysis set up of the tracking labels assigned to transactions (the labels are called DepartmentID
in the API for historical reasons).
Each label can be linked up to six different values under six different analysis dimensions.
public WSResult2OfWSAnalysisDimension GetAnalysisDimensionSetup(string token)
Public Function GetAnalysisDimensionSetup(ByVal token As String) As WSResult2OfWSAnalysisDimension
Here is the parameter list required to use the function:
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
The returned structure of type WSAnalysisDimension
has the following members:
Name | Type | Description |
---|---|---|
Code | String | The short-hand code of the dimension. For example, a `Country` location, could have an short-hand code of `CTRY`. |
Description | String | The description of the dimension. For example: `Country`. |
DimensionCodes | WSAnalysisDimensionCode[] | Detail of the trial balance split by GL Account Code. |
The WSAnalysisDimensionCode
structure has the following members:
Name | Type | Description |
---|---|---|
Code | String | The short-hand code of the dimension code. For example, under a `Country` location, could have an short-hand code of `IRE` for Ireland. |
Code | String | The description code of the dimension code. For example, under a `Country` location, could have an entry with a description of `Ireland` (and a short-hand code of `IRE`). |
// Integration is the reference to the accountsIQ web service
Integration ws = new Integration();
// Try to login using the entity ID, the integrator partner key and the user provided key
string auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
WSResult2OfWSAnalysisDimension result = ws.GetAnalysisDimensionSetup(auth);
if (result.Status == OperationStatus.Success)
{
// The operation succeeded
Console.WriteLine(String.Format("Dimension [{0}] {1}", result.Result.Code, result.Result.Description));
foreach(var entry in result.Result.DimensionCodes)
{
Console.WriteLine(String.Format("\t - [{0}] {1}", entry.Code, entry.Description));
}
}
else if (result.HasExpired)
{
// The login has expired. Log the user in again.
}
else if (result.Status == OperationStatus.Failure)
{
// The operation failed.
// The ErrorCode field will provide more information as to what is the cause of the failure.
}
}
else
{
// The login failed. For security reasons, we cannot give more information on what went wrong.
// The most likely cause is an incorrect user key or an expired partner key.
// Put here your error handling for invalid login. Either one of the three piece of information can be incorrect.
}