• Force.com
  • NEWBIE
  • 330 Points
  • Member since 2010

  • Chatter
    Feed
  • 9
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 71
    Questions
  • 99
    Replies

Hi,

 

I am going to launch an app exchange app but in my code i am using <apex: outputText escape="False"> and this line giving XSS attack issue.  So how to resolve this issue?

 

its Urgent.

 

Thanks,

Soni

Hi All,

 

I have written a very basic remote method for js remoting. 

 

global class remotingDemo{
@RemoteAction
global static string getSession(){
string para = 'woww...';
return para;
}
}

 

Calling above method from visualforce

<script>
    function getValues(){
        remotingdemo.getSession(function(result,event){
            document.getElementById('r').value = result;
        },{escape:true});

    }
    
</script>
<input type="button" value="Contract Aproval" onclick="getValues()"/>
<INPUT NAME="requestId" TYPE="text" id='r'></INPUT>

 

But getsession() of global class is not getting called when i clicked on html button. I am kind of stucked in this basic calling structure. Any help will be highly appreciated.

 

Thanks,

Pragati

 

 

Hi, 

 

I am trying to invoke Swipe Clock, an external server through SOAP from Salesforce. I have generated apex class from wsdl file. Generated class is :

//Generated by wsdl2apex

public class mc2csComScci {
    public class AddEmployee_element {
        public String employeeCode;
        public String lastName;
        public String firstName;
        public String middleName;
        public String designation;
        public String title;
        public String ssn;
        public String dept;
        public String location;
        public String supervisor;
        public String startDate;
        public String endDate;
        public Integer lunch;
        public Double lunchHours;
        public Decimal payRate0;
        public Decimal payRate1;
        public Decimal payRate2;
        public Decimal payRate3;
        public String cardnum1;
        public String cardNum2;
        public String cardNum3;
        public String password;
        public String options;
        public String home1;
        public String home2;
        public String home3;
        public String schedule;
        public Integer exportBlock;
        private String[] employeeCode_type_info = new String[]{'employeeCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lastName_type_info = new String[]{'lastName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] firstName_type_info = new String[]{'firstName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] middleName_type_info = new String[]{'middleName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] designation_type_info = new String[]{'designation','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] title_type_info = new String[]{'title','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] ssn_type_info = new String[]{'ssn','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] dept_type_info = new String[]{'dept','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] location_type_info = new String[]{'location','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] supervisor_type_info = new String[]{'supervisor','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] startDate_type_info = new String[]{'startDate','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] endDate_type_info = new String[]{'endDate','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lunch_type_info = new String[]{'lunch','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] lunchHours_type_info = new String[]{'lunchHours','http://www.w3.org/2001/XMLSchema','float','1','1','false'};
        private String[] payRate0_type_info = new String[]{'payRate0','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] payRate1_type_info = new String[]{'payRate1','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] payRate2_type_info = new String[]{'payRate2','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] payRate3_type_info = new String[]{'payRate3','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] cardnum1_type_info = new String[]{'cardnum1','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] cardNum2_type_info = new String[]{'cardNum2','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] cardNum3_type_info = new String[]{'cardNum3','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] options_type_info = new String[]{'options','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] home1_type_info = new String[]{'home1','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] home2_type_info = new String[]{'home2','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] home3_type_info = new String[]{'home3','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] schedule_type_info = new String[]{'schedule','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] exportBlock_type_info = new String[]{'exportBlock','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://mc2cs.com/scci','true','false'};
        private String[] field_order_type_info = new String[]{'employeeCode','lastName','firstName','middleName','designation','title','ssn','dept','location','supervisor','startDate','endDate','lunch','lunchHours','payRate0','payRate1','payRate2','payRate3','cardnum1','cardNum2','cardNum3','password','options','home1','home2','home3','schedule','exportBlock'};
    }
    public class EmployeeWebInterfaceSoap {
        //public String endpoint_x = 'http://www.payrollservers.us:8002/scci/xml/EmployeeWebInterface.asmx';
        public String endpoint_x = 'http://www.payrollservers.us/scci/xml/EmployeeWebInterface.asmx';
        
        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;
        public mc2csComScci.AuthHeader AuthHeader;
        private String AuthHeader_hns = 'AuthHeader=https://mc2cs.com/scci';
        private String[] ns_map_type_info = new String[]{'https://mc2cs.com/scci', 'mc2csComScci'};
        public String AddEmployee(String employeeCode,String lastName,String firstName,String middleName,String designation,String title,String ssn,String dept,String location,String supervisor,String startDate,String endDate,Integer lunch,Double lunchHours,Decimal payRate0,Decimal payRate1,Decimal payRate2,Decimal payRate3,String cardnum1,String cardNum2,String cardNum3,String password,String options,String home1,String home2,String home3,String schedule,Integer exportBlock) {
            mc2csComScci.AddEmployee_element request_x = new mc2csComScci.AddEmployee_element();
            mc2csComScci.AddEmployeeResponse_element response_x;
            request_x.employeeCode = employeeCode;
            request_x.lastName = lastName;
            request_x.firstName = firstName;
            request_x.middleName = middleName;
            request_x.designation = designation;
            request_x.title = title;
            request_x.ssn = ssn;
            request_x.dept = dept;
            request_x.location = location;
            request_x.supervisor = supervisor;
            request_x.startDate = startDate;
            request_x.endDate = endDate;
            request_x.lunch = lunch;
            request_x.lunchHours = lunchHours;
            request_x.payRate0 = payRate0;
            request_x.payRate1 = payRate1;
            request_x.payRate2 = payRate2;
            request_x.payRate3 = payRate3;
            request_x.cardnum1 = cardnum1;
            request_x.cardNum2 = cardNum2;
            request_x.cardNum3 = cardNum3;
            request_x.password = password;
            request_x.options = options;
            request_x.home1 = home1;
            request_x.home2 = home2;
            request_x.home3 = home3;
            request_x.schedule = schedule;
            request_x.exportBlock = exportBlock;
            Map<String, mc2csComScci.AddEmployeeResponse_element> response_map_x = new Map<String, mc2csComScci.AddEmployeeResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'https://mc2cs.com/scci/AddEmployee',
              'https://mc2cs.com/scci',
              'AddEmployee',
              'https://mc2cs.com/scci',
              'AddEmployeeResponse',
              'mc2csComScci.AddEmployeeResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.AddEmployeeResult;
        }
    }
    public class AuthHeader {
        public String userName;
        public String password;
        public String site;
        private String[] userName_type_info = new String[]{'userName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://mc2cs.com/scci','true','false'};
        private String[] field_order_type_info = new String[]{'userName','password','site'};
    }
    public class AddEmployeeResponse_element {
        public String AddEmployeeResult;
        private String[] AddEmployeeResult_type_info = new String[]{'AddEmployeeResult','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://mc2cs.com/scci','true','false'};
        private String[] field_order_type_info = new String[]{'AddEmployeeResult'};
    }
}

 

Code snippet through which I am invoking the server is:

mc2csComScci m = new mc2csComScci();
mc2csComScci.AuthHeader a = new mc2csComScci.AuthHeader();
a.userName = 'testaccount';
a.password = 'password';
a.site = '1';

mc2csComScci.EmployeeWebInterfaceSoap e = new mc2csComScci.EmployeeWebInterfaceSoap();

String result = e.AddEmployee('12344','mathurtest','ptest','test','test','test','313065406','test','test','test','','',1,12,2,2,2,2,'324545','','','','','','','','',1);

system.debug('result is '+result);

 

Error received is:

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: System.Web.Services.Protocols.SoapException: Server was unable to process request. 

 

But I tried the same wsdl file with SOAP UI , it ran successfully providing desired output.

 

My instincts are that I am not setting the auth header parameters properly. But dont know for sure. If  anybody has any ideas, please help.

 

Thanks,

Pragati

 

Hi,

 

I am working on salesforce integration with SwipeClock Online Server. I am trying to call a method of SwipeClock API but receiving following error:

System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found

 

I have white listed the following IPs in Salesforce under Setup-> Security Controls -> Network Access :

204.14.232.0/23 East Coast Data Center (set one)
204.14.237.0/24 East Coast Data Center (set two)
96.43.144.0/22  MidWest Data Centers
96.43.148.0/22  MidWest Data Centers
204.14.234.0/23 West Coast Data Center (set one)
204.14.238.0/23 West Coast Data Center (set two)
182.50.76.0/22  Japan Data Center

 

But still facing the error.

 

Pls help me. I need to resolve this issue as a high priority item.

 

Thanks,

Pragati

Hi,

 

My requirement is to add a new section at the bottom of the Calendar event edit page something like attendee section. Is it possible ?

 

Thanks 

Standard salesforce library to get LAT/Lon values of an Iphone device is:

 

/*
Salesforce Mobile Client API
Copyright, 2009, salesforce.com, inc.
All Rights Reserved
*/

var mobileforce;

if (!mobileforce) {
    mobileforce = {};
}

mobileforce.Device = function() {};

mobileforce.Device.prototype.sync = function() {
    window.location.href = "mobileforce:///sync";
};

mobileforce.Device.prototype.close = function() {
    window.location.href = "mobileforce:///close";
};

mobileforce.Device.prototype.syncClose = function() {
    window.location.href = "mobileforce:///sync/close";
};

/**
 * Location API
 */

mobileforce.Device.prototype.setLocationAccuracy = function(value) {
    if (window.blackberry && window.blackberry.location.GPSSupported)
        window.blackberry.location.setAidMode(value);
};

mobileforce.Device.prototype.setLocationCallback = function(callback) {
    this.locationCallback = callback;
};

mobileforce.Device.prototype.bbLocCallback = function() {
    gotLocation(window.blackberry.location.latitude, window.blackberry.location.longitude);
};

mobileforce.Device.prototype.bbRequestLocation = function() {
    if (window.blackberry.location.GPSSupported) {
        window.blackberry.location.onLocationUpdate(mobileforce.device.bbLocCallback());
        var isUpdated = window.blackberry.location.refreshLocation();
        if (!isUpdated)
            setTimeout("mobileforce.device.bbRequestLocation()",1000);
    } 
    else {
        alert('GPS not supported');
    }
}

mobileforce.Device.prototype.getLocation = function(callback) {
    if (callback)
        this.locationCallback = callback;
    if (window.blackberry) {
        mobileforce.device.bbRequestLocation();
        //call again in 3 seconds to ensure that we get a real location
        setTimeout("mobileforce.device.bbRequestLocation()",3000);
    } else {
        Device.available = true;
        Device.exec("/getloc");
    }
};

var Device = {  
    available: false,
    init: function() {
        if(Device.onGapInit) {
            try {
                Device.onGapInit(); 
            } catch (e) {
            }
        }
    },
    exec: function(command) {
        if (Device.available) {
            try {
                window.location.href = "mobileforce://" + command;
            } catch(e) {
                alert("Error executing command '" + command + "': " + e.name + "," + e.message);
            }
        }
    }
}

mobileforce.device = new mobileforce.Device();

function gotLocation(lat, lon) {
    if (mobileforce.device.locationCallback)
        return mobileforce.device.locationCallback(lat, lon);
    
    return false;
}

Through visualforce, I am calling the above library as:

 

function getLocation() {
        mobileforce.device.getLocation(updateLocation);
        //work around required for BB
        if (window.blackberry)
            setInterval("getLocation()", 10000);
            return false;
    }

The values of Latitude and Longitude which I get are:

Lat = 4.567678000000000

Lon = 5.342564000000000

 

Is it possible to increase the decimal places something like:

Lat = 4.567678123425363

 

Thanks,

Pragati

Hi All,

 

When two organisations are integrated, what should be the best approach to store the Username and Password of that Org in Salesforce ?

 

Is it secure to store the credentials in apex class when developing an app-exchange product? 

 

Thanks,

Pragati

 

 

Hi,

 

http://na7.salesforce.com/mobileclient/api/mobileforce.js

With the help of the above javascript library, I was getting the latitudes and longitides of the mobile device (iPhone). However, the values of lat/lon which the app is pulling is something like this:

 

14.94669000000000, -88.239319000000000.

 

I need to get better accuracy into the red zeros. Is it possible to capture more than 6 decimal points ?

 

Thanks,

Pragati


 

 

Hi all,

 

I have a requirement where we have data in mysql database and apex should be coded in such a way that it  gets data from mysql and display on visualforce page. I donot have any idea on how to integrate Salesforce with mysql database. 

 

Please help.

 

Thanks,

Pragati

 

Hi All,

 

I am facing a strange problem and I failed to figure out its solution. I have a visualforce page and controller which reads some parameters from the URL . The URL is written below:

https://c.cs3.visual.force.com/apex/HorigontalGridVF?ObjectId=a1SQ00000001Qbx&object2Id=a0jQ0000001iRIH&field1=name&field2=Account2__c&field3=GBP_conversion__c&rangestart=01/01/2011&rangeend=10/12/2012&gridDate=createddate

 

However, the parameters of the URL are rearranged when the visualforce page gets loaded. Changed URL is:

https://c.cs3.visual.force.com/apex/HorigontalGridVF?field3=GBP_conversion__c&field2=Account2__c&rangestart=01/01/2011&rangeend=10/12/2012&field1=name&object2Id=a0jQ0000001iRIH&ObjectId=a1SQ00000001Qbx&gridDate=createddate

 

I know that it will not effect the controller and its processing but still I want to know the reason for this. Please help.

 

Thanks,

Pragati

Hi All,

 

I have developed a Grid on visualforce page which displays records of parent object in 1st and 2nd columns and corresponding child records in rest columns.

 

I have used html table in <apex:repeat> instead of pageblocktable because I need the column names to appear dynamically.



However, the GRid is not properly alligned. Its columns and rows are appearing in a distured format.

 

Any help will be appreciated.

Thanks,

Pragati 



 

 

Hi All,

 

To read the GET parameters from the URL, we use:
ApexPages.currentPage().getParameters().get(<name>);

How can I read POST parameters from the URL ?

 

Thanks,
Pragati

I need the ability to attach an image (in Notes and Attachment) to the Account using an iphone.

 

Are Notes and Attachments & Documents object supported in Salesforce Mobile  ? 

Please help on how can I implement such a functionality.

 

Thanks,

Pragati

Hi,

 

There is a picklist showing all the fields of Account. User will seleect one of the fields and enter any value to it. In the controller, I need to set that particulat field Account to the entered value. 

 

I am able to get the selected field and its value in String format as

String apiName = name__c;

String val = "Test";

 

But when I am trying to set the Account field as 

Account acc;

acc.apiName = val;

 

I am getting the following Compilation error:

Compile Error: Invalid field apiName for SObject Account 

 

I am not able to figure out its solution. If anyone has experienced such problem, please help.

 

Its urgent. 

 

Thanks,

Pragati

Hi,

 

I have integrated Salesforce with Java but I am new in S2S integration. I have gone through the link http://wiki.developerforce.com/page/An_Introduction_to_Salesforce_to_Salesforce but still dint get anything.

 

Lets say one Salesforce org is treated as server where all data is stored and the other Salesforce org is client. Based on this scenario, I have few questions:

1) Is there anything to do with wsdl here , like I generated jar files from Salesforce wsdl in Java-Salesforce integration ?

2) If the answer to above question is yes, then Should I need to generate apex classes in "client org" from the wsdl file of Server org ?

 

