question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
volkanceylancommented, Jul 13, 2016

No problem, @jsbUSMC spotted, congrats.

0reactions
mlutzowcommented, Jul 13, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10.4 Managing Master Detail Forms
A master detail form reflects a one-to-many relationship between two tables in a database. Typically, a master detail form displays a master row...
Read more >
Help with master-detail style form for patient admission
I have already created a form with Patient info, and there's a deck list where we can search by name, and edit details....
Read more >
Creating a master/detail form
After the master/detail form is created, if you want to add data from another ... Select some or all of the columns in...
Read more >
How to make a master-detail form/view?
I'd like to send an order form to customers that they fill in. They'll need to populate the form with their name from...
Read more >
Create a form that contains a subform (a one-to-many form)
A form/subform combination is sometimes referred to as a hierarchical form, a master/detail form, or a parent/child form. Subforms are especially effective when ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found