• baseball123
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 6
    Replies

I have a visualforce page that everytime changes the date of each line item, after price recalculation, the scrollbar will always move to the top. If there are a lot of line items on the page, it becomes annoying after change the date of each line item. Any idea how to stop the scrollbar moving after price recalculation and just let the scrollbar stay where it is? The following is the code for the field. 

 

<apex:column headerValue="End Date">
<apex:outputPanel style="display: inline-block;">
<apex:inputField id="filteredInventoryItemEndDate" value="{!i.inputProxy.EndDate__c}">
<apex:actionSupport event="onchange" action="{!recalculatePriceAction}" rerender="filteredInventoryPageBlock" status="priceRecalculationStatus" onsubmit="disable_buttonAll();" oncomplete="enable_buttonAll();">
<apex:param assignTo="{!selectedResultItemIndex}" value="{!i.index}" name="selectedResultItemIndex"/>
</apex:actionSupport>
</apex:inputField>
</apex:outputPanel>
</apex:column>

 

Thanks in advance.

I'm experiencing a very weird situation that random number populated to Payment_Schedule__c.Amount_to_be_paid__c. This is a currency field: Currency(16, 2). For example, I System.out.println the value before set to this field: 55.20666666666665. So 55.21 should be expected to be updated to this field but sometime 887.21 is populated in this field. The following is the code. I print out the value rigth before update and in the log file it shows 55.20666666666665 but after update 887.21 is the value being populated. Most of the time it populates the correct value but out of blue the wrong value is populated. It absolutely puzzles me. Anyone can give me a hint, it will be greatly appreciated. 

 

 

 

Payment_Schedule__c update_PS= new Payment_Schedule__c();

update_PS.setId(originalPS.getId());

double newPaymentAmount = 0;
newPaymentAmount = originalPS.getAmount_to_be_paid__c() + diffAmount;

update_PS.setAmount_to_be_paid__c(newPaymentAmount); 
System.out.println("updatePS.getAmount_to_be_paid__c() is " + update_PS.getAmount_to_be_paid__c()); 

Payment_Schedule__c[] ps_Updates = new Payment_Schedule__c[1];
ps_Updates[0] = update_PS;
try {
SaveResult[] saveResults = connection.update(ps_Updates);
//for (SaveResult saveResult : saveResults) {
for (int j=0; j<saveResults.length; j++) {

if (saveResults[j].isSuccess()) {
Logger.log("Successfully updated Original Payment Schedule ID: " +
saveResults[j].getId(), true);
System.out.println("Successfully updated Original Payment Schedule ID: " +
saveResults[j].getId());

} else {
// Handle the errors.
// We just print the first error out for sample purposes.
Error[] errors = saveResults[j].getErrors();
if (errors.length > 0) {
Logger.log("Error: could not update " +
"Original Payment Schedule ID " + saveResults[j].getId() + ".", true);

Logger.log("\tThe error reported was: (" +
errors[0].getStatusCode() + ") " +
errors[0].getMessage() + ".", true);

}
}
break;
}

} catch (ConnectionException ce) {
ce.printStackTrace();
}

Is it possible to get trigger.old[0].value on BEFORE UPDATE? I want to compare the old value and new value in order to decide to go to run the rest of the trigger in order to reduce number of soql queries.

 

Thanks in advance,

All, 

 

I tried to set a date to SFDC. The timestamp is Mon Jun 04 20:17:53 EDT 2012 but when the date get populated to SFDC, the date fields shows as 6/5/2012. I even printed the calendar info before populates it to SFDC and the calendar shows it's June 04. The data the code is getting is from Germany. I have tried different timezone such as "Europe/Zurich" and "GMT" and both of them don't work. Why does SFDC automatically add hours to this timestamp?

 

The code and system.out.print is below:

 

Date sDate = getStartDate(); 

Calendar startDate = new GregorianCalendar(TimeZone.getTimeZone("America/New_York"));
startDate.setTime(sDate);

 

