Options

nav 4.0 to nav 4.0 sp2 upgrade, adjust-cost error

raven44raven44 Member Posts: 85
hi all,
ive recently upgraded navision version 4.0 to navision version 4.0 sp2.
there wasnt much customisations, so the merge of the objects was often a replace of the 4.0 sp2 objects.
running the adjust cost - item entries batch job is resulting in a error that says:
"Another use has modified the record for this Avg. Cost Adjmt. Entry Point after you retrieved it from the database.
Enter your changes again in the updated window, or start the interrupted activity again.
Identification fields and values:
Item No.='Item001',Variant Code='',Location Code='TransitLocation'"

It halts on:
Adjmt. Level: 1
Item No.: Item001
Adjust: Average
Cost FW. Level: 1
Entry No.: x

Strange thing about this is that the entry no.it stops on does not contain that location code in the item ledger entry table?
Secondly, when you try run the batch job again - it stops at a different entry no.?

I know theres a fix for a similar error in Version 3.7's Codeunit 5895, but does anyone have any ideas for Nav 4.0 SP2.

Thanks

Answers

  • Options
    ara3nara3n Member Posts: 9,255
    Did you load Sp1 first and then Sp2? when you upgraded the objects? Also is anybody else in the system when you were running the routine?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    raven44raven44 Member Posts: 85
    nope - straight from 4.0 - 4.0 Sp2.
    we took everyone off the system when running the routine.

    procedure was as follows:
    1.) Merge objects
    2.) Import into database
    3.) Convert database
  • Options
    ara3nara3n Member Posts: 9,255
    By Merging do you mean you took you modified code and moved it into SP2 database? Or did you take only SP2 objects (~700 objects) and merge and replace 4.0 objects?


    If you did the first way you are ok. If you did the second way then you need to load SP1 (~700 objects) first and then SP2 objects.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    raven44raven44 Member Posts: 85
    yip, took customisations and put them into Sp2 objects - then imported all into current db
  • Options
    ara3nara3n Member Posts: 9,255
    Could you paste the code where the debugger stops? You would have to put a get before starting the modification. Also if you are on sql try to restore the backup in native and run adjust cost, see if you still get the error.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    fufikkfufikk Member Posts: 104
    We had very similar problem with Nav 4.0 sp2 and sql (unsolved yet).

    Restoring bkup on navision database helped - the error message didn't appear. Still, client has sql and it has to work on sql.
    Changing the transaction level didn't help either.
  • Options
    fufikkfufikk Member Posts: 104
    One more thing: not sure if it's important, but the client uses average costing method.
  • Options
    raven44raven44 Member Posts: 85
    Codeunit 5895 - Inventory Adjustment (version 4.0 SP2)
    AdjustItemAvgCost

    IF NOT IsAvgCostItem THEN
    EXIT;

    UpDateWindow(WindowAdjmtLevel,WindowItem,Text008,WindowFWLevel,WindowEntry);

    WITH AvgCostAdjmtEntryPoint DO
    WHILE AvgCostAdjmtEntryPointExist(TempAvgCostAdjmtEntryPoint) DO
    REPEAT
    AvgCostAdjmtEntryPoint := TempAvgCostAdjmtEntryPoint;
    DELETE;

    - the codeunit is standard. debugger stops on the DELETE
  • Options
    2tje2tje Member Posts: 80
    Looks a locking problem under SQL.
    Did you try the same with a native database?
    (backup in navision, restore in new C-side db and run routine)
  • Options
    radek.bbradek.bb Member Posts: 49
    2tje wrote:
    Looks a locking problem under SQL.
    Did you try the same with a native database?
    (backup in navision, restore in new C-side db and run routine)

    With native it works fine :(
    But we need it on SQL...
    Idea of: SQL->backup->Native,restore->Adjust Cost->Native,backup->SQL, restore is not the best solution ;)
  • Options
    ara3nara3n Member Posts: 9,255
    edited 2006-07-12
    Add a line above the delete statement
    get("Item No.","Variant Code","Location Code");
    DELETE
    

    that should solve it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    radek.bbradek.bb Member Posts: 49
    Yes - it did! :D
    Is it an official 'patch'?
    Because Microsoft is working with the problem quite long time... :evil:

    BTW: maybe you have also such good solution for infinite loop during adjusting cost (in 4.0SP1 SQL version)? I searched a bit in forum, but in most cases advices were "serch for it" ;)
    And it looks that in v.4 there were no reports about infinite loop...
  • Options
    ara3nara3n Member Posts: 9,255
    No it's not an official patch. It's my official patch.
    The infinite loop is a little hard to solve because it depends on how your item application are done. So it depends on data and I will need data (db) to solve it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    radek.bbradek.bb Member Posts: 49
    So.. is it a matter of data?
    Should I look inside, try to find 'wrong' application entry and change/delete it ?

    I have 10 items ending in loop.
    The easiest one is quite simple - it has only 8 transfer entries:
    location A -> transit B -> location C -> transit D -> location A
    1. -4 for A
    2. +4 for B
    3. -4 for B
    4. +4 for C
    5. -4 for C
    6. +4 for D
    7. -4 for D
    8. +4 for A

    Every entry posted with the same posting date. Average costing.

    Where should I look?
  • Options
    ara3nara3n Member Posts: 9,255
    :shock: . I would have to debug the code with the data, and see where it starts to loop again, and add code to stop the recursive call. Probably write the records into a temp table and if they exists in temp table, stop processing.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    radek.bbradek.bb Member Posts: 49
    I will check :)
    But... do you suggest that there are no such thing in W1 code? I would expect that the case I described earlier (8 transfer entries) is quite easy and typical (well - at least during tests) :?

    Anyway - thank you for "GET" solution - it helped a lot :D
  • Options
    raven44raven44 Member Posts: 85
    hi,

    yes that GET does work.
    sorry for the late reply!
    i think we can set this Topic to Resolved now?

    Thanks again
  • Options
    ara3nara3n Member Posts: 9,255
    Hello raven 44
    I guess Radek.bb is still working on anothe with adjust cost. So it's up to you to update the title to solved.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    raven44raven44 Member Posts: 85
    no problem,
    ill wait till they feel the issue is resolved
  • Options
    radek.bbradek.bb Member Posts: 49
    I believe that the problem of "Another use has modified the record for this Avg. Cost Adjmt. Entry Point after you retrieved it from the database" is solved by GET solution. =D>

    My other problem with infinite loop during adjustments completely different story. ](*,)

    The direct cause of problem are incorrect entries in 5804 table (Avg. Cost Adjmt. Entry Point). In the example I presented earlier (8 entries) there were missing line for one of the locations. For other items I discovered that there are to many entries in 5804 table. Usually it is enough to delete one/two record to receive correct adjustment for all entries.

    Since new items are rising this error (loop) my guess is that the real cause of the problem is automatic cost posting procedure. It looks like that in multi-user environment sometimes the procedure is not finishing properly - and leave wrong entries in 5804 table. When I try to run a batch for adjustment - it is too late.
    Well... - the solution is turn it off... :( and wait for SP99 :wink:
  • Options
    ara3nara3n Member Posts: 9,255
    Or upgrade to 5.0. I'm not assuming that it won't have bugs, but they've introduced a new costing method. Periodic average cost.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    GoMaDGoMaD Member Posts: 313
    So this is also a versioning issue.

    Seems that navision still has a lot of trouble with such a thing.
    Now, let's see what we can see.
    ...
    Everybody on-line.
    ...
    Looking good!
Sign In or Register to comment.