Flowfield is not getting Updated (Nav sql database).

ajaybabuChajaybabuCh Member Posts: 208
Hi

Navision SQL Database :
I have two tables TmpSalesHeader and TmpSalesLine which are copy of Sales Header and Sales Line.

Amount field in TmpSalesHeader is flow field which is the sum of Sales Lines amount based on
Document Type, External Doc No and CustomerField key.

I have defined a secondary key "Document Type, External Doc No and CustomerField" with SumIndex Field as Amount in
TmpSales Line Table.

One third party tool will insert the data into TmpSalesHeader and TempSalesLine.

When third party tool inserts data in both TmpSales Header and TmpSalesLine,
All the TmpSalesHeader amounts are appearing as zero when I run TmpSalesHeader table.

I have disabled the Key for the SumIndex field from TmpSales Line and saved and compiled TmpSalesLine table.
Again I have enabled the SumIndex field key from TmpSalesLine table and try to save and compile, it has done some reindex process for the TmpSalesLine data.
Then I went into TmpSalesHeader and looked at the Amount field, all the amounts are with proper value.

Do I need to always disable and enable the Key for the SumIndex Field?
Do we have any other way to reindex ?

Thanks and Regards
Ajay
Ajay

Comments

  • SaalekSaalek Member Posts: 181
    Hi

    If you show AMOUNT field in your header form, the value will be calculated automaticaly in your table.

    Reards
  • ajaybabuChajaybabuCh Member Posts: 208
    We have not created user interface for these tables.
    we used to run the table and see the amount, sometiems it is zero, some times with some negative amount
    always it is not correct amount.


    Process Is :
    Third Party tool inserts data into TmpSalesHeader and TmpSalesLine
    From these tables one of Navision Codeunit will create Actual Sales Invoice and Sales Lines.

    Thanks
    Ajay
  • SaalekSaalek Member Posts: 181
    Hi again

    I know what you are doing, but Navision standar tables have the same "bug" ???

    If you RUN Sales Header table and you push Ctrl + F8, Amount field is 0.
    If you show Amount field in the form and you run again then table, Amount field is the real amount of the order, invoice, ....

    Maybe you can detete Amount Flowfied and use a normal Field. In your importation process, calculate the amount using a repeat .... isn't the best solution, but ....
    Or create a form for this Temp table.

    Bye
  • BeliasBelias Member Posts: 2,998
    what's your nav version?where does the third party inserts the data?directly in SQL?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • ajaybabuChajaybabuCh Member Posts: 208
    Nav 5.0SP1. using SQL database

    let me explain the problem clearly.
    Amount field is the flow field in tmp sales header table.
    SumIndex field defined in tmpsales lines table.

    Third party tool inserts data into tmpSales header and tmpSales lines table.
    when I goto object desinger and run tmpSales header table and see the amoun field , I found that it is with wrong amount value.

    Then I went to tmpSales lines and disable the key which is pointing to the sum Index field saved and compiled.
    After that , I have again enable the key. Saved and compiled. When compiling and saving, it has reindexed the data.

    Now I have run the tmpSales Header table again from the object designer. All the amounts are proper now.

    Is there any other way to reIndex?
    Ajay
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Saalek wrote:
    Hi again

    I know what you are doing, but Navision standar tables have the same "bug" ???
    ...

    That is not a bug ](*,) can you imagine the insanity of calculating every flow field every time even if it i not used, your system would be slow beyond belief. This is a smart and very important feature.

    Also I don't think this has any connection what so ever to the OP's issue.
    David Singleton
  • BeliasBelias Member Posts: 2,998
    Saalek wrote:
    Hi again

    I know what you are doing, but Navision standar tables have the same "bug" ???
    ...

    That is not a bug ](*,) can you imagine the insanity of calculating every flow field every time even if it i not used, your system would be slow beyond belief. This is a smart and very important feature.

    Also I don't think this has any connection what so ever to the OP's issue.
    he said that he opened the table directly, not the form...(i think you're reffering to the show/hide of a flowfield field in a form)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Belias wrote:
    That is not a bug ](*,) can you imagine the insanity of calculating every flow field every time even if it i not used, your system would be slow beyond belief. This is a smart and very important feature.

    Also I don't think this has any connection what so ever to the OP's issue.
    he said that he opened the table directly, not the form...(i think you're reffering to the show/hide of a flowfield field in a form)

    Which is why I said that I don't think there is any connection. :whistle:
    David Singleton
  • BeliasBelias Member Posts: 2,998
    ok David, now after rereading everything it's more clear... :roll:
    now, i renew my question: this "third party tool" does insert data directly in sql or through NAV client?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • SaalekSaalek Member Posts: 181
    Belias wrote:
    ok David, now after rereading everything it's more clear... :roll:
    now, i renew my question: this "third party tool" does insert data directly in sql or through NAV client?

    Hi again.

    The problem isn't in the third party tool. [-X [-X
    1 -Take NAV 6.0 database (without modifications)
    2- Run Sales Header table
    3- Push Ctrl + F8 to zoom a record. Field Amount is = 0
    4- Go to Sales Order or Sales invoice form (The card form) and show Amount field
    5- Go back to table 36 and surprise, Amount field <> 0

    Why #-o #-o #-o
    It is a extrange Navision ...... curiosity :whistle: :whistle: :whistle:

    Bye
  • kitikkitik Member Posts: 230
    Push Ctrl + F8 to zoom a record. Field Amount is = 0

    As far as I know flowfields are never calculated when Zooming the record.
    It's not a :bug: , it's just the way it works.

    Salut!
    Laura Nicolàs
    Author of the book Implementing Dynamics NAV 2013
    Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.
  • BeliasBelias Member Posts: 2,998
    ok, understood...the "step by step" made me able to replicate your "issue"...that actually it is not a an issue :wink:
    calcformula of "sales header".amount is
    Sum("Sales Line".Amount WHERE (Document Type=FIELD(Document Type),Document No.=FIELD(No.)))
    
    amount field on sales lines (zoom a sales line to see it) of the same document is 0, unless you release the document: this implies that "sales header".amount flowfield is 0, because it is the sum of the "sales line".amount field on the same document.
    If you release the document, just take a look at the zoom window of the sales line to see that amount field is evaluated; obviously, the amount on the header is then populated, too.
    If you have an automated process and you want to automatically release all documents, just take a look at the onpush trigger of Functions->Release menuitem:
    ReleaseSalesDoc.PerformManualRelease(Rec);
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.