startDate.getTime() is Mon Jun 04 20:17:53 EDT 2012
startDate is java.util.GregorianCalendar[time=1338855473000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=America/New_York,offset=-18000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2012,MONTH=5,WEEK_OF_YEAR=23,WEEK_OF_MONTH=2,DAY_OF_MONTH=4,DAY_OF_YEAR=156,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=8,HOUR_OF_DAY=20,MINUTE=17,SECOND=53,MILLISECOND=0,ZONE_OFFSET=-18000000,DST_OFFSET=3600000]
 

Thanks in advance,

 

I'm trying to develop a visualforce page to allow user to type the product name (or partial product name) in a selectOption field. Once users hit enter, the selectOption field would display all the active products start with what the user types. Can anyone share some thoughts on how to achieve this goal?

 

Thanks in advance,

I can query deleted records inside of SFDC debug window by adding "all rows" to the end of soql query. But when I run this soql query inside of my Java project, it gives me an error complaining the keyword "all rows". Can anyone tell me how to find the deleted records in SFDC from Java project? 

 

Thanks in advance,

Can anyone tell me Opportunity StageDuration API Name and how to access it? 

 

Thanks in advance.

I need to have our SFDC users to have single sign on ability from SFDC to this third party website called GetSatisfaction. GetSatisfaction provides something called Fastpass to allow other external websites have single sign on ability to them. In order to implement Fastpass, other websites need to download GetSatisfaction's library. Also a couple lines of script need to be embedded in the footer of the external website. If I want my users to have single sign on ability from our SFDC, I will need to download the library and embed the script somewhere in SFDC. Has anyone done this before? I don't know where to store the library inside of SFDC and where to embed the script inside of SFDC. The script basically is to plant a cookie with login credential so that GetSatisfaction can recognize. It will be greatly appreciated if anyone can point me to the right direction.  

I got an error: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML"

 

Can anyone tell me how I can generate some test code in Execute Anonymous to troubleshoot the following Callout SOAP request and response. The callout logic is very simple and it's about celsius to farenheit conversion. 

 

//Generated by wsdl2apex

