Automatic Posting of item charges

Hi All,

I have created a field carrier charges in sales line and in sales order sub form I added this field, when I am posting the item in sales order the carrier charges should come as item charges, the new line of item charges should be post in background while posting the item and I have written the code for adding the new line of item charges automatically for example

Now I have the first Line as ->Item in sales order before ship
After ship now I have the second Line as ->Charge (item) Then I want to invoice the item with item charges but it throw me the error like U must assign item charges if u want to invoice it

But I don't want to use the item charge assignment feature ,without using that feature it should get invoice

for that I have written the code like inserting the required fields in item charge assignment(Sales) table and by not using that feature the item get invoiced with item charges

But my problem is it didn't get updated in value entries and in posted sales invoice, G/L entry, tax entry I can able to see the second line of item charges

Please help me to post the item with item charges in value entries

Answers

  • bbrownbbrown Member Posts: 3,268
    Set up and assign an Item Charge line on your sales order using the standard manual method. Then compare the resulting "Item Charge Assignment (Sales)" record to the ones being created by your process. I suspect you may find a difference.

    If the "Item Charge Assignment (Sales)" records are created properly, the posting code (CU 80) should handle the rest.
    There are no bugs - only undocumented features.
  • TejaswiniTejaswini Member Posts: 75
    Okay thank you

    how to set the document no for the new line that I want to create automatically

    for example in sales order subform of sales order

    first line as item -> document no. is 1900
    second line as charge (item) -> document no. should be 1900 but it is taking as null

    my code didn't find out the first record in sales order

    please suggest me the code for it.
  • TejaswiniTejaswini Member Posts: 75
    And I have written the code in code unit 80 and I have called it in 81 code unit after invoice
  • TejaswiniTejaswini Member Posts: 75
    5amk9jyum71v.png
    55.png 116.1K
  • bbrownbbrown Member Posts: 3,268
    The "Item Charge Assignment (Sales)" records need to be created before the invoice posting step begins. Look at the standard charge assignment function as a guide in creating the records.

    There are no bugs - only undocumented features.
  • TejaswiniTejaswini Member Posts: 75
    Thank you,

    But I want to create the new line of item charge by writing the code with required fields While we hit the post button in sales order the item with item charges should get posted ,so I have to create the function in code unit 80 and I want to call this function at the post button of On Push before the CODEUNIT.RUN line and it should be updated in all entries by post the item in sales order

    Please suggest me the code for it.

    It's very urgent...
  • bbrownbbrown Member Posts: 3,268
    If you are going to create the new sales lines and "Item Charge Assignment (Sales)" records in codeunit 80, they must be created before the "CopyAndCheckItemCharge" function is called.

    There are no bugs - only undocumented features.
  • TejaswiniTejaswini Member Posts: 75
    Yes I have created before that function but the new line of item charges is not posted in value entries
  • TejaswiniTejaswini Member Posts: 75
    except value entries it is updated in all entries
  • TejaswiniTejaswini Member Posts: 75
    please suggest me to post it in value entries
  • bbrownbbrown Member Posts: 3,268
    Debug a posting. See if the function "CopyAndCheckItemCharge" is picking up your "Item Charge Assignment (Sales)" records and populating "TempItemChargeAssgntSales". This temporary table is then processed by "PostItemChargePerOrder" to post the charges.

    If the temporary table is getting populated, then step thru the "PostItemChargePerOrder" function to see why it is failing to post the entries.

    There are no bugs - only undocumented features.
  • KishormKishorm Member Posts: 921
    If you don't post the code you have written then it's very difficult for others to help you as they can't see what you may have done wrong. The more information you provide the more chance you have of someone being able to help you.

    For example, you may have created the sales line with the item charge incorrectly, but there's no way for anyone to know this and tell you where you have gone wrong.
Sign In or Register to comment.