MAster-Deatil Form, Need Some Help.
See original GitHub issue've a Master Detail Editor that seems to work, partially, I can’t get the detail form to populate however.
This is what I’ve done with the code, to date. Hopefully I’ve missed something very simple, if I need to write some code to get the records, that’s fine as well, but doesn’t seem to be required based on the tutorials, etc., etc.
Each table has a field defined as int32, identity, primary key, auto increment (named BudgetKey) The Detail table has an additional field defined as int32, foreign key field. This field contains the primary key value of the master table of the relationship. I can define the relationship via an alternate method but the relationship is a bit more complex.
Master Part of the Relation:
RevenueSummaryRow.cs: // … … [DisplayName(“Distribution Type”), Column(“Distribution_Type”), Size(2)] public String DistributionType { get { return Fields.DistributionType[this]; } set { Fields.DistributionType[this] = value; } }
[DisplayName("Version")]
public Int32? Version
{
get { return Fields.Version[this]; }
set { Fields.Version[this] = value; }
}
[DisplayName("Periods"), MasterDetailRelation(foreignKey: "RevenueSummaryLink"), ClientSide]
public List<RevenuePeriodsRow> PeriodList
{
get { return Fields.PeriodList[this]; }
set { Fields.PeriodList[this] = value; }
}
… … public RowListField<RevenuePeriodsRow> PeriodList; public RowFields() : base(“[budgets].[Revenue_Summary]”) … // RevenueSummaryFoirm.cs: // … public Int32 Version { get; set; }
[Category("Periods")]
[RevenuePeriodsEditor]
public List<Entities.RevenuePeriodsRow> RevenuePeriodList { get; set; }
#region HiddenFields
… // The Detail Portion of the Relationship RevenuePeriodsRow.cs: // … //[Hidden] [DisplayName(“Budget Key”), PrimaryKey, Identity] public Int32? BudgetKey { get { return Fields.BudgetKey[this]; } set { Fields.BudgetKey[this] = value; } }
//[Hidden]
[DisplayName("Revenue Summary Link"), NotNull, ForeignKey("[budgets].Revenue_Summary", "BudgetKey")]
[LeftJoin("jRevenueSummaryLink"), TextualField("RevenueSummaryLinkCustomerNumber")]
public Int32? RevenueSummaryLink
{
get { return Fields.RevenueSummaryLink[this]; }
set { Fields.RevenueSummaryLink[this] = value; }
}
I created the following RevenuePeriodEditor.ts:
/// <reference path="../../../Common/Helpers/GridEditorBase.ts" />
namespace HgiBudgets.HGIBudgetsDB {
@Serenity.Decorators.registerClass()
export class RevenuePeriodsEditor extends Common.GridEditorBase<RevenuePeriodsRow> {
protected getColumnsKey() { return "HGIBudgetsDB.Revenue.RevenuePeriods"; }
protected getDialogType() { return RevenuePeriodsDialog; }
protected getLocalTextPrefix() { return RevenuePeriodsRow.localTextPrefix; }
constructor(container: JQuery) {
super(container);
}
protected getAddButtonCaption() {
return "Add Period";
}
}
}
Any assistance is greatly appreciated.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)

Top Related StackOverflow Question
No problem, @jsbUSMC spotted, congrats.
Gentlemen, I have found the issue, to many late nights doing C#, Entity Framework, and ASP.NET MVC 5 tutorials and then working on the program with the SERENE manual in hand.
I had defined the list as RevenuePeriodList in the Master Form and as PeriodList everywhere else. I changed the name to RevenuePeriodsList in all locations and now the Detail Grid is populating with the correct data.
Thank you both so much for your input and help to assist with finding the issue.
volkanceylan, I haven’t posted the Gist because the issue has been resolved, but if you’d still like it I’d be more than happy to post the items you requested.