Options

Item Category Code filtering

A new "field A" field added to the Vendor table and Vendor Card will help calculate what the "Field B" for an Item needs to be that has an Item Category Code that matches the value set in the "Field C" field on the Inventory Setup. Validation will be added to ensure that a value greater than 100 cannot be entered in the "field A" field on the Vendor Card. Anytime the "field A" field on the Vendor card is updated the "field B" for all Items that have an Item Category Code that matches the "field C" on the Inventory Setup will be recalculated.
i created fields in necessary tables and pages.

Answers

  • Options
    allenyyzhouallenyyzhou Member Posts: 142
    Hi

    You did not finish your post? Where is the question?
  • Options
    Thanks for the allenyyzhou!

    my requirement was i had a "field A" in item and "field B" in vendor table and "field C" in inventory table.Anytime the "field A" field on the Vendor card is updated the "field B" for all Items that have an Item Category Code that matches the "field C" on the Inventory Setup will be recalculated.for this i tried to write code as follow

    InventorySetup.GET;
    Vend.GET;
    item.RESET;
    //item.SETRANGE("Vendor No.",Vend."No.");
    IF item.FINDSET THEN
    REPEAT
    item.SETRANGE("Item Category Code",InventorySetup."field C" );
    IF (item."Vendor No." <> "Vendor No.") AND ("Vendor No." <> '')
    THEN
    IF Vend.GET("Vendor No.") THEN
    "field B":= vend."field B"
    UNTIL Rec.NEXT = 0
    but it shows wrror message and also not updated the value in item card.
    Thanks in advance...
  • Options
    krikikriki Member, Moderator Posts: 9,096
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    lubostlubost Member Posts: 614
    Your Item variable is filtered but no FIND occurred. Btw. your Item variable is not needed in your code.
  • Options
    Thanks for the reply lubost!
    if you don't mind would you please Elaborate...
  • Options
    lubostlubost Member Posts: 614
    I don't know anything about your code but some hints:
    1. Why Vend.GET; ? - it probably produces error, or gets always the first record
    2. What is the Rec variable?
    3. Why changing values in Rec without MODIFY?
    4. Why changing position in Rec?
    5. Where is your code located?
Sign In or Register to comment.