public class ConverterWS {
    public class ConverterHttpSoap11Endpoint {
        public String endpoint_x = 'http://localhost:8080/Axis2WSTest/services/Converter.ConverterHttpSoap11Endpoint/';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://wtp', 'ConverterWS'};
        public Double celsiusToFarenheit(Double celsius) {
            ConverterWS.celsiusToFarenheit_element request_x = new ConverterWS.celsiusToFarenheit_element();
            ConverterWS.celsiusToFarenheitResponse_element response_x;
            request_x.celsius = celsius;
            Map<String, ConverterWS.celsiusToFarenheitResponse_element> response_map_x = new Map<String, ConverterWS.celsiusToFarenheitResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'urn:celsiusToFarenheit',
              'http://wtp',
              'celsiusToFarenheit',
              'http://wtp',
              'celsiusToFarenheitResponse',
              'ConverterWS.celsiusToFarenheitResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
        public Double farenheitToCelsius(Double farenheit) {
            ConverterWS.farenheitToCelsius_element request_x = new ConverterWS.farenheitToCelsius_element();
            ConverterWS.farenheitToCelsiusResponse_element response_x;
            request_x.farenheit = farenheit;
            Map<String, ConverterWS.farenheitToCelsiusResponse_element> response_map_x = new Map<String, ConverterWS.farenheitToCelsiusResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'urn:farenheitToCelsius',
              'http://wtp',
              'farenheitToCelsius',
              'http://wtp',
              'farenheitToCelsiusResponse',
              'ConverterWS.farenheitToCelsiusResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
    }
    public class celsiusToFarenheit_element {
        public Double celsius;
        private String[] celsius_type_info = new String[]{'celsius','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'celsius'};
    }
    public class celsiusToFarenheitResponse_element {
        public Double return_x;
        private String[] return_x_type_info = new String[]{'return','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class farenheitToCelsiusResponse_element {
        public Double return_x;
        private String[] return_x_type_info = new String[]{'return','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class farenheitToCelsius_element {
        public Double farenheit;
        private String[] farenheit_type_info = new String[]{'farenheit','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'farenheit'};
    }
}

I have a .php page and I can run successfully from wamp server. But now I need to display this .php page inside of Salesforce. Can anyone give me the guidance of how? The following is the .php page:

 


<?php
            $email = $_REQUEST['email'];
            $issue_area = $_REQUEST['issue_area'];
            $priority = $_REQUEST['priority'];
            $description = $_REQUEST['description'];
        if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>



<html>

<head>
<title>Prograde Helpdesk</title>

<style type="text/css">
<!--
.style1 {
    color: #000000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    text-decoration: none;    
    font-size: 12px;
}

-->
</style>

<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}

function validate_form(thisform)
{
with (thisform)
  {
  if (validate_required(email,"Email must be filled out!")==false)
  {email.focus();return false;}
  if (validate_required(issue_area,"Please select an issue category!")==false)
  {issue_area.focus();return false;}
  if (validate_required(priority,"Please select the Priority of this issue!")==false)
  {priority.focus();return false;}
  if (validate_required(description,"Please provide a description of the issue!")==false)
  {description.focus();return false;}

}

}
</script>

</head>

<body bgcolor="#ccd6dd">

<table align="center" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" style="border:1px solid rgb(0, 0, 0) ">
  <tr align="center">
    <td align="center" style="padding-top:100px; padding-bottom: 100px;"><table cellspacing="0" cellpadding="0" style="border:1px solid rgb(0, 50, 83)" bgcolor="#CCCCCC">
      <tr>
        <td>  
            <div style="width:585px; padding:25px;" align="left" class="style1">
            
            
            <form method="post" action="<?php echo $PHP_SELF;?>" onsubmit="return validate_form(this)" name="helpdesk">
            <table border="0" class="style1" style="font-weight:bold;">
                <tr>
                    <td>Email: </td>
                    <td><input type="text" size="35" maxlength="50" name="email"><span style="font-size:10px; font-weight:normal">*Required</span></td>
                </tr>
            
                <tr>
                    <td>Issue Category: </td>
                    <td>
                        <select name="issue_area">
                            <option> </option>
                            <option value="citrix">Citrix</option>
                            <option value="copier">Copier</option>
                            <option value="desktop">Desktop</option>
                            <option value="email">Email</option>
                            <option value="fax">Fax</option>
                            <option value="four51">Four51</option>
                            <option value="ftp">FTP</option>
                            <option value="internet">Internet</option>
                            <option value="laptop">Laptop</option>
                            <option value="network_access">Network Access</option>
                            <option value="phone">Phone</option>
                            <option value="printer">Printer</option>
                            <option value="sap">SAP</option>
                            <option value="scanner">Scanner</option>
                            <option value="software_request">Software Request</option>
                            <option value="vpn">VPN</option>
                            <option value="website">Website</option>
                            <option value="suggestion">Suggestion</option>
                            <option value="shipping_logistics">Shipping</option>
                            <option value="other">Other</option>
                        </select><span style="font-size:10px; font-weight:normal">*Required</span>
                    </td>
                </tr>
                <tr>
                    <td>Priority: </td>
                    <td>
                        <select name="priority">
                            <option> </option>
                            <option value="ads_support">Ads</option>
                            <option value="store_cards">Store Cards</option>
                            <option value="east">east</option>
                        </select><span style="font-size:10px; font-weight:normal">*Required</span>
                    </td>
                </tr>
                
                <tr>
                    <td valign="top">Description: </td>
                    <td>
                        <textarea rows="5" cols="30" name="description" wrap="physical"></textarea><span style="font-size:10px; font-weight:normal">*Required</span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><span style="font-size:10px; font-weight:normal;">If you have files to submit, please reply to your acknowledgement email and attach the files.</span></td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>

                <tr>
                    <td colspan="2" align="center"><input type="submit" value="submit" name="submit"></td>
                </tr>
            </table>
            </form>
            </div>

        </td>
      </tr>
    </table>
    </td>
  </tr>

    </table>
    </td>
  </tr>
  <tr>
    <td><img src="Images/Blue_Bar_Spacer.jpg" width="750" height="26"></td>
  </tr>
</table>
</body>
</html>

<?php
}
else {

            $url = "http://testhelpdesk.com/tickets.xml";



 
            $request = "<ticket><subject>$issue_area</subject><description>$description</description><set-tags>$priority</set-tags><requester_email>$email</requester_email><fields><307018>$priority</307018></fields><group-id>132872</group-id></ticket>";

            
            $headers = array('Content-type: application/xml','Content-Length: ' .strlen($request));
            
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_USERPWD, 'user:password');
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
            curl_setopt($ch, CURLOPT_HEADER, true);
            
            $http_result = curl_exec($ch);
            $error       = curl_error($ch);
            $http_code   = curl_getinfo($ch ,CURLINFO_HTTP_CODE);
            
            curl_close($ch);
            
            if ($error) {
              print "<br /><br />$error";
            } else {
              if (preg_match("/Location: .*\/tickets\/(\d*).xml/", $http_result, $matches)) {
                $ticket_id = $matches[1];
                print "Your issue has been sent to the Helpdesk. Your ticket number is <b>$ticket_id\n</b>. <br />Thank you. <a href='http://helpdesk.prograde.com/progradeops/'>Submit another ticket.</a>";
              }
            }
        }
            ?>

I need to create a button on Case. Once the button is clicked, all the files attached with the case need to be put in a zip file and this zip file will be downloaded to user's desktop. Any idea of how to achieve this will be greatly appreciated.

I'm experiencing an error "A problem with the OnClick JavaScript for this button or link was encountered:

missing ; before statement"

 

The following is the Custom Link Execute Javascript behavior. It would be greatly appreciated if anyone can point out what went wrong:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}


<a href="" onClick="script: Zenbox.show(); return false;">Open</a>
 
