• ndrannapareddy
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 12
    Replies
Hi All, 

I wanted to add Pipe in a string to send it make a webservice call . but Apex changes | to |

is there a way for me keep | as it is instead of changing the character.

Example :

String pipeString = 'Salesforce|Salesforce';
system.debug returns  :
Salesforce|Salesforce

is there anyway i get aound this?



 
Hi can we update salesforce records when User Uploads Word documents of a certain template in salesforce 
Hi How do i insert Account and Contact record that is coming from Web Service.

I wanted to insert both at the same time..



I am getting a Response from Remote system with some parametrs like 

('{"Job":{"Id":832,"Status":"Completed (Warnings)"},"Data":{"?xml":{"@version":"1.0","@encoding":"utf-8"},"Loans":{"Loan":[{"Master_Servicer__c":null,"Maturity_Dt__c":"06/11/2012","Maturity_Trm__c":"360","ML_Remain_Mths__c":"0","Net_Spread__c":"1.850","NOI_UW__c":"546446",
"Note_Date__c":"12/14/2006",
"Note_Rate__c":"5.850","Orig_percent__c":null,"P_I_Monthly_Payment__c":"28907.11","Payment_First_Date__c":')

I get the above Error . 

is there any way i need to type cast the data for Date format ?

{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}

var retStr;
retStr = sforce.apex.execute("SF_Rockport", "callRockport",{ID:"!Transaction__c.Id}"});

alert('The method returned: ' + retStr);

User-added image

Hi , 
How can i Update a record from Apex using External Id . 
Ex :
Account Object 

Fields 
ExternalId__c =123;//unique
name ='AccountName';

Not able to use Update 

Account a = new Account ();
a.ExternalId =123;
a.name = 'EditedName';

Update a;

when  i use this i am getting an Error saying to update Id field is required. 

Any help will be appriciated .




list<Account> accountsFromDev = new list<Account>();
String requestUrl = '/services/apexrest/v1/showAccount/';
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(instance_Url+''+requestUrl);
req.setMethod('GET');

req.setHeader('Authorization', 'Bearer ' + accessToken);
HTTPResponse res = http.send(req);


Response: JSON format

[{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vi8dNAAR"},"Name":"Test2","Id":"001d000000Vi8dNAAR"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000001LSqwOAAT"},"Name":"Aethna Home Products","Id":"001d000001LSqwOAAT"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000001LT1W1AAL"},"Name":"WDop","Id":"001d000001LT1W1AAL"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000001LSqw8AAD"},"Name":"LeadCompany","Id":"001d000001LSqw8AAD"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7ipAAB"},"Name":"GenePoint","Id":"001d000000Vu7ipAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7iqAAB"},"Name":"United Oil & Gas, UK","Id":"001d000000Vu7iqAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7irAAB"},"Name":"United Oil & Gas, Singapore","Id":"001d000000Vu7irAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7isAAB"},"Name":"Edge Communications","Id":"001d000000Vu7isAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7itAAB"},"Name":"Burlington Textiles Corp of America","Id":"001d000000Vu7itAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7iuAAB"},"Name":"Pyramid Construction Inc.","Id":"001d000000Vu7iuAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7ivAAB"},"Name":"Dickenson plc","Id":"001d000000Vu7ivAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7iwAAB"},"Name":"Grand Hotels & Resorts Ltd","Id":"001d000000Vu7iwAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7ixAAB"},"Name":"Express Logistics and Transport","Id":"001d000000Vu7ixAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7iyAAB"},"Name":"University of Arizona","Id":"001d000000Vu7iyAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7izAAB"},"Name":"United Oil & Gas Corp.","Id":"001d000000Vu7izAAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000Vu7j0AAB"},"Name":"sForce","Id":"001d000000Vu7j0AAB"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000000VhjLYAAZ"},"Name":"Test Account","Id":"001d000000VhjLYAAZ"},{"attributes":{"type":"Account","url":"/services/data/v29.0/sobjects/Account/001d000001EoDJwAAN"},"Name":"Revct","Id":"001d000001EoDJwAAN"}]





String output = res.getBody();



when i use this code to receive data from my Sandbox to Sandbox . i only get JSON response . 

How can i get the Response in XML format?






