There is a new string array return type which looks very promising but we have not been able to use it successfully. Our server-side UDMethods which use this return type don’t work. We don’t get an error message but the calling method exits and we don’t get a return value.
We are able to write the same method to return a delimited string which can be split by the calling method. So, we know the method is working otherwise. This work-around is okay but returning a string array would be much more elegant.
Any suggestions for debugging would be greatly appreciated.
I struggled with returning an array in the past and it might have been a bug, now I am able to return arrays without issues.
You should be able to have a return type of string and then in the method you have to declare something like
String returnValue = new String[46];
Then populate it as needed
Then
return returnValue;
In your calling routine access the individual members as needed, since they are strings anything you need as a decimal or other type will need to be converted.
In your calling routine declare the array to be the same size as you are returning. if I recall just creating it as an empty array causes a problem.
The other method I use to return data especially when it is more than a few items is to build a Data table in the method, then covert it to a formatted Json string to return as a string type to the caller. Then convert the Json string back into a data table in the caller. Data in the table will still be strings so can’t avoid the convert issue.
You’ll get there, just remember that there are heaps of other learning resources around for working through other peoples suggestions and techniques… Dare I say your peer AI programmer buddy is a very helpful tool for learning.
Getting arrays to work was a pain. I’ll get you a complete example a little later today, have to get my Monday morning administrative stuff out of the way first.
using a classic configurator, I will test this in Kinetic next
Client side, it is called as an on leave event for one of the radio buttons.
Result
We have a bug with Kinetic. Code works fine in Classic, but not in Kinetic. Kinetic doesn’t handle a server side method that returns a string array. Gives no error or indication that things aren’t working.
This code when attached to a button click just looks at me, no message comes up. If I comment out the call to ServerSide method I get the messageBox slide out.
string strTmp = new string[4];
Glad to help. Unfortunately the Kinetic configurator is quite buggy. I am working on several configurators for clients and routinely I open support calls. This is my third one in the last week.
Ironically, the reason we started working on the Kinetic configurator is that 2024.2.4 broke a couple of our Classic configurators. That issue is apparently resolved in 2024.2.8 and is documented elsewhere on Epiusers.
Overall, it hasn’t been too bad on the Kinetic configurator. There are user interface issues in the Designer but the end product is working okay so far in testing.
Hopefully we get some resolution on this issue from the support case. For now, we’ll just work around it with delimited strings.
There is a case CS0004750009, they asked me to check to see if it is still an issue, not sure if they think it was fixed as part of something or ?? I will be checking today to confirm if still a problem. The Kinetic configruator is still not ready for prime time in my mind. They changed how double/decimal are treated between methods and I have a configurator that will need major surgery to resolve the issue.