   <script type="text/javascript" src="http://asset0.zendesk.com/external/zenbox/zenbox-2.0.js"></script>
   <style type="text/css" media="screen, projection">
     @import url(http://asset0.zendesk.com/external/zenbox/zenbox-2.0.css);
   </style>
   <script type="text/javascript">
     if (typeof(Zenbox) !== "undefined") {
       Zenbox.init({
         dropboxID:   "6546848944",
         url:         "anaccount.zendesk.com",
         tabID:       "support",
         tabColor:    "black",
         tabPosition: "Left",
         requester_name: "Jake Holman",
         requester_email: "jake@sendesk.com",
         request_subject: "I am a custom subject",
         request_description: "I am a custom description",
         closeText: "Close Me!",
         loadingText: "Sit tight..."
       });
     }
  </script>

 

 

I have a visualforce page that everytime changes the date of each line item, after price recalculation, the scrollbar will always move to the top. If there are a lot of line items on the page, it becomes annoying after change the date of each line item. Any idea how to stop the scrollbar moving after price recalculation and just let the scrollbar stay where it is? The following is the code for the field. 

 

<apex:column headerValue="End Date">
<apex:outputPanel style="display: inline-block;">
<apex:inputField id="filteredInventoryItemEndDate" value="{!i.inputProxy.EndDate__c}">
<apex:actionSupport event="onchange" action="{!recalculatePriceAction}" rerender="filteredInventoryPageBlock" status="priceRecalculationStatus" onsubmit="disable_buttonAll();" oncomplete="enable_buttonAll();">
<apex:param assignTo="{!selectedResultItemIndex}" value="{!i.index}" name="selectedResultItemIndex"/>
</apex:actionSupport>
</apex:inputField>
</apex:outputPanel>
</apex:column>

 

Thanks in advance.

Is it possible to get trigger.old[0].value on BEFORE UPDATE? I want to compare the old value and new value in order to decide to go to run the rest of the trigger in order to reduce number of soql queries.

 

Thanks in advance,

I got an error: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML"

 

Can anyone tell me how I can generate some test code in Execute Anonymous to troubleshoot the following Callout SOAP request and response. The callout logic is very simple and it's about celsius to farenheit conversion. 

 

//Generated by wsdl2apex

public class ConverterWS {
    public class ConverterHttpSoap11Endpoint {
        public String endpoint_x = 'http://localhost:8080/Axis2WSTest/services/Converter.ConverterHttpSoap11Endpoint/';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://wtp', 'ConverterWS'};
        public Double celsiusToFarenheit(Double celsius) {
            ConverterWS.celsiusToFarenheit_element request_x = new ConverterWS.celsiusToFarenheit_element();
            ConverterWS.celsiusToFarenheitResponse_element response_x;
            request_x.celsius = celsius;
            Map<String, ConverterWS.celsiusToFarenheitResponse_element> response_map_x = new Map<String, ConverterWS.celsiusToFarenheitResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'urn:celsiusToFarenheit',
              'http://wtp',
              'celsiusToFarenheit',
              'http://wtp',
              'celsiusToFarenheitResponse',
              'ConverterWS.celsiusToFarenheitResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
        public Double farenheitToCelsius(Double farenheit) {
            ConverterWS.farenheitToCelsius_element request_x = new ConverterWS.farenheitToCelsius_element();
            ConverterWS.farenheitToCelsiusResponse_element response_x;
            request_x.farenheit = farenheit;
            Map<String, ConverterWS.farenheitToCelsiusResponse_element> response_map_x = new Map<String, ConverterWS.farenheitToCelsiusResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'urn:farenheitToCelsius',
              'http://wtp',
              'farenheitToCelsius',
              'http://wtp',
              'farenheitToCelsiusResponse',
              'ConverterWS.farenheitToCelsiusResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
    }
    public class celsiusToFarenheit_element {
        public Double celsius;
        private String[] celsius_type_info = new String[]{'celsius','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'celsius'};
    }
    public class celsiusToFarenheitResponse_element {
        public Double return_x;
        private String[] return_x_type_info = new String[]{'return','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class farenheitToCelsiusResponse_element {
        public Double return_x;
        private String[] return_x_type_info = new String[]{'return','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
    public class farenheitToCelsius_element {
        public Double farenheit;
        private String[] farenheit_type_info = new String[]{'farenheit','http://www.w3.org/2001/XMLSchema','float','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://wtp','true','true'};
        private String[] field_order_type_info = new String[]{'farenheit'};
    }
}

I have a .php page and I can run successfully from wamp server. But now I need to display this .php page inside of Salesforce. Can anyone give me the guidance of how? The following is the .php page:

 


<?php
            $email = $_REQUEST['email'];
            $issue_area = $_REQUEST['issue_area'];
            $priority = $_REQUEST['priority'];
            $description = $_REQUEST['description'];
        if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>



<html>

<head>
<title>Prograde Helpdesk</title>

<style type="text/css">
<!--
.style1 {
    color: #000000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    text-decoration: none;    
    font-size: 12px;
}

-->
</style>

<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}

function validate_form(thisform)
{
with (thisform)
  {
  if (validate_required(email,"Email must be filled out!")==false)
  {email.focus();return false;}
  if (validate_required(issue_area,"Please select an issue category!")==false)
  {issue_area.focus();return false;}
  if (validate_required(priority,"Please select the Priority of this issue!")==false)
  {priority.focus();return false;}
  if (validate_required(description,"Please provide a description of the issue!")==false)
  {description.focus();return false;}

}

}
</script>

</head>

<body bgcolor="#ccd6dd">

<table align="center" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" style="border:1px solid rgb(0, 0, 0) ">
  <tr align="center">
    <td align="center" style="padding-top:100px; padding-bottom: 100px;"><table cellspacing="0" cellpadding="0" style="border:1px solid rgb(0, 50, 83)" bgcolor="#CCCCCC">
      <tr>
        <td>  
            <div style="width:585px; padding:25px;" align="left" class="style1">
            
            
            <form method="post" action="<?php echo $PHP_SELF;?>" onsubmit="return validate_form(this)" name="helpdesk">
            <table border="0" class="style1" style="font-weight:bold;">
                <tr>
                    <td>Email: </td>
                    <td><input type="text" size="35" maxlength="50" name="email"><span style="font-size:10px; font-weight:normal">*Required</span></td>
                </tr>
            
                <tr>
                    <td>Issue Category: </td>
                    <td>
                        <select name="issue_area">
                            <option> </option>
                            <option value="citrix">Citrix</option>
                            <option value="copier">Copier</option>
                            <option value="desktop">Desktop</option>
                            <option value="email">Email</option>
                            <option value="fax">Fax</option>
                            <option value="four51">Four51</option>
                            <option value="ftp">FTP</option>
                            <option value="internet">Internet</option>
                            <option value="laptop">Laptop</option>
                            <option value="network_access">Network Access</option>
                            <option value="phone">Phone</option>
                            <option value="printer">Printer</option>
                            <option value="sap">SAP</option>
                            <option value="scanner">Scanner</option>
                            <option value="software_request">Software Request</option>
                            <option value="vpn">VPN</option>
                            <option value="website">Website</option>
                            <option value="suggestion">Suggestion</option>
                            <option value="shipping_logistics">Shipping</option>
                            <option value="other">Other</option>
                        </select><span style="font-size:10px; font-weight:normal">*Required</span>
                    </td>
                </tr>
                <tr>
                    <td>Priority: </td>
                    <td>
                        <select name="priority">
                            <option> </option>
                            <option value="ads_support">Ads</option>
                            <option value="store_cards">Store Cards</option>
                            <option value="east">east</option>
                        </select><span style="font-size:10px; font-weight:normal">*Required</span>
                    </td>
                </tr>
                
                <tr>
                    <td valign="top">Description: </td>
                    <td>
                        <textarea rows="5" cols="30" name="description" wrap="physical"></textarea><span style="font-size:10px; font-weight:normal">*Required</span>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><span style="font-size:10px; font-weight:normal;">If you have files to submit, please reply to your acknowledgement email and attach the files.</span></td>
                </tr>
                <tr>
                    <td colspan="2">&nbsp;</td>
                </tr>

                <tr>
                    <td colspan="2" align="center"><input type="submit" value="submit" name="submit"></td>
                </tr>
            </table>
            </form>
            </div>

        </td>
      </tr>
    </table>
    </td>
  </tr>

    </table>
    </td>
  </tr>
  <tr>
    <td><img src="Images/Blue_Bar_Spacer.jpg" width="750" height="26"></td>
  </tr>
</table>
</body>
</html>

<?php
}
else {

            $url = "http://testhelpdesk.com/tickets.xml";



 
            $request = "<ticket><subject>$issue_area</subject><description>$description</description><set-tags>$priority</set-tags><requester_email>$email</requester_email><fields><307018>$priority</307018></fields><group-id>132872</group-id></ticket>";

            
            $headers = array('Content-type: application/xml','Content-Length: ' .strlen($request));
            
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_USERPWD, 'user:password');
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
            curl_setopt($ch, CURLOPT_HEADER, true);
            
            $http_result = curl_exec($ch);
            $error       = curl_error($ch);
            $http_code   = curl_getinfo($ch ,CURLINFO_HTTP_CODE);
            
            curl_close($ch);
            
            if ($error) {
              print "<br /><br />$error";
            } else {
              if (preg_match("/Location: .*\/tickets\/(\d*).xml/", $http_result, $matches)) {
                $ticket_id = $matches[1];
                print "Your issue has been sent to the Helpdesk. Your ticket number is <b>$ticket_id\n</b>. <br />Thank you. <a href='http://helpdesk.prograde.com/progradeops/'>Submit another ticket.</a>";
              }
            }
        }
            ?>

I'm experiencing an error "A problem with the OnClick JavaScript for this button or link was encountered:

missing ; before statement"

 

The following is the Custom Link Execute Javascript behavior. It would be greatly appreciated if anyone can point out what went wrong:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}


<a href="" onClick="script: Zenbox.show(); return false;">Open</a>
 
   <script type="text/javascript" src="http://asset0.zendesk.com/external/zenbox/zenbox-2.0.js"></script>
   <style type="text/css" media="screen, projection">
     @import url(http://asset0.zendesk.com/external/zenbox/zenbox-2.0.css);
   </style>
   <script type="text/javascript">
     if (typeof(Zenbox) !== "undefined") {
       Zenbox.init({
         dropboxID:   "6546848944",
         url:         "anaccount.zendesk.com",
         tabID:       "support",
         tabColor:    "black",
         tabPosition: "Left",
         requester_name: "Jake Holman",
         requester_email: "jake@sendesk.com",
         request_subject: "I am a custom subject",
         request_description: "I am a custom description",
         closeText: "Close Me!",
         loadingText: "Sit tight..."
       });
     }
  </script>

 

 

Hello Salesforce gurus,

 

I am new to SFDC and I am running into a roadblock with the following WSDL which I am trying to generate APEX code.

 

The WSDL successfully got parsed but the APEX code generation failed fatally.

 

The error message while generating the APEX code is

 

Error: Unsupported WSDL. Found more than one part for message CostaAuthenticatorInput

 

Any workaround to solve this would be awesome. Your help is hightly appreciated.

 

Thanks in advance.

 

Sk_rk

 

The actual WSDL is below

 

<?xml version = '1.0' encoding = 'UTF-8'?>
<definitions name="CostaFinder" targetNamespace="http://xmlns.costamesa.com/module/" xmlns:tns="http://xmlns.costamesa.com/module/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns1="http://xmlns.costamesa.com/module/test/">
   <types>
<schema targetNamespace="http://xmlns.costamesa.com/module/test/" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.costamesa.com/module/test/" elementFormDefault="qualified">
   <element name="CostaIn">
      <complexType>
         <sequence>
            <element name="Param1" type="string" db:index="1" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
            <element name="Param2" type="string" db:index="2" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
         </sequence>
      </complexType>
   </element>
   <element name="CostaOut">
      <complexType>
         <sequence>
            <element name="CostaAuthenticator" type="string" db:index="0" db:type="VARCHAR2" minOccurs="0" nillable="true"/>
         </sequence>
      </complexType>
   </element>
         <element name="MyHeader">
            <complexType>
               <sequence>
                  <element name="Param3" minOccurs="0" type="string"/>
                  <element name="Param4" minOccurs="0" type="string"/>
               </sequence>
            </complexType>
         </element>

</schema>
   </types>
   <message name="CostaAuthenticatorInput">
      <part name="header" element="tns1:MyHeader"/>
      <part name="body" element="tns1:CostaIn"/>
   </message>
   <message name="CostaAuthenticatorOutput">
      <part name="body" element="tns1:CostaOut"/>
   </message>
   <portType name="CostaFinder_PortType">
      <operation name="CostaAuthenticator">
         <input message="tns:CostaAuthenticatorInput"/>
         <output message="tns:CostaAuthenticatorOutput"/>
      </operation>
   </portType>
   <binding name="CostaFinder_Binding" type="tns:CostaFinder_PortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="CostaAuthenticator">
         <soap:operation soapAction="http://costamesa:8076/webservices/server"/>
         <input>
            <soap:header message="tns:CostaAuthenticatorInput" part="header" use="literal"/>
            <soap:body parts="body" use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
   </binding>
   <service name="CostaFinder_Service">
      <port name="CostaFinder_Port" binding="tns:CostaFinder_Binding">
         <soap:address location="http://costamesa:8076/webservices/server"/>
      </port>
   </service>
</definitions>

  • July 30, 2010
  • Like
  • 0