- Karna_Shiva
- NEWBIE
- 50 Points
- Member since 2014
- Sr Software Engineer
- Cognizant Technology Solutions
-
ChatterFeed
-
0Best Answers
-
2Likes Received
-
0Likes Given
-
28Questions
-
28Replies
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.
- Karna_Shiva
- August 10, 2016
- Like
- 0
- Continue reading or reply
how to Stop sending multiple email to lead,contacts which are used in campaign?
- Karna_Shiva
- April 03, 2016
- Like
- 0
- Continue reading or reply
Which interface allows developer to supply test data for unit testing calls in a apex class or apex test class?
- Karna_Shiva
- April 03, 2016
- Like
- 0
- Continue reading or reply
How to put URL dynamically in HTML email template
Some one please suggest me what we have to do here.
- Karna_Shiva
- March 23, 2016
- Like
- 0
- Continue reading or reply
How to get fields information which doesn't have access to specific profile in SOQL
- Karna_Shiva
- March 09, 2016
- Like
- 0
- Continue reading or reply
Not able to show the records without sharing, but 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.
- Karna_Shiva
- March 08, 2016
- Like
- 0
- Continue reading or reply
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?
- Karna_Shiva
- March 08, 2016
- Like
- 0
- Continue reading or reply
Difference between seeallData=true seeAllData =false
what are adventages and disadventages of seeallData=true and seeallData=false?
- Karna_Shiva
- March 01, 2016
- Like
- 0
- Continue reading or reply
- Karna_Shiva
- February 11, 2016
- Like
- 0
- Continue reading or reply
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.
- Karna_Shiva
- October 17, 2015
- Like
- 0
- Continue reading or reply
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
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.
- Karna_Shiva
- October 17, 2015
- Like
- 0
- Continue reading or reply
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.
- Karna_Shiva
- August 11, 2015
- Like
- 0
- Continue reading or reply
Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor
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=
- Karna_Shiva
- May 18, 2015
- Like
- 2
- Continue reading or reply
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
- Karna_Shiva
- April 04, 2015
- Like
- 0
- Continue reading or reply
- Karna_Shiva
- March 16, 2015
- Like
- 0
- Continue reading or reply
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?
- Karna_Shiva
- March 13, 2015
- Like
- 0
- Continue reading or reply
Automatically, How to assign type picklist value 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.
- Karna_Shiva
- March 12, 2015
- Like
- 0
- Continue reading or reply
Salesforce1 doesn't support custom button with javascript code
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
- Karna_Shiva
- March 10, 2015
- Like
- 0
- Continue reading or reply
Visualforce page is not displaying properly on Salesforce1 app
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.
Regards,
Karna.
- Karna_Shiva
- March 05, 2015
- Like
- 0
- Continue reading or reply
How to hide User drop in a lookup on visualforce page?
- Karna_Shiva
- March 03, 2015
- Like
- 0
- Continue reading or reply
Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor
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=
- Karna_Shiva
- May 18, 2015
- Like
- 2
- Continue reading or reply
Not able to show the records without sharing, but 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.
- Karna_Shiva
- March 08, 2016
- Like
- 0
- Continue reading or reply
Difference between seeallData=true seeAllData =false
what are adventages and disadventages of seeallData=true and seeallData=false?
- Karna_Shiva
- March 01, 2016
- Like
- 0
- Continue reading or reply
Invalid Session ID found in SessionHeader: Illegal Session faultcode=sf:INVALID_SESSION_ID faultactor
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=
- Karna_Shiva
- May 18, 2015
- Like
- 2
- Continue reading or reply
How do I stop users editing an existing field value, but allow them to input data is the 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!
- Lloyd Ruz
- May 18, 2015
- Like
- 0
- Continue reading or reply
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
- Karna_Shiva
- April 04, 2015
- Like
- 0
- Continue reading or reply
Automatically, How to assign type picklist value 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.
- Karna_Shiva
- March 12, 2015
- Like
- 0
- Continue reading or reply
Looking for new opportunities within the UK?
- Eleanor White
- March 11, 2015
- Like
- 0
- Continue reading or reply
Salesforce1 doesn't support custom button with javascript code
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
- Karna_Shiva
- March 10, 2015
- Like
- 0
- Continue reading or reply
Visualforce page is not displaying properly on Salesforce1 app
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.
Regards,
Karna.
- Karna_Shiva
- March 05, 2015
- Like
- 0
- Continue reading or reply
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
- Karna_Shiva
- February 20, 2015
- Like
- 0
- Continue reading or reply
when i click button, it is redirecting another page, but that page is opened in a same page
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');
- Karna_Shiva
- February 12, 2015
- Like
- 0
- Continue reading or reply
Apex Callouts to Apex Web Service (Automated S2S), Possible ?
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.
- Chirag Mehta
- May 05, 2009
- Like
- 0
- Continue reading or reply