Options

Navision questions! need answer plz

RKMRKM Member Posts: 26
1.Trying to reduce the item description length from 55 character to 50
In the table we have no records above 50 chracters.
when I make the change I get the following error
"You cannot delete or chage this type of the description field(in teh item table) before the value of teh field is "" or 0 This error occured due to a non zero value was found for the record No. 100001" in company development
How can i change this.

2Is there an easy way to set a combo box on a form to a default value everytime and on any preexisitng items set the combo if it has a null vlaue to a default value(default value="STANDARD")

Thank you

RKM

Comments

  • Options
    dmitripdmitrip Member Posts: 44
    1. Copy content of description field to the other field (description 2 or a new one). You can use Navision report or other tool ( I prefer SQL Query Analyzer). Clear up description field content. Decrease the size to desired and copy description back from the other field.
  • Options
    ajay_setinajay_setin Member Posts: 10
    Hi RKM

    1. u get this error because u have data already on the table for the field u are trying to change the field length..do as suggexted by dimitrix

    2. To set a value for combo box as default, u have to program on the required trigger, as and when u want the default value to aapear on the combo
    Life has just started!! Program it well !!
  • Options
    Stefan_VerweyStefan_Verwey Member Posts: 18
    Standard Cost - OnValidate
    // Please note that when any code changes are made to this trigger the same code changes must be
    // made to fStdCostOnValidate function at the bottom of this table.

    //add this to the OnValidate
    lvCuStdCost.fUpdateWithCostComponents(xRec, Rec);

    Create a new Local Function called "fStdCostFieldOnValidate"

    //fStdCostFieldOnValidate
    //>>NEW CODE BEGIN
    IF ("Costing Method" = "Costing Method"::Standard) AND (CurrFieldNo <> 0) THEN
    IF NOT CONFIRM(Text020 + Text021 + Text022,FALSE, FIELDCAPTION("Standard Cost"))
    THEN BEGIN
    "Standard Cost" := xRec."Standard Cost";
    EXIT;
    END;

    ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE);
    //<<NEW CODE END
  • Options
    RKMRKM Member Posts: 26
    Hi guys thanks for all your responses

    dmitrip--Thanks this worked, I didnt want to touch the SQL part of things as navision is quite touchy on things when you take the sql server approch. But your solution worked.

    ajay_setin & Stefan Verwey

    Stefan Your code worked great, I was curious as to there might be other methods of doing this using the designer, as im new to navision and am finding a couple of solutions to 1 problem

    Thanks again

    RKM
Sign In or Register to comment.