name of the new field/form in the navision window

mark_christsmark_christs Member Posts: 156
Dear All,
I would like to ask you about how to insert a title in the navision title of a new menu item inserted in the menu button of a card. For example, if I open item card with no. A-1, description : parent item A, then in the top of navision window, the title would be : "Cronus International, PT.- Microsoft Business Solution Navision - A-1 Parent Item - Item Card".
If I click item button, select item variant, the title will be : "Cronus International, PT.- Microsoft Business Solution Navision - A-1 Parent Item - Item Variants". I have added my new form in the menu designers of the item card with action "runObject" and runObject is "form personnel name". But when I run it, the title only shows : "Cronus International, PT.- Microsoft Business Solution Navision - personnel name", I want it to be : "Cronus International, PT.- Microsoft Business Solution Navision - A-1 Parent Item - personnel name". I have tried to find how to do that but unsuccessful. ](*,)
Thanks beforehand for your answer.



rgds,
Mark

Comments

  • kinekine Member Posts: 12,562
    Check these properties on the form: DataCaptionExpr and DataCaptionFields
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • mark_christsmark_christs Member Posts: 156
    Tks for your prompt reply. When I check them in the item variant form, I found these :
    DataCaptionExpr: <>
    DataCaptionFields: Item No.

    and in the item variant table :
    DataCaptionFields : Item No., Code, Description
    Keys : Item No.,Code

    I try to do that but still not work good, could you explain more pls ?

    rgds,
    Mark
  • mjrogersmjrogers Member Posts: 59
    From the online help:
    DataCaptionFields
    Use this property to select the fields that will appear to the left of the caption on forms that display the contents of this table. For example, in the standard application, the customer name and number appear to the left of the caption on the customer card. For the customer table, those two fields are selected in this property.

    Applies to
    Tables and forms

    Comments
    For card forms (forms that show one record at a time), the DataCaptionFields property from the table is used and any setting of the property on the form is ignored. If there is no DataCaptionFields property defined in the table, the primary key is used.

    For tabular forms (forms that show a number of records at a time, as in a table box) the rules are these:

    A data caption is only displayed when a filter that contains the field(s) that are defined as the value of the DataCaptionFields for the form evaluate to one value. If this is so, two situations are possible:

    There is a TableRelation on one or more of the fields. In this case, the DataCaptionFields from the table that is pointed to are used. If this table does not have a value for the DataCaptionFields property, the primary key for that table is used.

    There is no TableRelation. In this case, the (single) value that was the result of the evaluation of the filter is used directly.

    (A form is considered a tabular form when the TableBoxID property of the form is not blank.)

    Example
    The easiest way to comprehend what is going on here is perhaps to look at an example. In the standard application, you can find this example:

    The Customer Card form (form 21) is based on the Customer table (table 18). By using menu items from Customer menu, the user can open different forms. One is form 21, Cust. Ledger Entry, another is form 22, Customer List (this form is invoked indirectly, as the menu item action is Lookup Table and this form is the lookup table for the Customer table.)

    In the Customer table, DataCaptionFields is set to No., Name. On the Cust. Ledger Entry form, DataCaptionFields is set to No.. When the Cust. Ledger Entry form is opened from the Customer Card form, a filter is set on Customer No. field of the Cust. Ledger Entries table, selecting only those entries that pertain to the customer that is currently displayed on the Customer Card (by setting the RunFormLink property of the menu item that invokes the Cust. Ledger Entry form to Customer No.=FIELD(No.).)

    This is the situation outlined as situation 1 above, and the number and name of the customer are used as a caption on the (tabular) Cust. Ledger Entry form. To see what happens when no filter is set, try to click Show All. Now, there is no longer a filter on the ledger entries, and, correspondingly, the caption disappears.

    Next, open the Customer List form from the Customer menu on the Customer Card. At first, there is no caption, which is to be expected since all customers are shown and no filter is set. Now, try to set a filter on the No. field to restrict the form the show only one customer. As you can see, no caption appears in this situation. This is because no DataCaptionFields are defined for the Customer List form.

    The example here obviously does not cover all the possible combinations, but it should give you an idea about how this property is to be used. The important point is that the DataCaptionFields property on a form does not directly put any caption on the form, but only works when used with appropriate settings of DataCaptionFields at table level.

    So you probably want to check the properties on your tables as well!...
    TecSA Malaysia

    Those of you who think you know everything are annoying to those of us who do. -
    David Brent
  • kinekine Member Posts: 12,562
    You can read more about that property in on-line help.

    Into DataCaptionProperty you can enter some C/AL code which return String. This string will be used as the caption. For example
      STRSUBSTNO('%1 Parent Item - Item Variants',ParentItemCode)
    

    If you use DataCaptionFields, it is just a list of fields which will create the caption of the form...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • mark_christsmark_christs Member Posts: 156
    Dear all,
    tku for your answers, I will explain after I tried to do that.


    rgds,
    Mark
  • mark_christsmark_christs Member Posts: 156
    Dear all,
    thanks for your answers and suggestions. especially to Mjrogers, your explanation from online help is more clear and I used it.tku.



    rgds,
    Mark
Sign In or Register to comment.