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

Outlook Calendar and Tasks

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

  • johnkoh
    replied
    Re: Outlook Calendar and Tasks

    David,

    One record sample
    Code:
    dim objOutlook as P
    
    objOutlook = ole.create("Outlook.Application")
    objAppointment = objOutlook.createitem(olAppointmentItem)
    
    'Find the records from Current Form or get it from Table with filter
    'Set the current form's value into VARIABLE
    vStartDate = parentfor:start_date.value
    vDuration =  parentfor:Duration.value
    vSubject = ....
    ...
    ...  
    'repeating as you need
    
    objAppointment.Start = vStartDate           <--- your Variable NAME
    objAppointment.Duration = vDuration
    objAppointment.Subject = vSubject
    objAppointment.Body = "Test Body "          <-- I think it is for message box
    objAppointment.Location = "44/2039"
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .t.
    
    objAppointment.Save()
    
    'that all you need

    many - repeating records and using Read and get the records from your_table
    Code:
    dim objOutlook as P
    objOutlook = ole.create("Outlook.Application")
    objAppointment = objOutlook.createitem(olAppointmentItem)
    
    'Read and get the records from your_table
    'Credit to Stan
    tbl = table.current(#)  '.or <tbl>.get() 
    query.filter ="Some filter here "
    query.order ="Your order expression "
    qry = tbl.query_create("n",query.filter )     <== find the records from table
    tbl.fetch_first()
    while .not. tbl.fetch_eof()                       <== loop code, Repeating until reach end of the found records[INDENT]'your present code goes here
    objAppointment.Start = tbl.start_date           <--- your table's Field NAME
    objAppointment.Duration = tbl.Duration
    objAppointment.Subject = tbl.subject
    objAppointment.Body = tbl.your_message_field          <-- I think it is for message box
    objAppointment.Location = "44/2039"
    objAppointment.ReminderMinutesBeforeStart = 15  
    objAppointment.ReminderSet = .t.
    
    objAppointmen[/INDENT]t.Save()
    
    tbl.fetch_next()
    end while
    David, I could be wrong but just want to show you how to do. Try this, write the repeating(loop) code without "outlook_ole" and run it as test.
    See the previous Stan's comment.

    Code:
    ' a Button ---> OnPush event
    tbl = table.get(your_table_name)
    query.filter ="Customer_Id="+quote(vCustId)   'my sample
    query.order =""
    query.options ="N"
    qry = tbl.query_create()
    rcd = qry.records_get()
    	If rcd = 0 then
    	    msg("not found ")
                qry.drop()
            end if
    
    	If rcd > 0 then
    tbl.fetch_first()
    while .not. tbl.fetch_eof()
    'your present code goes here
    	    vCustNm = alltrim(tbl.Name)
                msg("Found ","for "+vCustNm)
                qry.drop()
    tbl.fetch_next()
    end while
            end if

    Leave a comment:


  • Stan Mathews
    replied
    Re: Outlook Calendar and Tasks

    If customer_id is numeric

    recs = parentform.QueryRun("customer_id = "+customer_id.value) 'get a count of the records with the same customer_id as the record visible on the form
    if recs > 0 ' if the count is greater than zero
    parentform.Fetch_First() 'make sure we're on the first record of the customer_id
    'your present code here 'writes the values from the first record to the outlook calendar
    for qx = 1 to recs -1 'loop to process the rest of the records for the current customer (total count - 1 for the first record)
    parentform.Fetch_next() 'go to the next record with the same id
    'your present code here, again 'writes the values from the next record to the outlook calendar
    next 'loop back if more records
    end if

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    sorry to be a pain but im unable to figure out this code how do i get it to repeat the value in the appoinmnet.body = for each record

    also could u meesage me you email to me as would like to send a few peenys to you via paypal as a thank you for the codding once i get it working lol bvut still thanks

    Leave a comment:


  • Stan Mathews
    replied
    Re: Outlook Calendar and Tasks

    If customer_id is character
    recs = parentform.QueryRun("customer_id = "+quote(customer_id.value))
    if recs > 0
    parentform.Fetch_First()
    'your present code here
    for qx = 1 to recs -1
    parentform.Fetch_next()
    'your present code here, again
    next
    end if

    If customer_id is numeric
    recs = parentform.QueryRun("customer_id = "+customer_id.value)
    if recs > 0
    parentform.Fetch_First()
    'your present code here
    for qx = 1 to recs -1
    parentform.Fetch_next()
    'your present code here, again
    next
    end if
    Last edited by Stan Mathews; 03-12-2014, 09:46 AM.

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    Sorry for the previous code i have now refined it and noted what i want happening

    i am working on form from a single table not a set aswell

    dim objOutlook as P


    constant olAppointmentItem = 1

    objOutlook = ole.GetObject("","Outlook.Application")

    objAppointment = objOutlook.CreateItem(olAppointmentItem)


    objAppointment.Start = DATE_OF_APPOINMENT_.value '

    objAppointment.AllDayEvent = .T.
    objAppointment.Subject = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + " " + TYPE.VALUE + " " + TIME.VALUE + " " + STAGE.VALUE
    objAppointment.Body = CUSTOMER_ID_.value + " " + NAME.text + " " + SURNAME.text + crlf(1) + " Mobile Numbers= "+ CONTACT_NUMBER1.VALUE +crlf(1) +" Phone Numbers= "+ CONTACT_NUMBER_2.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POSTCODE.TEXT + " AREA = " + AREA.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS_.TEXT + crlf(2) + crlf(3)+ "NOTES" +crlf(2)+ Notes_.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "previous jobs below " + crlf(2)`

    `in the body i want to now be able to import all the previous records in the current table with the same customer ID if feild - CUSTOMER_ID_ = "1" all records with customer id is 1 -- so this code puts this appoinment from the form into calender i want the perform a fetch and fetch all records from my table into this body of appoinmnet one after the other but just the date of the appoinment and type and notes fields any ideas help would be much apprectaiated matching the same customer id

    objAppointment.Location = CONTACT_NUMBER1.value + " " + POSTCODE.TEXT '
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .T.

    objAppointment.Save()


    ui_msg_box("Confirmation","Appointment Booked" )

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    this is the code im using and the main table is called customer and the child table is appointments with the linked field of Customer_ID


    Sorry in advance for the amount of fields :-P


    dim objOutlook as P


    constant olAppointmentItem = 1

    objOutlook = ole.GetObject("","Outlook.Application")

    objAppointment = objOutlook.CreateItem(olAppointmentItem)


    objAppointment.Start = DATE_TUNING_REQUESTED.value '

    objAppointment.AllDayEvent = .T.
    objAppointment.Subject = CUSTOMER_ID.value + " " + TITLE.text + " " + NAME.text + " " + SURNAME0.text + " C.K"'
    objAppointment.Body = CUSTOMER_ID.value + " " + TITLE.text + " " + NAME.text + " " + SURNAME0.text + crlf(1) + " Mobile Numbers= "+ MOBILE.VALUE +crlf(1) +" Phone Numbers= "+ PHONE.VALUE +crlf(1) + ADDRESS.TEXT +crlf(1)+ ADDRESS_2.TEXT +crlf(1)+ TOWN.TEXT+crlf(1)+COUNTY.TEXT +crlf(1)+POST_CODE.TEXT + " AREA = " + AREA.TEXT +crlf(2)+ " E-MAIL = " + EMAIL_ADDRESS.TEXT + crlf(2)+ "Prospect = " + ACTIVE_PASSIVE.text + " Date of enquiry = " + DATE_OF_ENQUIRY.VALUE +crlf(2)+"Date last tuned " + Field4.value + " Priority Customer = " + Field2.value +" Installment Customer = " + INSTALLMENT.value +crlf(1)+ "Piano For Sale = " + SUPPLIED_PIANO.value + " Level = "+ PIANO_OFFERS_ACTIVE_PASSIVE.VALUE + crlf(3)+ "NOTES" +crlf(2)+ Notes.value + crlf(3) + "TS_______ INV________ Paid_________ Unpaid________ Last Charge___________" + crlf(2) + "Updated Notes Below" + crlf(2)'
    objAppointment.Location = PHONE.value'
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .T.

    objAppointment.Save()


    ui_msg_box("Confirmation","Appointment Booked" )

    Leave a comment:


  • Stan Mathews
    replied
    Re: Outlook Calendar and Tasks

    Without seeing the code you are using now I can only describe what you need to do.

    You have code that copies info from the appointments table to outlook. You need to modify that code so that instead of copying the current selected record it loops through all of the child table records linked to the current parent.

    Given a browse on a form the child may be referenced as

    table.current(#)

    where # is the vertical position of the child table as viewed in the Edit Set genie. Since only the child table records linked to the current parent are accessible you can (assuming nothing interferes)

    tbl = table.current(#)
    tbl.fetch_first()
    while .not. tbl.fetch_eof()
    'your present code goes here
    tbl.fetch_next()
    end while

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    Originally posted by Stan Mathews View Post
    A form displays one record at a time. A browse displays multiple records in spreadsheet type format. Your description sounds like you want a browse of the "table linked to my customer table" on the form.

    If the form is based on a set where the customer table is the parent then it should be as easy as using the Object menu while in form design mode, choose New, select Browse, and choose the appointments table.
    hi thanks for the response i have done this sorry didnt explain it properly ------ i want this information transferd to outlook appoinment including the past appoinmnets when i press the booking of the appointment

    Leave a comment:


  • Stan Mathews
    replied
    Re: Outlook Calendar and Tasks

    A form displays one record at a time. A browse displays multiple records in spreadsheet type format. Your description sounds like you want a browse of the "table linked to my customer table" on the form.

    If the form is based on a set where the customer table is the parent then it should be as easy as using the Object menu while in form design mode, choose New, select Browse, and choose the appointments table.

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    ok so heres what im trying to do

    when i make an appoinment i can inout accross all the fields i have currently on my form easy

    however i have a table linked to my customer table with a id of customer number to link all the appoinments i have created to therer corresponding customer so a customer might have had several appoinments in the past say 1a, 2a, 3a, now when i make appointment 4a --- i can make 4a info go accross onto outlokk straight from the form open however i cant put the past ones in also as they are not shown when making new one but i require this info so that my engineers can se what has been done in the past

    how can i do this

    probally not explained well agin but have been under the weather for a long time know and that is the reason also in delay responding thanks for your help

    Leave a comment:


  • Stan Mathews
    replied
    Re: Outlook Calendar and Tasks

    Better try explaining again. You want to put all outlook appointments for one customer into where? Or you want to put all records from your table or one customer somewhere?

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    ok hello everyone again

    heres a question for you ive figured out most things in alpha five now but i was wondering and experimenting with this one at the moment

    i have set up a button to through info across to outlook no probs from a forms (with currently displayed info ) what i want to find out now is in the body of the appoinment i want to put all the records i have for customer 23 appoinments into the body from my table called appoinments i have tryed creating pdfs etc but no luck i am stumped at the moment any insight on this would be great

    dave

    (sorry for my spelling and grammar )

    Leave a comment:


  • johnkoh
    replied
    Re: Outlook Calendar and Tasks

    David,

    Review this " File Functions and Methods " from the help and this forum.
    I had the experience for Creating a folder but not opening yet. I still have the conception problem.

    Leave a comment:


  • viiddi
    replied
    Re: Outlook Calendar and Tasks

    excellent thanks a million my next qustion is how can i have a button that will go to a customers own folder i have on a server this is what i have so far

    '//Open the explorer

    sys_shell("explorer /e,/root,X:\\")

    my table name is "Customers" and the unique id is "Customer_ID" there will a folder for each of them named with there id number ideally i would love it if iy would create it if there is not one aswell

    many thanks

    from the newb of the century

    :D

    Leave a comment:


  • johnkoh
    replied
    Re: Outlook Calendar and Tasks

    David,

    how can i set it up so that the date for the appointment is the same as the field in a form in the table
    from Post #3 code and fill in your table info with using the Filter -- find the records which you need.

    dim objOutlook as P

    objOutlook = ole.create("Outlook.Application")
    objAppointment = objOutlook.createitem(olAppointmentItem)

    objAppointment.Start = "1/16/2007 11:00 AM" <--- your table field name or set to Variables
    objAppointment.Duration = 60
    objAppointment.Subject = "Test Appointment"
    objAppointment.Body = "Test Body."
    objAppointment.Location = "44/2039"
    objAppointment.ReminderMinutesBeforeStart = 15
    objAppointment.ReminderSet = .t.

    objAppointment.Save()

    Leave a comment:

Working...
X