Please help me in giving some basic tips in understanding S2S Integration concepts.

 

Thanks,

Pragati

Hi All,

 

I have a requirement to integrate external server with the existing Salesforce knowledge base. Please have a look on the following queries and let me know if anyone has ideas on this:

 

1) Is it possible to customize the standard "Article Management" screen present in salesforce ?

2) Can I add some extra fields in the table where all the articles appear ?

3) Is it possible to override the standard buttons with visualforce page present on Article Management like "Submit for translation" ? 

 

Thanks

Hello,

 

My requirement is to use the same visualforce page as an inline visualforce across all objects(custom and standard).
Is it possible?

 

I am aware that we can use only one standard controller in the vf page. Is there any workaround so that same vf page can appear in the list of available vf pages while setting inline vf ?

 

Thanks,
Pragati

Hi All,

 

Is there any way we can get SFDC to offer AMF? Does Salesforce supports making AMF calls ?

 

Thanks

Hi,

 

In visualforce, I am iterating through a wrapper class and for each iteration, a textbox is displayed. My code snippet is:

 

<apex:repeat value="{!comList}" var="com">
<b>{!com.comment.name} : </b><br/>
<apex:inputTextarea id="textbox" value="{!com.reply}" /><br/>

<apex:commandButton value="Reply" action="{!replytoComment}" reRender="repeatFrm">
    <apex:param name="commentId" value="{!com.comment.id}" assignTo="{!commentId}" />
    <apex:param name="replyText" assignTo="{!replyText}" value="{!com.reply}"/>
