Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class PartnersInq : PXGraph<PartnersInq>
{
public PartnersInq()
{
GenerateColumns(Partners.Cache, Courses.Select().Select(m => (UNCourse)m).ToList());
}
protected void GenerateColumns(PXCache sender, List<UNCourse> cources)
{
foreach (UNCourse cource in cources)
{
String key = cource.CourseCD.Trim();
String name = cource.Name;
if (!sender.Fields.Contains(key))
{
sender.Fields.Add(key);
this.FieldSelecting.AddHandler("Partners", key, (PXCache cache, PXFieldSelectingEventArgs args) =>
{
PartnerStatistics row = args.Row as PartnerStatistics;
if (row == null)
args.ReturnState = cache.GetStateExt<PartnerStatistics.badgeTemplate>(null);
else
{
Int32 value = 0;
row.Archived.TryGetValue(key, out value);
args.ReturnValue = cache.GetValueExt<PartnerStatistics.badgeTemplate>(row);
if (args.ReturnValue is PXFieldState)
{
((PXFieldState)args.ReturnValue).Value = value;
}
else args.ReturnValue = value;
}
if (args.ReturnState != null && args.ReturnState is PXFieldState)
{
PXFieldState fs = args.ReturnState as PXFieldState;
fs.SetFieldName(key);
fs.Visible = true;
fs.Visibility = PXUIVisibility.Visible;
fs.DisplayName = name;
}
});
this.FieldUpdating.AddHandler("Partners", key,
(PXCache cache, PXFieldUpdatingEventArgs args) =>
{
});
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.