Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Customized error messages ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Customized error messages ?

    I want to customize the error messages, but I dont know how to do this, for example, into a form, the field key when is duplicate, the error messages say: values for this field must be unique: Id_product. I want to change the text by another one, specially in another language..

    I hope somebody can help me.

    Desktop application.

    #2
    Re: Customized error messages ?

    I will be interested to see comments from others but I do not set unique at the table level (which causes the messages you mention when a duplicate is entered) and instead use code behind a save button to provide "friendly" messages .
    By carefully controlling what a user can do in a form you can avoid all system messages.
    I typically have "Add", "Change", "Delete", "Save", "Cancel" and
    "Close" buttons on every form.
    I also have control the appearance of buttons so that they appear "grayed out" when disabled. Also I have a label showing the mode that the form is in so users are aware of what is going on.

    Comment


      #3
      Re: Customized error messages ?

      I"ll echo what Garry said. No Table level restrictions and code the evaluation of values. I have gone so far as using onle xdiaolgs for data entry/edits and evaluating the entry/edit values at the exit of the dialog. I have a whole group of messages that I have written into UDFs for this purpose. Here is a standard message box I might call.

      Code:
      FUNCTION dlg_msg_box2 AS V (input_msg as C, box_pos as C,open_time as n)
      	
      dim dlg_body as C
      dim mdlg as C="ACTION MESSAGE"
      vlen=len(alltrim(input_msg))+14
      box_pos=word(box_pos,1,"-")+","+word(box_pos,2,"-")
      input_msg=space(5)+input_msg
      
      z1=<<%dg1%
      {position=%dg1%
      
      z2=<<%dg2%
      }{background=yellow}{font=arial,10,b}{nocaption}
      {lf};
      {region}
      {text=%dg2%
      
      z3=<<%dg3%
      ,1input_msg}
      {lf};
      {endregion};
      %dg3%
      
      message_wave()
      dlgF=z1+box_pos+z2+vlen+z3
      'msgbox(dlgF)
      ui_modeless_dlg_box(mdlg,dlgF)
      
      xbasic_wait_for_idle()
      sleep(open_time)
      ui_modeless_dlg_close(mdlg)
      
      END FUNCTION
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: Customized error messages ?

        Ah, the joy of computers - and databases. There are multiple way of doing just about everything.

        I prefer to do most of my "field rule" checking (it's in quotes for a reason) at the table level so I don't have to do it for every form or have to worry that I did it differently in other forms. If I do it once correctly at the table level then I don't need to worry about it as I build each form. HOWEVER, if I want custom error messages then I don't use the built-in field rules.

        In that case, my preferred method is to create my own CanSave Record script (or, more likely, a function call) that handles the "field rule" checking (that's why it's in quotes - it's often not a standard field rule) and provides my custom error messages.

        Here's a simplistic example. (I really wouldn't restrict a table such that it required unique last names.)
        Code:
        tc = table.current()
        tc.change_dtf = date()   [COLOR="Blue"]'This is the ONLY way a change date should be set. It should NEVER be a calc field - NEVER.[/COLOR]
        
        IF tc.mode_get() = 2	'Enter mode.
             [COLOR="Blue"]'Since the table is in Enter mode, the lookup won't find the current record.[/COLOR]
             found_name = lookupc( "F", tc.last_name, "Last_name", "customer", "Last_Name" )
             IF found_name = new_last_name
                  msg = "Duplicate last name" + crlf(2)
                  msg = msg + "Please enter a different last name."
                  ui_msg_box( "ERROR", msg, ui_attention_symbol )
                  cancel()    [COLOR="blue"]'This is what keeps the record from saving.[/COLOR]
             END IF
        END IF
        Last edited by CALocklin; 10-10-2010, 10:46 PM.

        Comment

        Working...
        X