Adding a new field in Ax2009 table

Last post 10-30-2008 2:02 AM by Ivan Kashperuk. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-01-2008 6:54 AM

    Adding a new field in Ax2009 table

    Hi,

    When i add a new field of type string to a table in Ax, I can view the field in Ax database.

    But the problem is that by default it is of type "not null".

    If i manually remove that constraint, it shows error in Ax. Can any1 guide me how to remove this constraint as i want to allow nulls?

    Thanks,

    Roopali.

  • 10-01-2008 10:47 PM In reply to

    Re: Adding a new field in Ax2009 table

    Hi Roopali,

    Check the "Mandatory" property of the new field. You probably have it set to "Yes". Hope this helps. --Tom

    Tom Kim
    http://axinfo.blogspot.com/
  • 10-02-2008 1:08 AM In reply to

    Re: Adding a new field in Ax2009 table

    The mandatory field was not set to yes.

    Thanks anyways. Let me know.

     

  • 10-02-2008 7:49 AM In reply to

    Re: Adding a new field in Ax2009 table

    Roopali,

    Under table methods check all methods that are named like validatewrite, you might find what you looking for.

    Regards,
    Abdallah

  • 10-02-2008 9:51 PM In reply to

    Re: Adding a new field in Ax2009 table

    Nope, i dont think this would help. Thanks for trying.

    I am able to leave the records empty for that field but i want to change the type to "allow nulls" in SQL. If i modify it in db it affects the Ax and throws an error.

  • 10-02-2008 10:22 PM In reply to

    Re: Adding a new field in Ax2009 table

    Hi Roopali,

    I forgot to mention that the table's "Mandatory" setting can be overriden by the same setting on the form's data source. --Tom

    Tom Kim
    http://axinfo.blogspot.com/
  • 10-02-2008 11:11 PM In reply to

    Re: Adding a new field in Ax2009 table

    Hope i got you right. How can i override the forms setting with that of the table's? 

    I have not set the "Mandatory" field to yes in Ax.

    In the database, its set to "not null". When i modify the design and allow nulls, it throws an error in Ax.

    I can still load the data with blank values but i want to change the type to "allow nulls" in the database.

     

     

  • 10-02-2008 11:37 PM In reply to

    Re: Adding a new field in Ax2009 table

    Hi Roopali,

    I misunderstood what you wanted. Mandatory, as you found out, does not change the column's "allow nulls" setting in the database. I don't think AX supports nulls. You cannot assign a null to a field as far as I can tell.

    May I ask why you want to use null in the field? --Tom

    Tom Kim
    http://axinfo.blogspot.com/
  • 10-03-2008 12:21 AM In reply to

    Re: Adding a new field in Ax2009 table

    I am adding new fields like notes. For few of the records, this field is empty/blank.

  • 10-03-2008 3:12 AM In reply to

    Re: Adding a new field in Ax2009 table

    Hi Roopali,

    You can check the mandatory option in your control (stringEdit).) under design node of your form.

    With Regards
    Rajdip Das
    Kolkata
  • 10-03-2008 3:17 AM In reply to

    Re: Adding a new field in Ax2009 table

    Hi,

    I have done that. Its set to "No".

  • 10-03-2008 8:30 AM In reply to

    Re: Adding a new field in Ax2009 table

    Hi Roopali,

    Empty/blank is different than null. I've rarely seen an application that would allow nulls.

    If all you're really after is to allow the user to leave a field empty, then you just have to make sure that the field's "Mandatory" flag is set to "No" on the table. However, you can override this in a form's data source by setting the field's "Mandatory" property to "Yes", so when the form is in use the field is mandatory. The field won't be mandatory anywhere else.

    Hope this helps. --Tom

    Tom Kim
    http://axinfo.blogspot.com/
  • 10-05-2008 3:03 AM In reply to

    Re: Adding a new field in Ax2009 table

    Yes you are right. I found out that in Ax there is nothing that allows us to set "allow nulls" as in SQL Server.We can leave it blank without Ax showing any error. But if i try to insert "NULL", it does not allow. So if i insert data from the backend i.e. Ax db, i need to make sure through queries that either i enter a value or leave it blank without NULLs as it does not allow NULLs to be inserted. Hope nulls could be allowed as in databases. But this feature/requirement can be ignored as it does not make much of a difference.

    Thanks Tom.

    -Roopali.

  • 10-05-2008 7:05 AM In reply to

    Re: Adding a new field in Ax2009 table

    Hi Roopali,

    as you would have noticed by now, Null are handled very differently in x++ when compared to other platforms..

    there is a good article msdn on how ax handles nulls.. do check it out:

    http://msdn.microsoft.com/en-us/library/aa846236(AX.10).aspx

    regards,

    Mohammed Rasheed

    www.dynamic-ax.co.uk

     

    www.dynamic-ax.co.uk
  • 10-05-2008 10:37 PM In reply to

    Re: Adding a new field in Ax2009 table

    Yes you are right. Thanks for the article.

    Regards,

    Roopali.

Page 1 of 2 (20 items) 1 2 Next >