Working with Lists #27
Closed
PPetterssonSO
started this conversation in
General
Replies: 1 comment 5 replies
-
|
Hello @Nawksen, I'm not sure what you mean, this code works: try
{
var listAgent = soApi.getListAgent();
var listOfCountries = [752];
const result = await listAgent.getCountryListAsync(listOfCountries);
result.forEach(function (value) {
context.result.body = value.name;
});
}
catch
{
context.result.body = "hit the catch";
}So maybe there is something with your custom printLine-function (?) Can you try my snippet and see if it works for you? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We are having trouble figuring out how to work with the list agents.
It always crashes, without hitting the catch.
For example:
try
{
var listAgent = soApi.getListAgent();
var listOfCountries = [752];
printLine("It passes this point"); // <-- custom print function..
const mmm = await listAgent.getCountryListAsync(listOfCountries); //Or any other function in listAgent..
printLine("It does not pass this point");
}
catch
{
printLine("error"); // <-- custom print function..
}
Only returns: It passes this point
And, for more generic functions, like: getAllCountriesAsync
What is SO.List_GetAllCountriesRequests? that's required as a parameter?
How do we populate it, and with what?
SO.ListAgent.getAllCountriesAsync(request: SO.List_GetAllCountriesRequest, webapi_options?: base.WebApiRequestOptions): Promise<SO.Country[]> (+1 overload)
Beta Was this translation helpful? Give feedback.
All reactions