Field Format!!!

HanenHanen Member Posts: 281

Hello,

How can I define a Format for a field, My field "FieldA" depends on an other field "FieldB":

FieldA must have this format: Provider='xxxx';databaseName='xxxxx';ServerName='xxxx'... if FieldB=A
else
FieldA must have this format: Login='xxxx';Password='xxxx';Provider='xxxx';databaseName='xxxxx';ServerName='xxxx'...

how can I tell my user that the data will be on that format :oops:
Thanks for your help!!!

Regards

Hanen TALBI

Comments

  • prabhupdeshprabhupdesh Member Posts: 49
    In the OnFormat Trigger of field B write the condition u have specified:

    For example:
    IF Field B = A THEN
    color=#800080]FieldA must have this format: Provider='xxxx';databaseName='xxxxx';ServerName='xxxx'...
    else
    FieldA must have this format: Login='xxxx';Password='xxxx';Provider='xxxx';databaseName='xxxxx';ServerName='xxxx'...
  • HanenHanen Member Posts: 281
    The problem is that the use must fill the FieldB with the right format the Login='xxxx' will be replaced by Login='Hanen' etc...
    Regards

    Hanen TALBI
  • kinekine Member Posts: 12,562
    And why do not just let user fill the data like databaseName, provider etc. and the system will create the connect string automatically?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • HanenHanen Member Posts: 281
    This is the way the user wants to be :cry: it would be much easier :(
    Regards

    Hanen TALBI
  • kinekine Member Posts: 12,562
    Are you sure that it will be easier? I think no... because if you will want to fullfill the request, you will need to do it in a way, which will work in a very strange way, because you cannot force the user to enter the value in some specific syntax by default tools in NAV.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • HanenHanen Member Posts: 281
    it would be easier if can do it in a different wya then to le the use full fill the field that's what I meant :(
    I think I will try your manner thanks :)
    Regards

    Hanen TALBI
  • garakgarak Member Posts: 3,263
    if it is a form where you store the connecting settings for an ODBC or ADO connection, why do you not create there some fields like:
    Database
    Server
    Login
    Password
    etc? The user enter there the values and you build the connection string based on this values ....
    Do you make it right, it works too!
  • David_SingletonDavid_Singleton Member Posts: 5,479
    garak wrote:
    if it is a form where you store the connecting settings for an ODBC or ADO connection, why do you not create there some fields like:
    Database
    Server
    Login
    Password
    etc? The user enter there the values and you build the connection string based on this values ....

    Ah you mean like Kine just suggested above. Yes that is a good idea.
    David Singleton
  • garakgarak Member Posts: 3,263
    Ah you mean like Kine just suggested above. Yes that is a good idea.

    Yes, i mean the same
    Do you make it right, it works too!
  • HanenHanen Member Posts: 281
    Yes I did it just like that, as separate fields.
    Thanks for evryone's answer =D> :thumbsup:
    Regards

    Hanen TALBI
Sign In or Register to comment.