i want to post a tranfer order without inventory

gorvega79gorvega79 Member Posts: 73
I want to register a transfer request out of stock. I changed the code from codeunit 22 to not display the error: "no existing stocks." but that's no amount on "transit " location. Why is this ??...

I am watching codeunit 22 and I see that in the "ApplyItemLedgEntry" function didn´t find itemLedgerentry an beacause of this AppliedQty doesn´t modify it´s value.

Answers

  • matttraxmatttrax Member Posts: 2,309
    How could you expect a transfer order to know what to do if the stock doesn't exist? I mean that's the whole point of a transfer, to move something you already to have to another location. If you don't have it you can't move it.

    You shouldn't post something until it actually happens. Why are you trying to do this? What is the business need?
  • gorvega79gorvega79 Member Posts: 73
    i want move stock from a central location to transit location and from transit location to shop location. the problem wast that the quantity in then transfer location is 0 and central location is -1. i think that, the qutantity in the transit location may be 1 and i do not know why, do that. i comment this part of code from codeunit 22

    WITH ItemJnlLine DO BEGIN
    IF ItemLedgEntry.Open THEN BEGIN
    //***** AADD0030, UOT, 25/03/10 ;trans between locations
    //standard
    // IF (((ItemLedgEntry."Entry Type" IN
    // [ItemLedgEntry."Entry Type"::"Negative Adjmt.",
    // ItemLedgEntry."Entry Type"::Consumption]) AND
    // ("Source Type" = "Source Type"::Item)) OR
    // (ItemLedgEntry."Entry Type" = ItemLedgEntry."Entry Type"::Transfer)) AND
    // (ItemLedgEntry.Quantity < 0)
    // THEN

    //sendindg whit negative inventory
    // IF ((ItemLedgEntry."Entry Type" IN
    // [ItemLedgEntry."Entry Type"::"Negative Adjmt.",
    // ItemLedgEntry."Entry Type"::Consumption]) AND
    // ("Source Type" = "Source Type"::Item)) OR
    //***** VADD0009, CF, 18/11/09 ;orders to customers
    // 21/12/09: sendindg whit negative inventory
    // ((ItemLedgEntry."Entry Type"=ItemLedgEntry."Entry Type"::Sale) AND ("Source Type" = "Source Type"::Customer)) OR
    //fin***** VADD0009, CF, 18/11/09 ;PEDIDOS A CLIENTES
    //***** AADD0030, UOT, 25/03/10 ;TRASPASO ENTRE ALMACENES
    // (ItemLedgEntry."Entry Type" = ItemLedgEntry."Entry Type"::Transfer)) AND
    //fin***** AADD0030, UOT, 25/03/10 ;TRASPASO ENTRE ALMACENES
    // (ItemLedgEntry.Quantity < 0)
    // THEN
    IF ((ItemLedgEntry."Entry Type" IN
    [ItemLedgEntry."Entry Type"::"Negative Adjmt.",
    ItemLedgEntry."Entry Type"::Consumption]) AND
    ("Source Type" = "Source Type"::Item)) AND
    (ItemLedgEntry.Quantity < 0)
    THEN
  • AdamRoueAdamRoue Member Posts: 1,283
    I would advise against commenting out code to fix a problem you do not know the source of - imagine how many other downstream problems you are going to cause yourself.
    The art of teaching is clarity and the art of learning is to listen
  • gorvega79gorvega79 Member Posts: 73
    yes i know but the code is not mime,i only have to find a solution to pass stock to transit lokation.

    Thank you for your advice
  • matttraxmatttrax Member Posts: 2,309
    Don't write code to fix data issues. There are very few instances when you need to do so. For example, you don't delete G/L Entries, Vendor Ledger Entries, Value Entries, Ledger Entry Dimensions, etc because you accidentally posted a purchase invoice; you just post a credit memo. There is most likely something functional that you can do to fix the issue.
    gorvega79 wrote:
    yes i know but the code is not mime,i only have to find a solution

    Seriously? This is why implementations go bad. Care about finding the root cause, not putting band-aids on the system.
  • gorvega79gorvega79 Member Posts: 73
    thank you for all, but i only want to know if is possible to post transfer order without check the inventory.
  • matttraxmatttrax Member Posts: 2,309
    I'm sure you could if you comment out enough code, but it is only going to cause more problems. Look at the item ledger, figure out why the quantities are off for that location; then do an item journal to correct them. If you don't understand how to do that you need to talk to someone more senior at your company.
  • ufukufuk Member Posts: 514
    You can solve this kind of problems with positive/negative adjustments. (you said one item is negative and other is positive and you don't know the reason)
    As others said don't think about a solution based on changing standard code.
    Ufuk Asci
    Pargesoft
  • gorvega79gorvega79 Member Posts: 73
    thank you ufuk for your post, i have done that you told me and it works perfectly...

    i´ll try not to touch the standard code jejeje....regards!!!!!
Sign In or Register to comment.