Dialog input decimal precision?

pwizzlepwizzle Member Posts: 2
Hi all, I am using a dialog for user input. One of the values the user enters is a decimal number with 4 decimal places. When I enter the value I get the following non-debuggable error message. "The field can have a maximum of 2 decimal places"

Comments

  • SavatageSavatage Member Posts: 7,142
    edited 2007-12-10
  • SavatageSavatage Member Posts: 7,142
    Ok Here's how you do it.

    Remember Dialog isn't the most flexible thing in Navision. In fact there is probably a better way of handling whatever you are doing.

    I added a little test dialog based off a command button.
    I press the command button and I enter my TEXT (YES TEXT)
    vUnitPrice is type TEXT. It allows me to enter a 4 digit decimal & then using the EVALUATE function convert it to decimal. I tested it & it works.

    (onPush)Example
    Item.GET("No."); 
    CLEAR(vUnitPrice);
    Window.OPEN('Enter Text ##############1##',vUnitPrice);
    Window.INPUT(1,vUnitPrice);
    
    IF CONFIRM('Is This Price Correct? %1',TRUE,vUnitPrice)
     THEN 
      BEGIN 
       EVALUATE(Item."Unit Price",vUnitPrice);
       Item.MODIFY; 
       Window.CLOSE; 
        END 
     ELSE 
      BEGIN 
       CLEAR(vUnitPrice);
       Window.CLOSE; 
    END;
    

    The force is now with you young pwizzle :lol:
Sign In or Register to comment.