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

Dr. Peter Wayne pop up alert help

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

    Dr. Peter Wayne pop up alert help

    I am trying to get a pop up alert to work with the alpha sports db.

    I have the Dr. Peter Wayne XBasic book and i added this code to the forms OnFetch event. This is in the book

    But when i start the form now i get this pop up box saying

    Script:OnFetch line:10
    cust=table.get(“customer”) 'pointer to the customer table
    No such field

    Here is the code from the Book i used and i made a table called Alerts.

    Code:
    dim cust as P
    dim custname as C
    dim cust_id as C
    dim alert as C
    
    cust=table.get(“customer”)  'pointer to the customer table
    cust_id = cust.CUSTOMER_ID
    custname = trim(cust.FIRSTNAME)+””+trim(cust.LASTNAME)
    alert=table.external_record_content_get(“alerts”,”alert_text”,””,\
    “Customer_Id=”+quote(Cust_ID))
    
    if alert>””then  'show the alert!
     ui_dig_box(“Alert for “+custname,<<%dig%
     {font=Arial,10}
     {text=%H=R%40,5alert}
     <”ok>;
    %dig%)
    end if
    Last edited by AaronBBrown; 02-01-2007, 10:11 AM.

    #2
    Re: Dr. Peter Wayne pop up alert help

    Ok i got it to work BUT.

    The book and the samples do not show a way to have a button to have a form pop up linked to the current record for me to enter in the Alert information for a customer.

    How do i enter in the Alert information???????.

    I can do it buy going to the form i made but then i need to know what customer ID to put in.

    How can i use a button on the customer form to pop up the Alerts form and have it auto fill in the current customers IDs

    ????
    thanks

    By the way i love this pop up Alert function

    Comment


      #3
      Re: Dr. Peter Wayne pop up alert help

      You need a script something like this, attached to a button or a menu choice:
      Code:
      alerts=table.open("alerts")
      query.filter="account="+quote(table.get("customer").customer_ID)
      query.order=""
      query.options=""
      ix=alerts.query_create()
      nrecs=ix.records_get()
      alerts.close()
      if nrecs>0 then
         edit_alert(table.get("customer").customer_ID)
      else
      	add_alert(table.get("customer").customer_ID)
      end if
      and then your add_alert function is:

      Code:
      'Date Created: 05-May-2003 03:32:01 PM
      'Last Updated: 05-May-2003 04:23:16 PM
      'Created By  : Peter Wayne
      'Updated By  : Peter Wayne
      FUNCTION add_alert AS V (customer_ID AS C )
      	dim global user as c
      	dim customer as c
      	dim alert_text as c
      	dim varC_result as c
      	
      	customer=table.external_record_content_get("customer",\
      	"customer_ID+space(3)+trim(last_name)+','+first_name","account",quote(account)+"=account")
      varC_result=ui_dlg_box("Add Alert",<<%dlg%
      {text=80customer};
      Enter alert text:;
      [%mw%.60,5alert_text];
      {line=1,0};
      <*10OK> <10Cancel>;
      %dlg%)
      if varC_result="OK" then
         alerts=table.open("alerts",file_rw_shared)
         alerts.enter_begin()
         		alerts.customer_ID=customer_ID
         		alerts.date_creat=date()
         		alerts.time_creat=time()
         		alerts.created_by=user
         		alerts.free_text=alert_text
         	alerts.enter_end()
         	alerts.close()
      end if
      	
      END FUNCTION
      The edit_alert() function is similar:
      Code:
      'Date Created: 05-May-2003 04:15:34 PM
      'Last Updated: 05-May-2003 04:53:04 PM
      'Created By  : Peter Wayne
      'Updated By  : Peter Wayne
      FUNCTION edit_alert AS V (customer_ID AS C )
      	dim global user as c
      	dim customer as c
      	dim alert_text as c
      	dim varC_result as c
      	
      	customer=table.external_record_content_get("customer",\
      	"customer_ID+space(3)+trim(last_name)+','+first_name","customer_ID",quote(customer_ID)+"=customer_ID")
      	alerts=table.open("alerts",file_rw_shared)
      	query.filter="customer_ID="+quote(customer_ID)
      	query.order=""
      	query.options=""
      	alerts.query_create()
      	alert_text=alerts.Free_text
      	created_by=alerts.Created_by
      	time_creat=alerts.Time_creat
      	date_creat=alerts.Date_creat 
      
      varC_result=ui_dlg_box("Edit Alert",<<%dlg%
      {text=80customer};
      Created by {text=created_by};
      Created on {text=date_creat} on {text=time_creat};
      Edit alert text:;
      [%mw%.60,5alert_text];
      {line=1,0};
      <10OK> <*10Cancel>;
      %dlg%)
      if varC_result="OK" then
         alerts.change_begin()
         		alerts.customer_ID=customer_ID
         		alerts.date_creat=date()
         		alerts.time_creat=time()
         		alerts.created_by=user
         		alerts.free_text=alert_text
         	alerts.change_end()
      end if
      alerts.close()
      END FUNCTION
      and you probably want a delete_alert() function as well, but I'll leave that up to you!

      - Peter

      Comment


        #4
        Re: Dr. Peter Wayne pop up alert help

        Hi you posted
        and then your add_alert function is:

        This version is different from the one in the dl sample and book.

        What is the best version to use?

        ---------------------------------------------------------
        Ok i tryed this version the pop up Alert is not poping up now


        Can i some how change the look of the pop up box the colors?
        Last edited by Digitaled; 01-31-2007, 11:29 PM.

        Comment


          #5
          Re: Dr. Peter Wayne pop up alert help

          I added this to a button and it will not do anything unless the customer all ready has a alert then when i push the button it then makes the alert pop up again?
          Code:
          'Date Created: 13-Oct-2005 07:53:31 PM
          'Last Updated: 31-Jan-2007 01:43:05 AM
          'Created By  : Peter Wayne
          'Updated By  : Digitaled
          cust=table.get("customer")
          customer_id = cust.CUSTOMER_ID
          custname = trim(cust.FIRSTNAME)+" "+trim(cust.LASTNAME)
          alert=table.external_record_content_get("alerts","alert_text","",\
          "Customer_Id="+quote(Customer_ID))
          
          if alert>"" then   ' show the alert!
             ui_dlg_box("Alert for "+custname,<<%dlg%
             {font=Arial,10}
             {text=%H=R%40,5alert}
             <*OK>;
          %dlg%)
          end if
          Last edited by AaronBBrown; 02-01-2007, 10:12 AM.

          Comment


            #6
            Re: Dr. Peter Wayne pop up alert help

            The button script you include is just the script to show an alert. Why would you expect it to do anything else?

            The scripts I provided show you how to add and edit alerts, but they have extra fields that are not present in the example in the book. Take out the references to all fields except customer_id and alert_text.

            Comment


              #7
              Re: Dr. Peter Wayne pop up alert help

              Originally posted by Peter.Wayne View Post
              The button script you include is just the script to show an alert. Why would you expect it to do anything else?
              -------------------
              Becouse i was asking for a way to add in information into the Alert creating a one for a customer not just a show alert.
              --------------------------

              The scripts I provided show you how to add and edit alerts, but they have extra fields that are not present in the example in the book. Take out the references to all fields except customer_id and alert_text.
              ---------------------
              Ok i tried this and the alert will not work but when i use the code from the book it will work???

              So i still have no way to add a alert to a customer i can not get the code to work.

              Any suggestions? i am, lost

              Here is what i have trying to use this code you posted taking out the other items.

              On the customer form on fetch i have
              --------------------------------------

              'Date Created: 05-May-2003 03:32:01 PM
              'Last Updated: 02-Feb-2007 12:51:55 AM
              'Created By : Peter Wayne
              'Updated By : Digitaled
              FUNCTION add_alert AS V (customer_ID AS C )
              dim global user as c
              dim customer as c
              dim alert_text as c
              dim varC_result as c

              customer=table.external_record_content_get("customer",\
              "customer_ID+space(3)+trim(last_name)+','+first_name","account",quote(account)+"=account")
              varC_result=ui_dlg_box("Add Alert",<<%dlg%
              {text=80customer};
              Enter alert text:;
              [%mw%.60,5alert_text];
              {line=1,0};
              <*10OK> <10Cancel>;
              %dlg%)
              if varC_result="OK" then
              alerts=table.open("alerts",file_rw_shared)
              alerts.enter_begin()
              alerts.customer_ID=customer_ID
              alerts.enter_end()
              alerts.close()
              end if

              END FUNCTION

              -----------------------------

              On a button on the customer form called Set Alert i have onpush
              -----------------
              'Date Created: 02-Feb-2007 12:50:03 AM
              'Last Updated: 02-Feb-2007 12:50:03 AM
              'Created By : Digitaled
              'Updated By : Digitaled
              FUNCTION edit_alert AS V (customer_ID AS C )
              dim global user as c
              dim customer as c
              dim alert_text as c
              dim varC_result as c

              customer=table.external_record_content_get("customer",\
              "customer_ID+space(3)+trim(last_name)+','+first_name","customer_ID",quote(customer_ID)+"=customer_ID")
              alerts=table.open("alerts",file_rw_shared)
              query.filter="customer_ID="+quote(customer_ID)
              query.order=""
              query.options=""
              alerts.query_create()

              varC_result=ui_dlg_box("Edit Alert",<<%dlg%
              {text=80customer};
              Edit alert text:;
              [%mw%.60,5alert_text];
              {line=1,0};
              <10OK> <*10Cancel>;
              %dlg%)
              if varC_result="OK" then
              alerts.change_begin()
              alerts.customer_ID=customer_ID
              alerts.change_end()
              end if
              alerts.close()
              END FUNCTION
              --------------------------------------

              Using this the pop up alert is not working and the Set Alert button will do nothing?

              Comment

              Working...
              X