Can anyone give me an Idea what is the information

i need to take from the thirdParty RestProvider to access the Rest Service . 

 

Like Reqirements gathering ..??

 

public with sharing class RestClass {
public void RestClass(){
HttpRequest req = new HttpRequest();
req.setEndpoint('https:/*********/services/apexrest/v1/showAccount/');
req.setMethod('GET');

// Specify the required user name and password to access the endpoint

// As well as the header and header information

 

String username = '*******';
String password = '******';

Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);

// Create a new http object to send the request object

// A response object is generated as a result of the request


Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
}
}

 

 

I am getting Unauthorised Error .. 

 

I have added this to Remote site settings but cannot go through the athentication .. 

 

Any suggestions ...

Hi I need to remove a user reference from all the Standard and custom Objects ....

i Have diffferent custom Records where there are user look ups .. 

I need to replace all these with another user 

 

 

Can some one help me how to do this on a bulk scale 

 

HI  i have a senario here to show multiple fields from Different Objects on 1 page and let the User Enter Details:

 

Scenario :

I have an Account with 4 Lookups:

Internal contact person --- user Look up

External Contact -- Contact Look up 

closer -- user Look up 

Broker - Contact look up 

 

I invoke a web service with button click . 

I need to validate if all the Look up records have Ph NO and Address and Even if any Account details missing [Account Object Fields] filled in if they are not entered 

i need to show the Fileds that need to be entered in Visual Force Page and let user Enter all these values and save from the same Page .

 

Can some one Help me with the code that validates these fields and show all these missing Fields in one VF page and Let user Enter the inputs from same page instead navigate to several pages . 

 

 

 

Thanks 

 

 

 

 

 

 

 

I am Getting the Following Error when Invoking a External Service .

 

How do i check if the External System Is being called atleast .

 

 

This is being Invoked from My Developer Console.

 

 

string ResponseString;
string EmailId= 'adb@xyz.com';
integer lnno= 201345680;
try{
tempuriOrg13.WSHttpBinding_IProdWcfService loan= new tempuriOrg13.WSHttpBinding_IProdWcfService();
System.debug('Inputs to Function'+ln +'siteUrl'+siteUrl);
ResponseString=loan.CallWcfService(lnno,EmailId);
system.debug('Output from outside system '+ResponseString);
}catch(Exception E)
{
    system.debug(E);
}

 

External service class file generated from WSDL

 

//Generated by wsdl2apex

public class tempuriOrg13 {
    public class CallWcfServiceResponse_element {
        public String CallWcfServiceResult;
        private String[] CallWcfServiceResult_type_info = new String[]{'CallWcfServiceResult','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'CallWcfServiceResult'};
    }
    public class CallWcfService_element {
        public Integer transactionNo;
        public String email;
        private String[] transactionNo_type_info = new String[]{'transactionNo','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] email_type_info = new String[]{'email','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'transactionNo','email'};
    }
    public class WSHttpBinding_IProdWcfService {
        public String endpoint_x = 'http://api.*****.com:8081/ProdWcfService.svc';
        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://schemas.microsoft.com/2003/10/Serialization/', 'temporgMicro', 'http://tempuri.org/', 'tempuriOrg13'};
        public String CallWcfService(Integer transactionNo,String email) {
            tempuriOrg13.CallWcfService_element request_x = new tempuriOrg13.CallWcfService_element();
            tempuriOrg13.CallWcfServiceResponse_element response_x;
            request_x.transactionNo = transactionNo;
            request_x.email = email;
            Map<String, tempuriOrg13.CallWcfServiceResponse_element> response_map_x = new Map<String, tempuriOrg13.CallWcfServiceResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IProdWcfService/CallWcfService',
              'http://tempuri.org/',
              'CallWcfService',
              'http://tempuri.org/',
              'CallWcfServiceResponse',
              'tempuriOrg13.CallWcfServiceResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.CallWcfServiceResult;
        }
    }
}





Error received :

 

21:41:15.278 (278886000)|VARIABLE_SCOPE_BEGIN|[16]|E|Exception|true|false
21:41:15.279 (279018000)|VARIABLE_ASSIGNMENT|[16]|E|"common.apex.runtime.impl.ExecutionException: IO Exception: External server did not return any content"|0x25f92037
21:41:15.279 (279035000)|STATEMENT_EXECUTE|[16]
21:41:15.279 (279040000)|STATEMENT_EXECUTE|[17] 21:41:15.279 (279068000)|SYSTEM_METHOD_ENTRY|[17]|System.debug(ANY) 21:41:15.279 (279102000)|USER_DEBUG|[17]|DEBUG|System.CalloutException: IO Exception: External server did not return any content 21:41:15.279 (279113000)|SYSTEM_METHOD_EXIT|[17]|System.debug(ANY)



Can i Send Reports generated on a Sceduled Report task and Email this as an Attachment to Out Of Organisation email Just as Aditional Email in Email Task.

 

Can we do this from a batch class if so how do i Query in Report from APex code

 

Thanks in Advance

 

Hi ALL,

 

I need to fix some security Issue in my org with Salesforce but have no clue how to .

 

I am in a marketing company which uses salesforce . salesreps have many contacts and they create records having some Lookups to Contact. We generate Reports and etc etc stuff goes behind .

 

We have a Major Issue we need to restrict User from taking others contacts while leaving the ORG. If Contacts Records are Not shared we donnot get the Other team get Going when reports are generated. [Usually Marketting team / some one in the Org can export and take away Org Contacts[Source Of Business] and use in in a diff Org Needs to be restricted ]

 

 

How do we fix this How can i Log the Information about people Exporting the Records on Particular Object and Send an email to the Admin that a report has be Exported to Excel by User XXX .

 

 

Can some one suggest me a work Around.

 

I need to change Users Password and let them have the same passowrd along with thier Windows Passcode ..

 

Hi ,

I need to Clone a Record and once i clone i need the new record to have all fields carried and input the record Id from which it is cloned  ??

 

 

Please help me out with this very Urgent need

I am getting a Response from Remote system with some parametrs like 

('{"Job":{"Id":832,"Status":"Completed (Warnings)"},"Data":{"?xml":{"@version":"1.0","@encoding":"utf-8"},"Loans":{"Loan":[{"Master_Servicer__c":null,"Maturity_Dt__c":"06/11/2012","Maturity_Trm__c":"360","ML_Remain_Mths__c":"0","Net_Spread__c":"1.850","NOI_UW__c":"546446",
"Note_Date__c":"12/14/2006",
"Note_Rate__c":"5.850","Orig_percent__c":null,"P_I_Monthly_Payment__c":"28907.11","Payment_First_Date__c":')

I get the above Error . 

is there any way i need to type cast the data for Date format ?

<apex:inputField styleClass="standardizer" value="{!application.ArrivalDate__c}"/>
User-added image
On my visualforce page I have an inputField asking for a date. ArricalDate__c is a Date Field. I was wondering if there was a way to disable salesforces' default date selector circled in red. Is there a way to replace the thing circled in red with a calendar widget? 

Thanks!

Thanks
Hi All,

We have a requirement where a User should have access to all Contacts. He must be able to edit all Records, even the the record owned by others but should not be able to delete any Contact in system. This should be the same for all other custom objects.

How can we set this up? Any help would be highly appreciated.

Thanks,
Raghu
 
Hi Guys - I'm using a 'For Update' in my SOQL query in awebservice method and i'm getting an error message "Error: Compile Error: SObject type does not allow locking rows at line ". Can someone let me know whats the problem here !!!

My Code :
*****
global class recordLocking { 
    webService static Boolean lockmyrecord(String idUser) {
        Boolean val = false;
        User obj = null;
        obj = [SELECT Id FROM User WHERE Id = :idUser LIMIT 1 FOR UPDATE]; 
        return (val);
    }
}
*****


 
Hi How do i insert Account and Contact record that is coming from Web Service.

I wanted to insert both at the same time..



Hi , 
How can i Update a record from Apex using External Id . 
Ex :
Account Object 

Fields 
ExternalId__c =123;//unique
name ='AccountName';

Not able to use Update 

Account a = new Account ();
a.ExternalId =123;
a.name = 'EditedName';

Update a;

when  i use this i am getting an Error saying to update Id field is required. 

Any help will be appriciated .




Can anyone give me an Idea what is the information

i need to take from the thirdParty RestProvider to access the Rest Service . 

 

Like Reqirements gathering ..??

 

public with sharing class RestClass {
public void RestClass(){
HttpRequest req = new HttpRequest();
req.setEndpoint('https:/*********/services/apexrest/v1/showAccount/');
req.setMethod('GET');

// Specify the required user name and password to access the endpoint

// As well as the header and header information

 

String username = '*******';
String password = '******';

Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);

// Create a new http object to send the request object

// A response object is generated as a result of the request


Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
}
}

 

 

I am getting Unauthorised Error .. 

 

I have added this to Remote site settings but cannot go through the athentication .. 

 

Any suggestions ...

I am Getting the Following Error when Invoking a External Service .

 

How do i check if the External System Is being called atleast .

 

 

This is being Invoked from My Developer Console.

 

 

string ResponseString;
string EmailId= 'adb@xyz.com';
integer lnno= 201345680;
try{
tempuriOrg13.WSHttpBinding_IProdWcfService loan= new tempuriOrg13.WSHttpBinding_IProdWcfService();
System.debug('Inputs to Function'+ln +'siteUrl'+siteUrl);
ResponseString=loan.CallWcfService(lnno,EmailId);
system.debug('Output from outside system '+ResponseString);
}catch(Exception E)
{
    system.debug(E);
}

 

External service class file generated from WSDL

 

//Generated by wsdl2apex

public class tempuriOrg13 {
    public class CallWcfServiceResponse_element {
        public String CallWcfServiceResult;
        private String[] CallWcfServiceResult_type_info = new String[]{'CallWcfServiceResult','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'CallWcfServiceResult'};
    }
    public class CallWcfService_element {
        public Integer transactionNo;
        public String email;
        private String[] transactionNo_type_info = new String[]{'transactionNo','http://www.w3.org/2001/XMLSchema','int','0','1','false'};
        private String[] email_type_info = new String[]{'email','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','true','false'};
        private String[] field_order_type_info = new String[]{'transactionNo','email'};
    }
    public class WSHttpBinding_IProdWcfService {
        public String endpoint_x = 'http://api.*****.com:8081/ProdWcfService.svc';
        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://schemas.microsoft.com/2003/10/Serialization/', 'temporgMicro', 'http://tempuri.org/', 'tempuriOrg13'};
        public String CallWcfService(Integer transactionNo,String email) {
            tempuriOrg13.CallWcfService_element request_x = new tempuriOrg13.CallWcfService_element();
            tempuriOrg13.CallWcfServiceResponse_element response_x;
            request_x.transactionNo = transactionNo;
            request_x.email = email;
            Map<String, tempuriOrg13.CallWcfServiceResponse_element> response_map_x = new Map<String, tempuriOrg13.CallWcfServiceResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://tempuri.org/IProdWcfService/CallWcfService',
              'http://tempuri.org/',
              'CallWcfService',
              'http://tempuri.org/',
              'CallWcfServiceResponse',
              'tempuriOrg13.CallWcfServiceResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.CallWcfServiceResult;
        }
    }
}





Error received :

 

21:41:15.278 (278886000)|VARIABLE_SCOPE_BEGIN|[16]|E|Exception|true|false
21:41:15.279 (279018000)|VARIABLE_ASSIGNMENT|[16]|E|"common.apex.runtime.impl.ExecutionException: IO Exception: External server did not return any content"|0x25f92037
21:41:15.279 (279035000)|STATEMENT_EXECUTE|[16]
21:41:15.279 (279040000)|STATEMENT_EXECUTE|[17] 21:41:15.279 (279068000)|SYSTEM_METHOD_ENTRY|[17]|System.debug(ANY) 21:41:15.279 (279102000)|USER_DEBUG|[17]|DEBUG|System.CalloutException: IO Exception: External server did not return any content 21:41:15.279 (279113000)|SYSTEM_METHOD_EXIT|[17]|System.debug(ANY)



I need to change Users Password and let them have the same passowrd along with thier Windows Passcode ..

 

Hi ,

I need to Clone a Record and once i clone i need the new record to have all fields carried and input the record Id from which it is cloned  ??

 

 

Please help me out with this very Urgent need