</apex:commandButton>

</apex:repeat>

 

I want to send the user input which is entered in the inputText Box to the controller with the help of  "param" called replyText. But when I am clicking on "Reply" command button, replyText param is showing null value.

 

replyText is of getter setter type.

 

If somebody had faced such a situation, please help.

 

Thanks

Hello,

 

I have a java servlet running on EC2 server of Amazon. This servlet calls salesforce by setting up connection with EnterpriseConnection class. 

 

I ran this java servlet in java enviornment and the code was working. However when I ran the same java servlet by hosting it on EC2 server, it is throwing the following exception:

 

java.lang.NoClassDefFoundError: com/sforce/ws/ConnectionException java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) java.lang.Class.getConstructor0(Class.java:2699) java.lang.Class.newInstance0(Class.java:326) java.lang.Class.newInstance(Class.java:308) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

 

 I have imported wsc-20.jar and enterprise.jar files in the code. Still facing this issue. 

 

Is there any other way to call salesforce from java running on EC2?

 

Please help. Any help will be highly appreciated.

 

Thanks

I am fetching attachment object from java. So, I am getting the Attachement Body in base64 type. 

How can I get complete body of attachment in Java. 

 

Please suggest.

Hello,

 

I need to write an Apex web service that will be invoked from an external system. To test this out, I am trying to call this webservice from another Salesforce instance.

 

