Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Outlook forms pt.2

Posted on 2004-05-03
2
Medium Priority
?
252 Views
Last Modified: 2010-04-08
Stefri helped me on this http:Q_20974139.html

I have one thing I'd like to adjust:
I'd like the "comments" box to be hidden unless Deny is clicked...
0
Comment
Question by:sirbounty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
stefri earned 600 total points
ID: 10980390
There you are....
Replace the code in Script Editor
Maybe will you have to clear the form cache
Stefri

Option Explicit

dim myControls
dim reqBusApp
dim reqBusden
dim reqUseApp
dim reqUseDen
dim uComments
dim busUse
dim appDen
dim theBody
dim myReply
dim defComments
dim theText
dim tmpText
dim theAmount
sub approved_click() ' <<<<<<<<<<<<<< added to handle aproved click
      if myControls.item("approved").value = true then
            myControls.item("comments").visible = false
      else
            myControls.item("comments").visible = true
      end if
end sub
sub denied_click()' <<<<<<<<<<< added to handle denied click
      if myControls.item("approved").value = true then
            myControls.item("comments").visible = false
      else
            myControls.item("comments").visible = true
      end if
end sub
sub submit_click()
' check all mandatory fields
dim strError
dim appDen

dim ok
ok = true
appDen = ""
strError = "Missing "
if myControls.item("SHARENAME").value = "" and  myControls.item("business").value then
      ok = false
      strError = strError & chr(13) & "Sharename"
end if
if myControls.item("AMOUNT").value = "" and  myControls.item("approved").value then
      ok = false
      strError = strError & chr(13) & "Amount"
end if
if myControls.item("TICKET").value = "" then
      ok = false
      strError = strError & chr(13) & "Ticket"
end if

if ok then
      ' get approved/denied
      if myControls.item("approved").value = true then
            appDen = true
      elseif myControls.item("denied").value = true then
            appDen = false
      else
            msgbox "Select Approved or Denied", 16
            exit sub
      end if
      if myControls.item("business").value = true then
            busUse = true
      elseif myControls.item("user").value = true then
            busUse = false
      else
            msgbox "Select Business or User", 16
            exit sub
      end if

else
      msgbox strError, 16 ' vbcritical
      exit sub
end if
      set myReply = application.createItem(0)
      myreply.Subject = "Ticket #: " & myControls.item("Ticket").value
      theBody = "Support Personnel"
      if busUse then
            if appDen = true then
                  if myControls.item("MB") = true then
                        theAmount = myControls.item("AMOUNT") & " MB "
                  else
                        theAmount = myControls.item("AMOUNT") & " GB "
                  end if
                  theText = replace(reqBusApp,"$SHARENAME$", myControls.item("SHARENAME"))
                  tmpText = replace(theText,"$AMOUNT$", theAmount  )
                  myReply.body = tmpText & chr(13) & theBody
            else
                  theText = replace(reqBusDen,"$SHARENAME$", myControls.item("SHARENAME"))
                  defComments = " "
                  if myControls.item("COMMENTS") <> "" then
                        defComments = chr(13) & "Reason:" & chr(13) & myControls.item("COMMENTS")
                  end if
                  tmpText = replace(theText,"$COMMENTS$", defComments )
                  myReply.body = tmpText & chr(13) & theBody
            end if
      else
            if appDen = true then
                  if myControls.item("MB") = true then
                        theAmount = myControls.item("AMOUNT") & " MB "
                  else
                        theAmount = myControls.item("AMOUNT") & " GB "
                  end if
                  theText = replace(reqUseApp,"$SHARENAME$", myControls.item("SHARENAME"))
                  tmpText = replace(theText,"$AMOUNT$", theAmount)
                  myReply.body = tmpText & chr(13) & theBody
            else
                  theText = replace(reqUseDen,"$SHARENAME$", myControls.item("SHARENAME"))
                  defComments = chr(13) & "Reason:" & chr(13) & uComments
                  if myControls.item("COMMENTS") <> "" then
                        defComments = hr(13) & "Reason:" & chr(13) & myControls.item("COMMENTS")
                  end if
                  tmpText = replace(theText,"$COMMENTS$", defComments)
                  myReply.body = tmpText & chr(13) & theBody
            end if
      end if
      myReply.display true
end sub

sub item_open()
      ' get controls on modified page labeled Approve Increase
dim myInspector
dim myPage
set myInspector = Item.getInspector
set myPage = myInspector.ModifiedFormPages("Approve Increase")
set myControls = myPage.Controls
set myInspector = Nothing
set myPage = nothing
approved_click ' <<<<<<<<<<<<< Added; calls the click event when opening
reqBusApp = "Your request for additional storage capacity on  $SHARENAME$ share has been approved, effective immediately, for the $AMOUNT$ increase requested."
reqBusDen = "Your request for additional storage capacity on  $SHARENAME$ share has been denied. $COMMENTS$."
reqUseapp = "Your request for additional storage capacity on your home share (H drive) has been approved, effective immediately, for a $AMOUNT$ increase."
reqUseDen = "Your request for additional storage capacity on your home share (H drive) has been denied. $COMMENTS$"
uComments = "Home shares are limited to 200mb total quota.  If you cannot archive the data on your H drive, you will need to utilize a group share for storing this data"
end sub

   
0
 
LVL 67

Author Comment

by:sirbounty
ID: 10988607
Thanx again stefri! :D
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question