Catch Tab Trigger

upasanisandip
upasanisandip Member Posts: 405
Hi,
I want to write some code when user press custom tab created by me.
is it possible?

thanks
Sandip.

Comments

  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    This could be difficult.

    You can try to put code in the OnActivate trigger of the first control of the tab, but this means it get's triggered everytime the user activates it.
  • kine
    kine Member Posts: 12,562
    And why do you need that? What is your goal?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • upasanisandip
    upasanisandip Member Posts: 405
    Kine:
    I am taking values from some other table. Want to refresh that variables on tab event.
  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    ???

    What structure does your code/tables have? Do you read some table information when you are in a form or do you have flowfields?

    What problem do you have refreshing? When is the other data changed?
  • kine
    kine Member Posts: 12,562
    And why you cannot read these values in OnAfterGetCurrRecord?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • upasanisandip
    upasanisandip Member Posts: 405
    i am calculating Freight , Insurance, Transport charges total seperately. Coz user needs seperate total of Transport, Freight etc. on report.
    So added fields for this in Purchase Header.

    I have taken this information from Structure Order Detail Table.
    So when i click on structure menu button i want that other table info. which i have taken from Structure Order Detail table also get refreshed.
    I made 1 new tab for this.
  • Marije_Brummel
    Marije_Brummel Member, Moderators Design Patterns Posts: 4,262
    What is a Structure Order Detail table?

    What does your code structure look like?
  • DenSter
    DenSter Member Posts: 8,307
    So write the calculating part as field validation code. You should see resulting values immediately. Never write any data code in a form event, that is just a very bad idea. Data code should reside in tables or codeunits. Form triggers should only be used for display purposes or to set variables in other objects.