I have a global WebService class named "BillingIntegration". I have generated its WSDL file in xml format using the WSDL link on the class name. Few code lines from the WSDL file are shown below:

 

<definitions targetNamespace="http://soap.sforce.com/schemas/class/Billing_Integration">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/Billing_Integration">
<xsd:element name="DebuggingInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="debugLog" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

 

 

I have saved the xml code in a text file with .wsdl extension and then followed these steps:

* From Apex Classes, clicked on "Generate WSDL" button

* Selected the saved WSDL file.

* Clicked on "Parse WSDL" button.

Error: Failed to parse wsdl: Parse error: Found invalid XML. only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... @1:1)

 

I cant figure out, how to resolve this error and generate the apex class through WSDL file, Plz help.

 

Thanks!

 

When we enable "Enable clickjack protection for customer Visualforce pages with standard headers" & "Enable clickjack protection for customer Visualforce pages with headers disabled", the Visualforce Page which is overridden the Case (in fact, any object) Edit button/link doesn't work. It just displays blank screen.

Not just edit/new button/link, but any custom component in the Console doesn't work.

As per the Winter'17 release notes - "You can now embed custom Visualforce pages in the Service Console even when clickjack protection is enabled for Visualforce pages. Previously, if you wanted to use Visualforce pages in the Service Console, you needed to disable clickjack protection for all Visualforce pages." --- THIS STILL DOESN"T WORK.


