I am attempting to wrap my head around how to pass the output parameter from a function to a data view. In this use case, I am adding a panel grid card to the Activity panel in the Part Tracker module:
The idea is that when the button is clicked, it will pull the top 10 listed customers within the customer table in Epicor. However, what happens currently is the form loads, and the panel grid is grayed out, like it’s not initializing correctly:
Any tips and tricks on how to troubleshoot this would be greatly appreciated.
Attached, you will find the simple library and function I created for this attempt, as well as screenshots that denote the steps I’ve taken thus far.
FunctionToGridTest.efxb (2.0 KB)
C# From Function:
using System.Text.Json;
using System.Collections.Generic;
using System.Linq;
var result = new List<Dictionary<string, object>>();
var customers = Db.Customer
.Where(c => c.Company == Session.CompanyID)
.Take(10);
foreach (var cust in customers)
{
result.Add(new Dictionary<string, object> {
{ "CustID", cust.CustID },
{ "Name", cust.Name },
{ "City", cust.City }
});
}
// Convert to JSON string
this.Result = System.Text.Json.JsonSerializer.Serialize(result);
Data View:
Grid properties:
Event:
Control:
Kinetic-Function:
Kinetic-Function Response Parameter: