Form’s Caption

Recently I got a question from Forum.
Question: In Axapta (using Demo data), from Mainmenu, go to Accounts Payable -> Journals -> Invoices, open Invoice Journal form, then click Lines button. On the journal voucher form (LedgerJournalTransVendInvoice), you can see the caption of journal voucher form is “Journal voucher – Journal Vend_I, Journal number: 000048_003, Journal Type: Vendor invoice recording, Posted: No, Name of Journal: Vend_I”. Where do these come from, apparently they are not from the titelField and caption of LedgerJournalTable?
Here is the answer:
Because in LedgerJournalTransVendInvoice form, there is no titleDataSource that has been specified, the caption of LedgerJournalTransVendInvoice form will be determined by the relevant settings in the caller form (LedgerJournalTable). You can find that in the LedgerJournalTable table which is the datasource of LedgerJournalTable form, there are titleField1 and titleField2 which supposed to be displayed as form’s caption. But there is an override caption method under LedgerJournalTable table, which will return the displayed label instead of titilefields. So for the first two caption fields come from LedgerJournalTable table’s caption method. Then where do the last three caption fields (Journal Type, Posted and Name of Journal) come from? These three fields are relating to the effective query range of LedgerJournalTable form. For example, on Invoice Journal form (LedgerJournalTable), you select All instead of Open in the Show combo box, then click Lines again, you can see the caption of LedgerJournalTransVendInvoice form will be “Journal voucher – Journal Vend_I, Journal number: 000048_003, Journal Type: Vendor invoice recording, Name of Journal: Vend_I”. Why this happened? Because the query range for field Posted is not active now, it just queries for an open value instead of a specific value.
Please download an XPO file to have further understanding:
http://www.geocities.com/fred.shen/Test4FormCaption.zip
Advertisements
This entry was posted in Axapta Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s