Restrict SalesRet&CredMem if UntCst-Item-stdcost>10%

rlawsonrlawson Member Posts: 48
I have Nav 4.0. My problem is:
Unit Cost on the item card gets corrupt as a result of unknown effects. To prevent positive adjustments from using the unit cost when it will be adjusted back, I want to add tolerance checking to posting. When Sales Returns or Credit Memos are posted, or Positive cost against Item Standard cost +/_ 10% (just error out and send a message to user to change the unitcost and do not post and roll back). If the cost is outside of tolerance error out.
I figured out that the check for tolerance code needs to be in Code Unit 80 for starters. The problem is where.

Answers

  • kapamaroukapamarou Member Posts: 1,152
    Find the first loop through the sales lines. You need to place the check as soon as you can in order to skip much code and avoid rollbacks...

    The first loop in the OnRun trigger... I don't know if we can be more specific since there might be a part of code for the localization that we don't have...
  • rlawsonrlawson Member Posts: 48
    Thank you.

    I followed the CU80 to the first line and got into CU21 Item Jnl.-Check Line processing on Table 83 (this catches all positive adjustments and added it to RunCheck routine). So I checked for entry type # purchase; entrytype = sales and quantity = +; et= positive adj and + quantity and et = transfer and + quantity. I think that covers all necessary cases.
  • SavatageSavatage Member Posts: 7,142
    I would also add a field to the Inventory Setup Table called "Tolerance Percent" - add it to the inv setup from there you can enter "10"

    When your calculating your formula simply add:

    InvtSetup.GET;
    and change your "10" to "Tolerance Percent" in the formula.

    This will allow you to adjust the amount in the future if needed without having to go find the code & change it everytime right from the Invsetup form.
  • rlawsonrlawson Member Posts: 48
    Already have done this. Also added, Cost Tolerance Flag due to multiple companies (to turn on and off).

    Thanks for all your help
Sign In or Register to comment.