Calcfields and Inventory avail report

KisuKisu Member Posts: 381
edited 2012-05-07 in NAV Three Tier
Hi

I'm trying to add inventory field for Inventory availability report (705)

I get it working on classic side but on RDLC it wont calculate the field.

I have calcfields on the section side though, do I have to do add something on the rdlc side too so it calculates there?
K.S.

Answers

  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    In which trigger you have your "calcfields"?
    ~Rik~
    It works as expected... More or Less...
  • KisuKisu Member Posts: 381
    Its in the section where I have the textbox with sourceexpression inventory


    Item, Body (6) - OnPreSection()
    K.S.
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Kisu wrote:
    Its in the section where I have the textbox with sourceexpression inventory


    Item, Body (6) - OnPreSection()
    In this way can't work because RTC doensn't execute code written under Sections.
    You've to move your code under the correct DataItem trigger.
    ~Rik~
    It works as expected... More or Less...
  • KisuKisu Member Posts: 381
    Hmm I moved the calcfield under the dataitem but still it does not count the values on rdlc

    Item - OnPreDataItem()
    IF ISSERVICETIER THEN
    GetCurrentKey := Item.CURRENTKEY;

    Item.CALCFIELDS(Item.Inventory); // <
    K.S.
  • mihail_kolevmihail_kolev Member Posts: 379
    edited 2012-05-07
    OnPreDataItem the record is not available yet. Of course it doesn't work. You should put it in OnAfterGetRecord.
    -Mihail- [MCTS]
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Kisu wrote:
    Hmm I moved the calcfield under the dataitem but still it does not count the values on rdlc

    Item - OnPreDataItem()
    IF ISSERVICETIER THEN
    GetCurrentKey := Item.CURRENTKEY;

    Item.CALCFIELDS(Item.Inventory); // <

    Have you already tried the same code in Item - OnAfterGetRecord()?
    ~Rik~
    It works as expected... More or Less...
  • KisuKisu Member Posts: 381
    Kisu wrote:
    Hmm I moved the calcfield under the dataitem but still it does not count the values on rdlc

    Item - OnPreDataItem()
    IF ISSERVICETIER THEN
    GetCurrentKey := Item.CURRENTKEY;

    Item.CALCFIELDS(Item.Inventory); // <

    Have you already tried the same code in Item - OnAfterGetRecord()?

    Aa, that sorted it. now it works :)

    Cheers guys
    K.S.
  • ChinmoyChinmoy Member Posts: 359
    I have a 2009 R2 W1 database (without any other country specific objects). I have just added the Inventory field in the Bosy section of Item dataitem, and changed the RDLC layout. The report (705) is printing the proper Inventory balance figures both in classic and RTC reports. Can you do this on a new database and check?

    Chn
Sign In or Register to comment.