Commit in material posting
dietmarruef
Member Posts: 48
Hello,
I have to post some material in an routine for posting during the
posting of our addon module. The addon module we have hasn't
any commit's inside but I have problems with the standard posting.
I call the the codeunit 23 Item Jnl.-Post Batch, which is the standard
routine according to posting in Item Journal. This codeunit has some
three commits inside which I disable through a parameterized function
like setHideValdidationDialog. Now my concern is, if I crash some logic
when I disable the commits, on a possible error in the routines?
Has somebody experience?
Already I know about the functionality to just insert into a record variable
the posting information's and run the posting codunit (Codeunit 22) but
the problem in my case is, that I mostly have to book with Serial numbers
and that I can't comprehend how standard Navision passes this information
to the posting codeunit. Just to simply insert the serial no. is not enough.
May somebody knows a solution for this?
Thanks
Dietmar
I have to post some material in an routine for posting during the
posting of our addon module. The addon module we have hasn't
any commit's inside but I have problems with the standard posting.
I call the the codeunit 23 Item Jnl.-Post Batch, which is the standard
routine according to posting in Item Journal. This codeunit has some
three commits inside which I disable through a parameterized function
like setHideValdidationDialog. Now my concern is, if I crash some logic
when I disable the commits, on a possible error in the routines?
Has somebody experience?
Already I know about the functionality to just insert into a record variable
the posting information's and run the posting codunit (Codeunit 22) but
the problem in my case is, that I mostly have to book with Serial numbers
and that I can't comprehend how standard Navision passes this information
to the posting codeunit. Just to simply insert the serial no. is not enough.
May somebody knows a solution for this?
Thanks
Dietmar
0
Comments
-
before posting the Itemjounral line using CU run the following code and it will create the serial/lot no.
CreateReservEntry.SetDates( 0D, 0D); reateReservEntry.CreateReservEntryFor( DATABASE::"Item Journal Line", ItemJnlLine."Entry Type", ItemJnlLine."Journal Template Name", ItemJnlLine."Journal Batch Name", 0, ItemJnlLine."Line No.", ItemJnlLine."Qty. per Unit of Measure", 1, '', 'mylotNo'); CreateReservEntry.CreateEntry( ItemJnlLine."Item No.", ItemJnlLine."Variant Code", ItemJnlLine."Location Code", ItemJnlLine.Description, ItemJnlLine."Posting Date", ItemJnlLine."Document Date", 0, 2);
reateReservEntry is a codeunit 99000830 (Create Reserv. Entry)0 -
Hello ara3n!
Thanks you for the quick reply. I tried to use your code, but it doesn't work. I copied it below. May you have an idea?TempJnlLineDim.DELETEALL; TempJnlLineDimOrg.RESET; TempJnlLineDimOrg.SETRANGE("Table ID",DATABASE::"Item Journal Line"); TempJnlLineDimOrg.SETRANGE("Journal Template Name",cJournalTemplateName); TempJnlLineDimOrg.SETRANGE("Journal Batch Name",cJournalBatchName); TempJnlLineDimOrg.SETRANGE("Journal Line No.", LineNo); DimMgt.CopyJnlLineDimToJnlLineDim(TempJnlLineDimOrg,TempJnlLineDim); //ItemJnlLineReserve.CreateReservation(ItemJournalLine,'',TODAY,1,cDeviceID,''); CreateReservEntry.SetDates( 0D, 0D); CreateReservEntry.CreateReservEntryFor( DATABASE::"Item Journal Line", ItemJournalLine."Entry Type", ItemJournalLine."Journal Template Name", ItemJournalLine."Journal Batch Name", 0, ItemJournalLine."Line No.", ItemJournalLine."Qty. per Unit of Measure", 1, ItemJournalLine."Serial No.", ''); CreateReservEntry.CreateEntry( ItemJournalLine."Item No.", ItemJournalLine."Variant Code", ItemJournalLine."Location Code", ItemJournalLine.Description, ItemJournalLine."Posting Date", ItemJournalLine."Document Date", 0, 2); ItemJnlPostLine.RunWithCheck(ItemJournalLine,TempJnlLineDimOrg);
The system always shows the error "You must specify Serial No. in Item Journal Template Name ....".
Thanks in advance
Kind regards
Dietmar0 -
what kind of "Entry type" journal line are your posting?
insert the journal line for testing purposes and don't post it. from the Item journal line form click on line Tracking lines. Do you see the serial no?0 -
Hello ara3n!
Thanks for the reply. I tried now to insert it and after one hour I got
it to work. The "Serial No." in the journal must be empty. Thanks!
I have one additional question, in this code you posted me and now I implemented
you always fill status with 0 what is reservation. I had problems before, that this
caused me errors, because I need to book positive and negative adjustments. May
you know more, about this.
Thanks in advance
Dietmar0 -
I'm sorry I don't understand what you are asking.0
-
Hello ara3n!
Forget about the question, I could resolve it with my finance consultant.
I am now testing the posting and just saw, that the every posting generates a
new entry in the item registers. You must know, that I'am posting from a
document in our vertical solution, that can contain several material entries.
I tried to create it as a temporary table and pass this to the Codeunit 22 (Item Jnl.-Post Line) - Runwithcheck but it doesn't work. It always just posts the last entry in the table. May you have an idea how I can change the
routine, that I get just one register entry.
Thanks in advance,
Dietmar0 -
make sure you don't clear the variable that you use for CU 22. .0
-
Hello ara3n!
Thanks a lot, now it works. You safed me a lot of nerves and time.
Kind regards,
Dietmar0 -
You are welcome
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
