code

dharshan
dharshan Member Posts: 37
Hi,

could any ony tell me how to check whether code field is blank or not?


thanks in advance!!!

Comments

  • Savatage
    Savatage Member Posts: 7,142
    when do you want to check it?

    on opening of a form or closing of a form or inserting a record,etc?

    more info on what you are trying to do will help alot with the answer.
  • dharshan
    dharshan Member Posts: 37
    i am entering a record in the form, on validating that field i must check whether the field is blank. if so then the user must not go to next field.
  • Savatage
    Savatage Member Posts: 7,142
    there is a property on the field called NOTBLANK - you can set that to yes,

    But if the user never enters that field the message will not be triggered.

    So I would search he forum for "Mandatory Fields" you will find many posts.
  • dharshan
    dharshan Member Posts: 37
    Hi,

    Thanks for your quick response. =D>

    whether that notblank will check only for primary key field or for all fields.
  • Savatage
    Savatage Member Posts: 7,142
    You can set every field you want mandatory to "not blank"=yes
    once the field is filled it will always give you an error message if you try to "clear it".

    as I said if the field is passed over then "not blank" does not help. you need to check in another way.
    as I said searching for "mandatory" or "not blank" you will find many posts.

    a good way is also described here:
    http://dynamicsuser.net/forums/t/23883.aspx
  • dharshan
    dharshan Member Posts: 37
    HI,

    After reading those post i inserted TESTFIELD("Code"); ondeactivate trigger but is showing an error message you must fille the code in field item code and closing the form.

    inserting a field and blocking that will be good in my case. is there any other way.

    ](*,) ](*,) ](*,)
  • Savatage
    Savatage Member Posts: 7,142
    The error message is unclear to me.
    that trigger isn't the one i'd use.

    Basically the steps are Oninsert the field "blocked" is set to TRUE!

    Onvalidate of the blocked field (when the person goes to UNCHECK it to make it active)
    it then checks the fields you want to have mandatory using a simple testfield code.
    Basically in the on validate trigger of the "blocked" field you add code like
    Testfield('My Field 1");
    Testfield('My Field 2");
    Testfield('My Field 3");
     etc.
    

    This way when you try to unblock the customer you won't be able to till you fill in themissing fields.