Changing "Description" Entry

SavatageSavatage Member Posts: 7,142
edited 2005-04-25 in Navision Attain
There are codes in Navision where you can type in the Description and the proper code appears.

For example in Payment journal if I don't know the g/l for Inventory I can type in "INVE" and 15000 - Inventory would appear.

Same goes true for order entry if i start to enter an item description into the item number it will pop up the first hit.

My question is can this be changed to recognize another field other than the description field? Each item we have has two numbers - i would like to enter either number into the No. field and the proper item will appear.

we use the No. & No 2. fields - if No 2 could replace how the description works it would make my day, but not system wide just where we need it (order entry) (item Journals)!

Comments

  • pdjpdj Member Posts: 643
    It is actully not the description field, but the "Search Name" field. It is defined by setting the property AltSearchField on the No. field in the Item and G/L Account (and so on) tables. So you can change this property, but then you will change it for the table system wide. Or you could move the Description.OnValidate code to the "No. 2".OnValidate (well, should be slightly adjusted :-))

    I don't think you can code it on a few forms, because the the table relation is checked before the form's OnValidate is executed. Then you have to change the ValidateTableRelation as well, and that has a lot of negative sideeffects.

    I will recommend changing the code that fills the "Search Name/Description" - that will make it clear and constant for the users.
    Regards
    Peter
  • SavatageSavatage Member Posts: 7,142
    AltSearchField - never noticed it

    i'll give a shot - thanks
  • SavatageSavatage Member Posts: 7,142
    I finally had a chance to try this.

    I changed the Alt Search Field on the Item Table to No.2
    -It did allow me to enter No .2 into the Item# of the sales order & got the proper result

    -The Item Journal it doesn't work - I think I need to change
    Codeunit 240 ItemJnlManagement - ItemJnlMgt.OnAfterInputItemNo(Text);
    to have the same behavior occur.
    Code
    OnAfterInputItemNo(Text)
      IF Text = '' THEN
        EXIT;
      
      IF EVALUATE(Number,Text) THEN
        EXIT;
      
      Item."No." := Text;
      IF Item.FIND('=>') THEN
        IF COPYSTR(Item."No.",1,STRLEN(Text)) = UPPERCASE(Text) THEN BEGIN
          Text := Item."No.";
          EXIT;
        END;
      
      Item.SETCURRENTKEY("Search Description");
      Item."Search Description" := Text;
      Item."No." := '';
      IF Item.FIND('=>') THEN
        IF COPYSTR(Item."Search Description",1,STRLEN(Text)) = UPPERCASE(Text) THEN
          Text := Item."No.";
    GetItem(ItemNo,ItemDescription)
      IF ItemNo <> OldItemNo THEN BEGIN
        ItemDescription := '';
        IF ItemNo <> '' THEN
          IF Item.GET(ItemNo) THEN
            ItemDescription := Item.Description;
        OldItemNo := ItemNo;
      END;
    

    I changed "Search Description" to "No. 2" & it works great - It's been hailed already as the greatest change ever in our company - ha ha \:D/
Sign In or Register to comment.