Kinetic 2025.2: Using customization in classic Customizations

Currently migrating from 10.2.100 to Kinetic 2025.2. So this is my first function I am trying to write.

I have a function created:

Library: QAJobInspection
Function: GetBinNum
Input: jobNum (string)
Output: binNum (string)

The function, Invokes BO Method - Ice.UD101.GetByID → Set Argument/Variable: binNum to tsUD101UD101Row.ShortChar05

I have a customization with a btnText created that

{
			var restClient = new RestClientBuilder()
				.SetDefaultApiKey(ApiKey)
				.UseSession(this.oTrans.CoreSession)
				.Build();

			using (restClient)
			{
			    try
			    {
			        var payload = new RestContent(
			            new
			            {
			                jobNum = "187974"
			            });
			
			        var response = restClient.Function.Post(
			            "QAJobInspection",
			            "GetBinNum",
			            payload,
			            published: true);
			
			        var answer = response.GetAnonymousResult(
			            new
			            {
			                binNum = (string)null
			            });					
			    }
			    catch (Exception ex)
			    {
			        MessageBox.Show(ex.ToString());
			    }
			}
}```

I debug this in Visual Studio and get no errors but I can not see any value from 'answer'.

I am trying to find some documentation on how to do this as per best practices, but I am coming up shy. 

Any help will be appreciated. I would be glad for some code examples. This is just proof of concept Hello World hitting the db.

How are you trying to access binNum from answer? Make sure you’re using answer.binNum
i.e

string responseParam = answer.binNum; // or whatever your var name is

Your code doesn’t show you actually trying to access the response parameter.
For example, if you wanted to show it in a text box somewhere on a form, your customization code would have

epiTextBox.Text = responseParam;

I am looking at it in Visual Studio debugging and parsing the answer. I’ll try the code and see.

Oh, I see what you mean, my apologies, you’re using the tickbox for debugging in Visual Studio, brain fart there.

How are you intending to use this function, i.e where are you intending to call it from and how are you going to use the return?

Right now I am doing this as proof of concept to get my head wrapped around functions. Basically a ‘Hello world’. I’ve read the ‘Advance Usage of Epicor Functions’ documentation pg 26 and trying to apply it to my db.

2 Likes

Awesome. I was just curious if you had a future plan for it is all. If you’ve got this figured out now I’m happy that you got it working.