Data Type

Navi_LearnerNavi_Learner Member Posts: 356
edited 2006-01-13 in Navision Attain
I created a field with data type option and set the option string with Yes, No. But in my current form everything is YES as default value. Is there any way to leave the option empty and let the user select one from the drop down list? Which value do I have to set in the property?

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    A yes/no option is usualy a boolean with default NO

    If you want an option for this with default blank you need to add this to the optionstring like " ,Yes,No"
  • Navi_LearnerNavi_Learner Member Posts: 356
    Thanks, Mark! If I want to set the default to release with option string open, release, how can I do?
  • ara3nara3n Member Posts: 9,256
    you can change the option to release,open, or there is a property called InitValue, change that to release.

    I hope you are not changing the status option on sales or purchase orders
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Navi_LearnerNavi_Learner Member Posts: 356
    Thank you so much! :D Mark I have another quesiton for you. Right now I create a table with no field with code data type. I set up the no field in the no series set up and define the no. and the system auto generate the numbers. But when I create a form based on the table, the No. filed doesn't generate any numbers. It seems that there's no drop down list beside the no field which goes to the series no setting. How can I do that? Thanks for your time!
  • ara3nara3n Member Posts: 9,256
    if you design the customer card and click on no field and go to the code, you'll see that on No. - OnAssistEdit trigger the following code is in there.
    IF AssistEdit(xRec) THEN
      CurrForm.UPDATE;
    


    So in above code AssistEdit is called which is a function in customer table.
    The code in customer table is like this
    AssistEdit(OldCust : Record Customer) : Boolean
    WITH Cust DO BEGIN
      Cust := Rec;
      SalesSetup.GET;
      SalesSetup.TESTFIELD("Customer Nos.");
      IF NoSeriesMgt.SelectSeries(SalesSetup."Customer Nos.",OldCust."No. Series","No. Series") THEN BEGIN
        NoSeriesMgt.SetSeries("No.");
        Rec := Cust;
        EXIT(TRUE);
      END;
    END;
    


    you can copy and paste this code and change it to fit your table logic.
    Also a suggestion, if you want to do something, find out where it is done in navision. Turn on the debugger and follow the steps F8 and F5, put breakpoints F9. You'll see how navision works.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    The code in the assistedit of the No field on the form does not affect the generation of the no. It only enables you to use more than one noseries.

    Your error is probably somewhere in the OnInsert tigger or the OnValidate of the No. field.

    Post your code if you still have difficulties with this.
Sign In or Register to comment.