--
Regards,
Abhilash.

 
I would like to consume salesforce web services via REST Api and I need Api description in any of those formats to generate a client.
So far I only find some none official incomplete examples
  https://github.com/paypal/wadl-library/blob/master/salesforce/salesforce-wadl.xml - incomplete
  or https://anypoint.mulesoft.com/apiplatform/popular#/portals/apis/8111/versions/8305 - does not work actually
and https://www.salesforce.com/us/developer/docs/api_rest/Content/resources_list.htm but it's not something that can be used by any of known tools.
As far as I understand salesforce does not support those formats (maybe they have plans to support them?) but maybe I am missing somethng.
Does anybody know any other sources?
 

Hi,

 

In Service Console, I have created a custom button in lead detail page. On click of that button, I need to open a Service Console subtab(passing the lead Id). Please let me know how to achieve this. I dont know much about Service Cloud.

Its very urgent, so a immediate response is very very helpful to me.  Thanks a lot.

 

--Jaya.

Hi, 

 

I am trying to invoke Swipe Clock, an external server through SOAP from Salesforce. I have generated apex class from wsdl file. Generated class is :

//Generated by wsdl2apex

public class mc2csComScci {
    public class AddEmployee_element {
        public String employeeCode;
        public String lastName;
        public String firstName;
        public String middleName;
        public String designation;
        public String title;
        public String ssn;
        public String dept;
        public String location;
        public String supervisor;
        public String startDate;
        public String endDate;
        public Integer lunch;
        public Double lunchHours;
        public Decimal payRate0;
        public Decimal payRate1;
        public Decimal payRate2;
        public Decimal payRate3;
        public String cardnum1;
        public String cardNum2;
        public String cardNum3;
        public String password;
        public String options;
        public String home1;
        public String home2;
        public String home3;
        public String schedule;
        public Integer exportBlock;
        private String[] employeeCode_type_info = new String[]{'employeeCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lastName_type_info = new String[]{'lastName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] firstName_type_info = new String[]{'firstName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] middleName_type_info = new String[]{'middleName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] designation_type_info = new String[]{'designation','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] title_type_info = new String[]{'title','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] ssn_type_info = new String[]{'ssn','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] dept_type_info = new String[]{'dept','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] location_type_info = new String[]{'location','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] supervisor_type_info = new String[]{'supervisor','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] startDate_type_info = new String[]{'startDate','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] endDate_type_info = new String[]{'endDate','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] lunch_type_info = new String[]{'lunch','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] lunchHours_type_info = new String[]{'lunchHours','http://www.w3.org/2001/XMLSchema','float','1','1','false'};
        private String[] payRate0_type_info = new String[]{'payRate0','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] payRate1_type_info = new String[]{'payRate1','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] payRate2_type_info = new String[]{'payRate2','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] payRate3_type_info = new String[]{'payRate3','http://www.w3.org/2001/XMLSchema','decimal','1','1','false'};
        private String[] cardnum1_type_info = new String[]{'cardnum1','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] cardNum2_type_info = new String[]{'cardNum2','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] cardNum3_type_info = new String[]{'cardNum3','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] options_type_info = new String[]{'options','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] home1_type_info = new String[]{'home1','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] home2_type_info = new String[]{'home2','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] home3_type_info = new String[]{'home3','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] schedule_type_info = new String[]{'schedule','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] exportBlock_type_info = new String[]{'exportBlock','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://mc2cs.com/scci','true','false'};
        private String[] field_order_type_info = new String[]{'employeeCode','lastName','firstName','middleName','designation','title','ssn','dept','location','supervisor','startDate','endDate','lunch','lunchHours','payRate0','payRate1','payRate2','payRate3','cardnum1','cardNum2','cardNum3','password','options','home1','home2','home3','schedule','exportBlock'};
    }
    public class EmployeeWebInterfaceSoap {
        //public String endpoint_x = 'http://www.payrollservers.us:8002/scci/xml/EmployeeWebInterface.asmx';
        public String endpoint_x = 'http://www.payrollservers.us/scci/xml/EmployeeWebInterface.asmx';
        
        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;
        public mc2csComScci.AuthHeader AuthHeader;
        private String AuthHeader_hns = 'AuthHeader=https://mc2cs.com/scci';
        private String[] ns_map_type_info = new String[]{'https://mc2cs.com/scci', 'mc2csComScci'};
        public String AddEmployee(String employeeCode,String lastName,String firstName,String middleName,String designation,String title,String ssn,String dept,String location,String supervisor,String startDate,String endDate,Integer lunch,Double lunchHours,Decimal payRate0,Decimal payRate1,Decimal payRate2,Decimal payRate3,String cardnum1,String cardNum2,String cardNum3,String password,String options,String home1,String home2,String home3,String schedule,Integer exportBlock) {
            mc2csComScci.AddEmployee_element request_x = new mc2csComScci.AddEmployee_element();
            mc2csComScci.AddEmployeeResponse_element response_x;
            request_x.employeeCode = employeeCode;
            request_x.lastName = lastName;
            request_x.firstName = firstName;
            request_x.middleName = middleName;
            request_x.designation = designation;
            request_x.title = title;
            request_x.ssn = ssn;
            request_x.dept = dept;
            request_x.location = location;
            request_x.supervisor = supervisor;
            request_x.startDate = startDate;
            request_x.endDate = endDate;
            request_x.lunch = lunch;
            request_x.lunchHours = lunchHours;
            request_x.payRate0 = payRate0;
            request_x.payRate1 = payRate1;
            request_x.payRate2 = payRate2;
            request_x.payRate3 = payRate3;
            request_x.cardnum1 = cardnum1;
            request_x.cardNum2 = cardNum2;
            request_x.cardNum3 = cardNum3;
            request_x.password = password;
            request_x.options = options;
            request_x.home1 = home1;
            request_x.home2 = home2;
            request_x.home3 = home3;
            request_x.schedule = schedule;
            request_x.exportBlock = exportBlock;
            Map<String, mc2csComScci.AddEmployeeResponse_element> response_map_x = new Map<String, mc2csComScci.AddEmployeeResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'https://mc2cs.com/scci/AddEmployee',
              'https://mc2cs.com/scci',
              'AddEmployee',
              'https://mc2cs.com/scci',
              'AddEmployeeResponse',
              'mc2csComScci.AddEmployeeResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.AddEmployeeResult;
        }
    }
    public class AuthHeader {
        public String userName;
        public String password;
        public String site;
        private String[] userName_type_info = new String[]{'userName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] site_type_info = new String[]{'site','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://mc2cs.com/scci','true','false'};
        private String[] field_order_type_info = new String[]{'userName','password','site'};
    }
    public class AddEmployeeResponse_element {
        public String AddEmployeeResult;
        private String[] AddEmployeeResult_type_info = new String[]{'AddEmployeeResult','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'https://mc2cs.com/scci','true','false'};
        private String[] field_order_type_info = new String[]{'AddEmployeeResult'};
    }
}

 

Code snippet through which I am invoking the server is:

mc2csComScci m = new mc2csComScci();
mc2csComScci.AuthHeader a = new mc2csComScci.AuthHeader();
a.userName = 'testaccount';
a.password = 'password';
a.site = '1';

mc2csComScci.EmployeeWebInterfaceSoap e = new mc2csComScci.EmployeeWebInterfaceSoap();

String result = e.AddEmployee('12344','mathurtest','ptest','test','test','test','313065406','test','test','test','','',1,12,2,2,2,2,'324545','','','','','','','','',1);

system.debug('result is '+result);

 

Error received is:

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: System.Web.Services.Protocols.SoapException: Server was unable to process request. 

 

But I tried the same wsdl file with SOAP UI , it ran successfully providing desired output.

 

My instincts are that I am not setting the auth header parameters properly. But dont know for sure. If  anybody has any ideas, please help.

 

Thanks,

Pragati

 

Hi,

 

I am working on salesforce integration with SwipeClock Online Server. I am trying to call a method of SwipeClock API but receiving following error:

System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found

 

I have white listed the following IPs in Salesforce under Setup-> Security Controls -> Network Access :

204.14.232.0/23 East Coast Data Center (set one)
204.14.237.0/24 East Coast Data Center (set two)
96.43.144.0/22  MidWest Data Centers
96.43.148.0/22  MidWest Data Centers
204.14.234.0/23 West Coast Data Center (set one)
204.14.238.0/23 West Coast Data Center (set two)
182.50.76.0/22  Japan Data Center

 

But still facing the error.

 

Pls help me. I need to resolve this issue as a high priority item.

 

Thanks,

Pragati

Hi,

 

I am going to launch an app exchange app but in my code i am using <apex: outputText escape="False"> and this line giving XSS attack issue.  So how to resolve this issue?

 

its Urgent.

 

Thanks,

Soni

Hi all,

 

I have a custom formula field in the Opportunity object, which takes value from a field in the Account objet. This value is then checked in a validation rule.

 

But in my unit test, this validation rule always replies FALSE because the formula field value is "null"…

 

How can I update this formula field within my test class so that the trigger I'm trying to test actually runs ?

 

See here for the complete version of my question (watch out, it's very long, and you're most likely to be scared away! ,-)

Hi,

 

 

Here i got where im trying to update multiple records.But its showing me error like System.List Exception: Duplicate id in list: a07Q0000006oUdqIAE. How to avoid this.


rigger AutoSetoff on Receipt__c (after update,after insert) {

   List<Id> oid=new List<Id>();
   List<Id> rid=new List<Id>();
   List<Receipt__c> rec= new List<Receipt__c>();
  For (Receipt__c R: trigger.new)
    {
       rid.add(R.id);
       system.debug('Add receipt id'+rid);
       
       oid.add(R.Opportunity__c);
       system.debug('Add opp id'+oid);
       }
       rec=[select id,Opportunity__c,Realization_Status__c from Receipt__c where id=:rid];
       system.debug('Receipt'+rec);
       List<Opportunity> O = [Select Name,TotalReceipt_Realized__c,Total_Payment_Received__c from Opportunity
                         Where id =: oid];
       system.debug('OPP'+ O);                  
                         
       List<AggregateResult> groupedResults = [SELECT Sum(Amount__c)aver FROM Receipt__c
                                                Where Opportunity__c =: oid
                                               ];
       system.debug('Groupedresults query'+groupedResults );
       Double TotalReceipt = 0.0 ;
       for(Receipt__c rct:rec)
       {
       if(rct.Realization_Status__c =='Realized')
       {
        if(groupedResults.size() > 0)
        {
            system.debug('Size of grouped results'+groupedResults.size());
            String str = '' + groupedResults[0].get('aver') ;
            system.debug('Checking groupedResults'+str); 
            TotalReceipt = Double.ValueOf(str) ;
            System.debug('TotalReceipt ::::: ' + TotalReceipt) ;
        }
          for(Opportunity Op:O)
          {
            Double dif = TotalReceipt - Op.Total_Payment_Received__c;
            system.debug('Difference'+dif);
            List <Payment_Schedule__c> SList = new list <Payment_Schedule__c>([Select Name,TotalInstallment_Amount__c,Display_Order__c,  Amount_Due__c, Payment_Received__c from Payment_Schedule__c 
                 where Opportunity__c =: Op.id AND Payment_Schedule__c.Amount_Due__c > 0
                 Order By Display_Order__c]);
       
       
             For (Payment_Schedule__c S: SList)
               {
                system.debug('###Inside For');
                 
                 If (S.Amount_Due__c > dif)
                   {
                        system.debug('###Inside If 1'+ S.Payment_Received__c);
                  
                        S.Payment_Received__c = S.Payment_Received__c + dif;
                        system.debug('PaymentReceived'+S.Payment_Received__c );
                        dif = 0;
                    }
            If (S.Amount_Due__c < dif)
            {
             
                S.Payment_Received__c = S.Payment_Received__c + S.Amount_Due__c;
                system.debug('PaymentReceived ########'+S.Payment_Received__c );
                dif = dif - S.Amount_Due__c;
                   system.debug('Differenceone'+dif);
            }
        }
        Update SList;
    
}
}
}
      

 }

 

  • June 15, 2012
  • Like
  • 0
 
public void m1(){
String fContent =fbody.toString();
        List<String> Rows = fContent.split('\n');
        DataLoad__c obj;
        List<DataLoad__c> lstD = new List<DataLoad__c>();
        for(Integer i=0;i<Rows.size();i++){
            List<String> ColsData = Rows[i].split(',');
            obj = new DataLoad__c(name=ColsData[0],city__c = ColsData[1],Country__c = ColsData[2]);
            lstD.add(obj);
        }
        system.debug('----> lstD'+lstD);
        insert lstD; 
}

  Can you please paste the test class for the above code

Hi,

 

http://na7.salesforce.com/mobileclient/api/mobileforce.js

With the help of the above javascript library, I was getting the latitudes and longitides of the mobile device (iPhone). However, the values of lat/lon which the app is pulling is something like this:

 

14.94669000000000, -88.239319000000000.

 

I need to get better accuracy into the red zeros. Is it possible to capture more than 6 decimal points ?

 

Thanks,

Pragati


 

 

I am fetching attachment object from java. So, I am getting the Attachement Body in base64 type. 

How can I get complete body of attachment in Java. 

 

Please suggest.

You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

 

 <apex:pageBlock title="Customer Stage" mode="inlineEdit">
<apex:pageBlockTable value="{!CustomerSatgeList}" var="customerSatge">									
	     <apex:column >
		<apex:facet name="header">Color1</apex:facet>
			<apex:detail subject="{!customerSatge.Name}" relatedList="false" inlineEdit="true"/>
		</apex:column>	
	</apex:pageBlockTable>
 </apex:pageBlock>

 

I need the security token of Sandbox and Production. But there is no option under setup configuration for regenerating it. 

My profile is System Admin but still I am facing this problem.

 

I also tried to regenerate the token by changing the password. But no mail is sent to the id associated with the user accessing the sandbox.

 

Please help.

 

Thanks

Hi,

 

  I want to create a restful web service in salesforce. Is it possible because i have check the options in setup(Trigger class), but not see any option for restful service.

 

Thanx

Hi,

 

I tried googling around, but I couldn't really find what I am looking for. What are currently the options of changing the behaviour and content of standard (new/edit) pages? See below for the scenario I would like to create.

 

I would like to create address lookup based on postcode details. For this I would like to modify existing pages for accounts.So I created a sidebar component and added some javasript to modify the components. Unfortunately, when deploying to sandbox I found out that it will not work, because different server addresses for the visual force servers

 

[code]

window.parent.document.getElementById('acc17country')

[/code]

 

Since the account has a lot of fields I don't really like to go into the way of full recreate the new/edit pages with a new visual force page.

 

So I am looking for ways to modify the content, I know there are some things possible like adding a (floatable) picklist for the countries in this app CountryCompleteFree. But I cannot really understand how they are doing this. Any help will be appreciated.

 

Has anyone managed to deploy a custom javascript button using ANT.

After looking around a bit I can't find any help on this.


An example with package.xml, and the object xml would be much appreciated, as would any pointers on where to look to figure this out.

 

For example, in package.xml, what name do we use in Package/types/name markup. CustomObject?

If CustomObject is correct, what markup should be in the customobject.object file in the objects directory?

 

Thanks

We have a webservice that sometimes gets inundated with requests from an APEX trigger we have.  So, we wrote a .NET batch program to do the requests via API through SFDC with a 45 second delay between requests.  We'd like to make that a Batch APEX, however, I can't find any way to make the APEX code pause between submittals.  I tried a loop checking on the time, but that causes 200K worth of script statements which exceeds governor limits too.

 

Does anyone have any ideas?

 

Thanx!

Hi All,

 

I have some custom setting of type List set up in my development org. I get the values of custom setting in the developement org and my business logic execute properly.

However I am not getting same custom settings values in managed Package .

 

Any pointer please ?

 

Thanks. 

  • March 13, 2010
  • Like
  • 0