Restricting 'Entry Type' selection on item journal

Smashed_PumpkinSmashed_Pumpkin Member Posts: 47
edited 2004-02-13 in Navision Attain
On the item journal you have the 'Entry Type' option of 'Purchase', 'Sale', 'Positive adjustment' and 'Negative adjustment'. As we only want our users to use the 'positive/negative adjustment' options, could the system be set up to give an error message if the user selects one of the other options?

Many thanks.

Comments

  • giulio.cipogiulio.cipo Member Posts: 77
    you could modify the option string of the control so that you have only two option.
    This already appen becase the option of entry type are more then 4 you can have Transfer,Consumption,Output also.
  • FabriceGFabriceG Member Posts: 12
    If you use a sql server , you can resolve this problem with the security filter.
    If not write code in the trigger validate of the field
  • Smashed_PumpkinSmashed_Pumpkin Member Posts: 47
    I don't want to remove the options, so code is the way to go. Could you tell me what code I need to add? I'm still very new to this.

    Thanks.
  • FabriceGFabriceG Member Posts: 12
    To way
    In a form, create a new form (copy of the standard form). In the trigger "On validate" insert this code

    IF ("Entry Type"<>"Entry Type"::"Positive Adjmt.") AND ("Entry Type"<>"Entry Type"::"Negative Adjmt.")
    THEN error(.......);
  • Smashed_PumpkinSmashed_Pumpkin Member Posts: 47
    Cheers, I'll give it a go :)
  • Dean_AxonDean_Axon Member Posts: 193
    Seeing as though your new to coding and what your trying to do is in the Inventory Journal, I wouldn't recommend making a new form. Stick with the original form and add something like this to the "on Validate" trigger of the "Entry Type" field of the table

    1) Using a case statement:
    Case "Entry Type" of
    "Entry Type"::Purchase,"Entry Type"::Sale:
    begin
    Error('Your error message goes here');
    end;
    end;
    2)using if statement:
    If ("Entry Type"="Entry Type"::Purchase) or
    ("Entry Type"="Entry Type"::sale) then begin
    Error('Your error message goes here');
    end;

    'Positive adjustment's and 'Negative adjustment's will continue to work as normal as you have not told the system to do anything different with them.

    Remember : Keep it simple
    Remember: Keep it simple
  • Smashed_PumpkinSmashed_Pumpkin Member Posts: 47
    Cheers for the advice. In the end I modified the original form (after taking a backup!) by inserting code into the OnValidate trigger, so now if users select anything other than positive/negative adjustment the system tells them "That option is not available".
Sign In or Register to comment.