• Karna_Shiva
  • NEWBIE
  • 50 Points
  • Member since 2014
  • Sr Software Engineer
  • Cognizant Technology Solutions

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 28
    Replies
FMS system - wdsl file was built with java code and down streams systems are using this wsdl for integration,

Now FMS system is going down after some time and we are moving this functionality to salesforce and down stream systems are very busy and they not ready to make changes in wsdl other than endpoint URL and they want retain existing xsdl

How can we consume existing wsdl with salesforce endpoint and some changes in java code.

if anybody faced this problem please let me know.

Regards,
Karna.

 
how to Stop sending multiple email to lead,contacts which are used in campaign
Which interface allows developer to supply test data for unit testing calls in a apex class or apex test class?
How to put URL dynamically in HTML email template, i want to populate url dynamically otherwise on every instance i have to chance the URL.

Some one please suggest me what we have to do here.
How to get fields information which doesn't have access to specific profile in SOQL
Not able to show the records without sharing and able to create records with without sharing.

A - user - no access to object 
user able to create records without sharing but with without sharing he is not able view the records and other users able to see the records.
Data is showing on apex class, but data is not displaying on vf page.

B - user - have access to object
Able to do everything.

 
how to create record without object access in salesforce apex class

User don't have any access to object, but he want to create record thourh VF page, how can i do this?
When we can use and shouldn't use seeallData=true

what are adventages and disadventages of seeallData=true and seeallData=false?
Display Password based on show or etc button
How would a developer change the field type of a custom field on account object from a string to an integer?


a. Remove all references in the code, make the change in the declarative UI, and restore the references with the new type.

b. Make the change in the developer console, and then the change will automatically be reflected in the apex.

C. make the change in the declarative UI, and then the change will automatically be reflected in the apex code.

D. make the change in the declarative UI, then update the field type to an integer field in-the apex code.
A company would like to send an offer letter to a candiate sign it electronicall, and then send the letter back.

what can a developer do to accomplish this?

A. Create an assignment rule that will assign the offer letter to the candidate.
B. Create a visual workflow that will capture the candidate signature eletronically.
C. Developer a process builder that send the offer letter and allow the candidate to sign it electronically.
D. Install a managed package that will allow the candidate to sign documents electronically.
Which product is good to print quotes in word or pdf in multi lanugage?

Quote : if user is from USA, he want print quote in english language.
if user is from france , he want print quote in france language.

