Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

Card Page Not Updating Record

Posted on by 372

Hello,

I made a table, a list page, and a card page. I linked them all, however when ever i try to make edits on the card, it is not updating the record. Even just clicking refresh all the values revert back to what they were when the card opened.

Thanks,

-Chaz Kim

  • Suggested answer
    THE Italian Profile Picture
    THE Italian on at
    RE: Card Page Not Updating Record

    You can use global variable in a page. Assign them in OnInit page and they will persists.

    If you want to change them, then you have to trigger CurrPage.UPDATE whenever you change them.

    When page is closing they are gone.

    Also use property refreshOnActivate = true

  • ChazKimRP Profile Picture
    ChazKimRP 372 on at
    RE: Card Page Not Updating Record

    It is not really answered yet. Not sure why i cant have variables as fields on the page?

  • Suggested answer
    THE Italian Profile Picture
    THE Italian on at
    RE: Card Page Not Updating Record

    Thank you. Remember to mark this thread as answered.

  • ChazKimRP Profile Picture
    ChazKimRP 372 on at
    RE: Card Page Not Updating Record

    Hello,

    Here is one of the versions when i started playing with the properties to get it to work. Once I made a new object ID with out the Variable fields it worked.

    page 50122 FP_FinanceProgramCard
    {
        PageType = Card;
        SourceTable = FP_FinanceProgram;
        Caption='Finance Program Card';
        Editable=true;
        ModifyAllowed=true;
        DeleteAllowed=true;
        InsertAllowed=true;
        LinksAllowed=true;
    
    
        layout
        {
            area(content)
            {
                group(General)
                {
                    field("No.";"No.")
                    {
                        Importance=Promoted;
                    }
                    field("Finance Company";"Finance Company")
                    {
                        Importance=Promoted;
                    }
                    field(Description;Description)
                    {
    
                    }
                    field("Reference No.";"Reference No.")
                    {
    
                    }
                    field("Manufacturer Code";"Manufacturer Code")
                    {
    
                    }
                    field("Loan Duration";"Loan Duration")
                    {
    
                    }
                    field("Payment Factor";"Payment Factor")
                    {
                        ToolTip='Specifies the amount to multiply by loan amount to get monthly payment.';
                    }
                    field("Interest Rate(%)";"Interest Rate(%)")
                    {
    
                    }
                    field("Start Date";"Start Date")
                    {
                        ToolTip='Specifies when the program starts.';
                    }
                    field("End Date";"End Date")
                    {
                        ToolTip='Specifies when the program ends.';
    
                    }
                    field("Minimum Loan Amount";"Minimum Loan Amount")
                    {
    
                    }
                    field("Maximum Loan Amount";"Maximum Loan Amount")
                    {
    
                    }
                    field("Dealer Cost Type";"Dealer Cost Type")
                    {
                        ToolTip='Specifies the type of cost the dealer fee is. Percentage of the loan, or a fixed amount.';
                    
                    }
                    field("Dealer Cost Amount";"Dealer Cost Amount")
                    {
                        ToolTip='Specifies the amount of the dealer cost. If Dealer Cost Type is % then this is the percentage of the loan. If Dealer Cost Type is $ then this is the fixed amount the dealer is charged.';
                        
                    }
                    field("Customer Fee Type";"Customer Fee Type")
                    {
                        ToolTip='Specifies the type of cost the customer fee is. Percentage of the loan, or a fixed amount.';
    
    
                    }
                    field("Customer Fee Amount";"Customer Fee Amount")
                    {
                        ToolTip='Specifies the amount of the Customer fee. If Customer Cost Type is % then this is the percentage of the loan. If Dealer Cost Type is $ then this is the fixed amount the dealer is charged.';
                    }
                    field("Created By User ID";"Created By User ID")
                    {
                        Importance=Additional;
                        Enabled=false;
                    }
                    field("Creation Date & Time";"Creation Date & Time")
                    {
                        Importance=Additional;
                        Enabled=false;
                    }
                    field("Last Date & Time Modified";"Last Date & Time Modified")
                    {
                        Importance=Additional;
                        Enabled=false;
                    }
                }
                group("Quoting Activities")
                {
                    field(LoanEstimate;LoanEstimate)
                    {
                        Caption='Loan Estimate';
                        trigger OnValidate();
                        begin 
                            if LoanEstimate<>0 then
                            begin 
                                CalculateMonthlyPayment;
                            end;
                        end;
                    }
                    field(IncludeDealerFee;IncludeDealerFee)
                    {
                        Caption='Include Dealer Fee';
                        trigger OnValidate();
                        begin 
                            CalculateMonthlyPayment;
                        end;
                    }
                    field(StartPaymentDate;StartPaymentDate)
                    {
                        Caption='Start Payment Date';
                        trigger OnValidate();
                        BEGIN
                            CalculateMonthlyPayment;
                            CalculateLastPayment();
                        END;
                    }
                    field(MonthlyPaymentEstimate;MonthlyPaymentEstimate)
                    {
                        Caption='Monthly Payment Est.';
                        Editable=false;
                    }
                    field(LastPaymentDate;LastPaymentDate)
                    {
                        Caption='Last Payment Date';
                        Editable=false;
                    }
                    
                }
            }
        }
    
        actions
        {
            area(processing)
            {
                action(ActionName)
                {
                    trigger OnAction();
                    begin
    
                    end;
                }
            }
        }
        
        var
            LoanEstimate: Decimal;
            MonthlyPaymentEstimate: Decimal;
            StartPaymentDate: Date;
            LastPaymentDate: Date;
            IncludeDealerFee: Boolean;
        
        trigger OnOpenPage();
        begin 
            ResetQuotingActivities;
        end;
    
        trigger OnModifyRecord() : Boolean;
        begin
            
        end;
    
        procedure ResetQuotingActivities()
        begin 
            LoanEstimate:=0;
            MonthlyPaymentEstimate:=0;
            StartPaymentDate:=0D;
            LastPaymentDate:=0D;
        end;
        procedure CalculateMonthlyPayment()
        var
        DealerCostAsPercent: Decimal;
        LoanEstimateWCost: Decimal;
        begin
            if LoanEstimate<>0 then
            begin 
                if IncludeDealerFee=true then
                begin 
                    if rec."Dealer Cost Type"=rec."Dealer Cost Type"::"$" then
                    begin 
                        MonthlyPaymentEstimate:= (LoanEstimate   rec."Dealer Cost Amount") * rec."Payment Factor";
                    end;
                    if Rec."Dealer Cost Type"="Dealer Cost Type"::"%" then
                        if rec."Dealer Cost Amount"<>0 then
                        begin 
                            DealerCostAsPercent:=rec."Dealer Cost Amount"/100;
                            LoanEstimateWCost:=(LoanEstimate*DealerCostAsPercent) LoanEstimate;
                            MonthlyPaymentEstimate:=LoanEstimateWCost*rec."Payment Factor"
                        end;
                end
                else
                MonthlyPaymentEstimate:= LoanEstimate*rec."Payment Factor";
            end
            else
            MonthlyPaymentEstimate:=0;
        end;
        procedure CalculateLastPayment()
        begin
            if StartPaymentDate=0D then
            LastPaymentDate:=0D
            else    
            LastPaymentDate:=CalcDate(rec."Loan Duration",StartPaymentDate);
        end;
    }

  • THE Italian Profile Picture
    THE Italian on at
    RE: Card Page Not Updating Record

    Is it possible to have the object here in txt format?

  • ChazKimRP Profile Picture
    ChazKimRP 372 on at
    RE: Card Page Not Updating Record

    Hello,

    That was not the issue I am positive. I wound up making a new object id, this time i removed the variable fields from the page, and it now works. Can you not use variables on a page as temp fields?

    Its a finance program card, and I had variables that the end user can use to estimate a loan payment.

    Thanks,

    -Chaz Kim

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,023 Moderator on at
    RE: Card Page Not Updating Record

    Hi,

    Please check if SourceTableTemporary = Yes, it must be NO

    Cheers

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans