Accounts receivable/Common/Free text invoices/All free text invoices > select & open any free text invoice
i have created One button (MovieCinema) in below form.
when the MovieCinema form is open
I just want Collection Column total , in Below Line Collection Total Field..
for this I have Created Two Table MovieCinemaLine & MovieCinema Header.
Please suggest How to achieve this, what is code & what is method for this.
Hi Praveen,
I don't know how you designed your tables, but you need to add a method like below (and adjust it) to the header table and on the form control you need to specify DataSource property as a header data source and DataMethod as the name of the method.
display Amount totalCollections() { RM_MovieCinemaLine RM_MovieCinemaLine; ; select sum(Collections) from RM_MovieCinemaLine where RM_MovieCinemaLine.HeaderRecId = this.RecId; return RM_MovieCinemaLine.Collections; }
Looks like you also have an issue with relations, you can't do relations like Header.RecId = Line.RecId, because RecId is generated by the system each time when record inserted for each table separately and values will be different. You may need to add RefRecId field to the line and fill it with Header.RecId value when you save the record and use it in the relation instead of Line.RecId
in option 1 st what is the exact code of display method for this.
Hi Praveen,
You have a couple of options here:
1. Create a display method on the header table to sum up values from lines docs.microsoft.com/.../using-the-display-method-modifier
2. Create a real field on the header table and update it by the sum of lines when a record is inserted\updated\deleted on the line level.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156