if any better product is there, please let me know.
 public class soapSforceComSchemasClassAccountins {
 public class SessionHeader_element {
        public String x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ;
        private String[] x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ_type_info = new String[]{'00D90000000y0lh!AQ0AQGIsi542TCnp.73StsP8nawV5.7uVrHfVM0SyclcA.h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ','http://soap.sforce.com/schemas/class/AccountInsert',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert','true','false'};
        private String[] field_order_type_info = new String[]{'x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/AccountInsert',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class AccountInsert {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/AccountInsert';
        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 soapSforceComSchemasClassAccountins.SessionHeader_element SessionHeader;
        public soapSforceComSchemasClassAccountins.DebuggingInfo_element DebuggingInfo;
        public soapSforceComSchemasClassAccountins.CallOptions_element CallOptions;
        public soapSforceComSchemasClassAccountins.DebuggingHeader_element DebuggingHeader;
        public soapSforceComSchemasClassAccountins.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/AccountInsert';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/AccountInsert';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert', 'soapSforceComSchemasClassAccountins'};
        public void opportunityUpdate(String Name,String AccountNumber,String Description) {
            soapSforceComSchemasClassAccountins.opportunityUpdate_element request_x = new soapSforceComSchemasClassAccountins.opportunityUpdate_element();
            request_x.Name = Name;
            request_x.AccountNumber = AccountNumber;
            request_x.Description = Description;
            soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element response_x;
            Map<String, soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element> response_map_x = new Map<String, soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/AccountInsert',
              'opportunityUpdate',
              'http://soap.sforce.com/schemas/class/AccountInsert',
              'opportunityUpdateResponse',
              'soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
}

}
executing through Developer Console from other Salesforce Org:::

soapSforceComSchemasClassAccountins.AccountInsert a = new soapSforceComSchemasClassAccountins.AccountInsert();
a.opportunityUpdate('Microsoft','21232','Cognizant');

Line: 111, Column: 1
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=
My user is able to see all Opportunities data what ever admin is created

how I can restrict user from viewing or editing.

1. User profile - Opportunity object - read, edit, create access
2. Admin role is CEO
3. User role BU 
4. Under CEO, the BU role is setuped
5. OWD Opportunity access is private
5. No sharing rule or permission sets to give extra access.
Role Structire:
  CEO
      BU


 
How to get Salesforce1 app URL into Apex class?

 
How to get Salesforce1 app URL into Apex class?
i want to redirect to different pages based URL

if user login from salesforce1 app the i want to redirect to page1
if user login from desktop version  the i want to redirect to page2

How this is possible?
Automatically, How to assign Type picklist value(Opportunity)  based account category in vf page

Account category is custom picklist field in account object
Category: Prospect , Existing
when user select Prospect account on opportuity page then javascript or jquery supposed to assign type value as new by default

when user select Existing account on opportuity page then javascript or jquery supposed to assign type value as Renewal by default.
I have created custom button and used javascript code to display the error messages and redirect to wizard pages but salesforce1 doesn't display that button.

Salesforce1 doesn't support javascript, how to over come this?

How to use custom button with any web lanaguage code to display error msg or redirect to different page on salesforce1
 
Hi,

I have developed visualforce page and linked to close buttom(custom) on Opportunity detail page and able to see that button, but when I click button it is showing page, but not loaded backgroup style.

Can any one help me on this.

User-added image
Regards,
Karna.
How to hide User drop in a lookup on visualforce page?
User-added image
 public class soapSforceComSchemasClassAccountins {
 public class SessionHeader_element {
        public String x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ;
        private String[] x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ_type_info = new String[]{'00D90000000y0lh!AQ0AQGIsi542TCnp.73StsP8nawV5.7uVrHfVM0SyclcA.h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ','http://soap.sforce.com/schemas/class/AccountInsert',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert','true','false'};
        private String[] field_order_type_info = new String[]{'x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/AccountInsert',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class AccountInsert {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/AccountInsert';
        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 soapSforceComSchemasClassAccountins.SessionHeader_element SessionHeader;
        public soapSforceComSchemasClassAccountins.DebuggingInfo_element DebuggingInfo;
        public soapSforceComSchemasClassAccountins.CallOptions_element CallOptions;
        public soapSforceComSchemasClassAccountins.DebuggingHeader_element DebuggingHeader;
        public soapSforceComSchemasClassAccountins.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/AccountInsert';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/AccountInsert';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert', 'soapSforceComSchemasClassAccountins'};
        public void opportunityUpdate(String Name,String AccountNumber,String Description) {
            soapSforceComSchemasClassAccountins.opportunityUpdate_element request_x = new soapSforceComSchemasClassAccountins.opportunityUpdate_element();
            request_x.Name = Name;
            request_x.AccountNumber = AccountNumber;
            request_x.Description = Description;
            soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element response_x;
            Map<String, soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element> response_map_x = new Map<String, soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/AccountInsert',
              'opportunityUpdate',
              'http://soap.sforce.com/schemas/class/AccountInsert',
              'opportunityUpdateResponse',
              'soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
}

}
executing through Developer Console from other Salesforce Org:::

soapSforceComSchemasClassAccountins.AccountInsert a = new soapSforceComSchemasClassAccountins.AccountInsert();
a.opportunityUpdate('Microsoft','21232','Cognizant');

Line: 111, Column: 1
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=
Not able to show the records without sharing and able to create records with without sharing.

A - user - no access to object 
user able to create records without sharing but with without sharing he is not able view the records and other users able to see the records.
Data is showing on apex class, but data is not displaying on vf page.

B - user - have access to object
Able to do everything.

 
When we can use and shouldn't use seeallData=true

what are adventages and disadventages of seeallData=true and seeallData=false?
 public class soapSforceComSchemasClassAccountins {
 public class SessionHeader_element {
        public String x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ;
        private String[] x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ_type_info = new String[]{'00D90000000y0lh!AQ0AQGIsi542TCnp.73StsP8nawV5.7uVrHfVM0SyclcA.h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ','http://soap.sforce.com/schemas/class/AccountInsert',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert','true','false'};
        private String[] field_order_type_info = new String[]{'x00D90000000y0lh_AQ0AQGIsi542TCnp_73StsP8nawV5_7uVrHfVM0SyclcA_h1XKIVMRIiQAFjveUkYoo0HcVFXVHV1J6vjgM92eC2mdTmQCWQ'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/schemas/class/AccountInsert',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class AccountInsert {
        public String endpoint_x = 'https://ap1.salesforce.com/services/Soap/class/AccountInsert';
        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 soapSforceComSchemasClassAccountins.SessionHeader_element SessionHeader;
        public soapSforceComSchemasClassAccountins.DebuggingInfo_element DebuggingInfo;
        public soapSforceComSchemasClassAccountins.CallOptions_element CallOptions;
        public soapSforceComSchemasClassAccountins.DebuggingHeader_element DebuggingHeader;
        public soapSforceComSchemasClassAccountins.AllowFieldTruncationHeader_element AllowFieldTruncationHeader;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/schemas/class/AccountInsert';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/schemas/class/AccountInsert';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String AllowFieldTruncationHeader_hns = 'AllowFieldTruncationHeader=http://soap.sforce.com/schemas/class/AccountInsert';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/schemas/class/AccountInsert', 'soapSforceComSchemasClassAccountins'};
        public void opportunityUpdate(String Name,String AccountNumber,String Description) {
            soapSforceComSchemasClassAccountins.opportunityUpdate_element request_x = new soapSforceComSchemasClassAccountins.opportunityUpdate_element();
            request_x.Name = Name;
            request_x.AccountNumber = AccountNumber;
            request_x.Description = Description;
            soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element response_x;
            Map<String, soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element> response_map_x = new Map<String, soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/schemas/class/AccountInsert',
              'opportunityUpdate',
              'http://soap.sforce.com/schemas/class/AccountInsert',
              'opportunityUpdateResponse',
              'soapSforceComSchemasClassAccountins.opportunityUpdateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
}

}
executing through Developer Console from other Salesforce Org:::

soapSforceComSchemasClassAccountins.AccountInsert a = new soapSforceComSchemasClassAccountins.AccountInsert();
a.opportunityUpdate('Microsoft','21232','Cognizant');

Line: 111, Column: 1
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor=
I am trying to make a validation rule which stops users editing the email address of a contact or lead UNLESS the email field is blank.

I have tried the following both formulae to no avail:
Email <> "" && ISCHANGED(Email)
IF( Email <> "", ISCHANGED(Email), ISBLANK( Email ) )

The reason for this is that the Salesforce record is checked against a nother databse which uses email address as the unique identifier, so whenever the email address is changed in Salesforce, it creates a duplicate record (with the new email address) in the other database.

Any help is much appreciated!

 
My user is able to see all Opportunities data what ever admin is created

how I can restrict user from viewing or editing.

1. User profile - Opportunity object - read, edit, create access
2. Admin role is CEO
3. User role BU 
4. Under CEO, the BU role is setuped
5. OWD Opportunity access is private
5. No sharing rule or permission sets to give extra access.
Role Structire:
  CEO
      BU


 
Automatically, How to assign Type picklist value(Opportunity)  based account category in vf page

Account category is custom picklist field in account object
Category: Prospect , Existing
when user select Prospect account on opportuity page then javascript or jquery supposed to assign type value as new by default

when user select Existing account on opportuity page then javascript or jquery supposed to assign type value as Renewal by default.
Are you looking for your next opportunity? If so then contact me on: eleanor@resourceondemand.com


 
I have created custom button and used javascript code to display the error messages and redirect to wizard pages but salesforce1 doesn't display that button.

Salesforce1 doesn't support javascript, how to over come this?

How to use custom button with any web lanaguage code to display error msg or redirect to different page on salesforce1
 
Hi,

I have developed visualforce page and linked to close buttom(custom) on Opportunity detail page and able to see that button, but when I click button it is showing page, but not loaded backgroup style.

Can any one help me on this.

User-added image
Regards,
Karna.
How to populate one inputfield value from other inputfield value based on other inputfield condition in visualforce page

Scennarion:

First Year , Deal TCV, Deal duration.

if Deal durations is lessthan 12 then vf page auto populate the Deal TCV value on First year field.

If Deal_duration <=12 then First year = Deal TCV
Generally, we have links on opportunity header to check count of line item or  etc and i am trying to create Opportunity line item from opportunity header link, but it is opening opportunity line item insert page in header page itself, i mean please see my screen shot.

actually i want to show line item insert page, when user click serivce line item button on Opportunity header links

Code, I have written in Button.

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

var opp = new sforce.SObject("Opportunity");
opp.Name = "{!Opportunity.Name}";

if('{! Opportunity.Count_Closure__c}' == 0)
 {
window.location.href='/apex/OppClosureDeclaration?CF00Ne0000000sJl7=opp.Name&CF00Ne0000000sJl7_lkid={!Opportunity.Id}&scontrolCaching=1&retURL=%2F{!Opportunity.Id}&sfdc.override=1';
}else
  alert('OPPORTUNITY CLOSURE IS ALREADY SUBMITTED');

User-added image

Note : Following is a small development being carried out to demystify salesforce apex webservice and callout features, please correct me if you find my understanding to be incorrect.

 

I am trying to integrate two Salesforce Orgs using Apex. Apex supports both callouts and webservices, then why not leverage both to achieve a 360 connectivity between two Salesforce instances.

 

Org1 : Create a Apex Web Service, Generate its WSDL

global class AccountPlan {

webservice String area;
webservice String region;

//Define an object in apex that is exposed in apex web service
global class Plan {
webservice String name;
webservice Integer planNumber;
webservice Date planningPeriod;
webservice Id planId;
}

webservice static Plan createAccountPlan(Plan vPlan) {

//A plan maps to the Account object in salesforce.com.
//So need to map the Plan class object to Account standard object
Account acct = new Account();
acct.Name = vPlan.name;
acct.AccountNumber = String.valueOf(vPlan.planNumber);
insert acct;

vPlan.planId=acct.Id;
return vPlan;
}

}

 

Org2:  Consume above generated WSDL to generate following Apex Class viz.,AccountPlanClasses

public class AccountPlanClasses {
public class LogInfo {
public String category;
public String level;
private String[] category_type_info = new String[]{'category','http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','LogCategory','1','1','false'};
private String[] level_type_info = new String[]{'level','http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','LogCategoryLevel','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/schemas/class/TCSSAAS/AccountPlan','true','false'};
private String[] field_order_type_info = new String[]{'category','level'};
}
public class AllowFieldTruncationHeader_element {
............................
............................

 

Now lets try to connect to Org1 from Org2

AccountPlanClasses.Plan plan = new AccountPlanClasses.Plan();
plan.name = 'Chirag';
plan.planNumber = 111;
AccountPlanClasses.AccountPlan a = new AccountPlanClasses.AccountPlan();
a.createAccountPlan(plan);

 

Execution of above code runs into following error

WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor= 

 

I to feel that somewhere I am missing User Credentials to be supplied, but I dont know exactly where. Please guide me to complete this 360 connectivity between two orgs using Apex.

Message Edited by Chirag Mehta on 05-05-2009 06:13 AM
Message Edited by Chirag Mehta on 05-12-2009 07:52 PM