Announcements
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
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
It is not really answered yet. Not sure why i cant have variables as fields on the page?
Thank you. Remember to mark this thread as answered.
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; }
Is it possible to have the object here in txt format?
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
Hi,
Please check if SourceTableTemporary = Yes, it must be NO
Cheers
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156