- Rishav
- SMARTIE
- 1001 Points
- Member since 2014
- Salesforce Developer
- Steadfast Technology Services
-
ChatterFeed
-
29Best Answers
-
2Likes Received
-
11Likes Given
-
30Questions
-
244Replies
How to add new currency "SKK- Slovak Koruna" on manage currencies in Company profiles?
I am trying to add the below new currency on manage currencies in Company profiles(Setup->Comapny profiles->Manage Currencies->New).
Currency Code- SKK
Currency Name - Slovak Koruna
But I can not find the SKK - Slovak Koruna in Currency Type.
Anybody help on this to add the new currency SKK.
Thanks in Advance.
Thanks,
Chandra
- Chandra Sekaran
- June 05, 2015
- Like
- 0
- Continue reading or reply
How to improve sales force admin skills and bit developmet too
I am working on salesforce platform for 6 months.
I have cleared certif DEV 401 and mainly work on development part (visualforce + apex). I have also have backgroud of JAVA.
I a taking up a new opportunity in new company, so i want to increase my skills more.
I want to be know more about salesforce, majorityly admin and also imrove my development slkills a bit.
Devlopment skills cant be increased by reading. I auusme though.
can someone tell me about Study plan i should follow. I have 1.5 month, i ccan dedicate around 2 hours per day for the studying
- Simrin
- June 05, 2015
- Like
- 0
- Continue reading or reply
lightning component for standard object
I am creating a lightning app for standard object Event.
The App Code is:
<aura:application >
<h1>Event </h1>
<CallDocument:EventForm />
</aura:application>
here CallDocument is package namespace and EventForm is Event component.
The Component code is:
<aura:component >
<aura:attribute name="events" type="Event[]"/>
<aura:attribute name="newEvent" type="Event" />
<form>
<fieldset>
<ui:inputText aura:id="subject" label="Subject"
class="EventForm-control"
value="{!e.newEvent.Subject}"
required="true" />
</fieldset>
</form>
</aura:component>
But I am getting error.
My question is how to call standard object component in app.
Do we need to use namespace for standard object also?
thanks in advance.
- SFDC_Developer
- May 07, 2015
- Like
- 0
- Continue reading or reply
Display child record of Master detail relationship
@AuraEnabled public static List<Mandrake__Blog__c> getExpenses() { return [SELECT id, (select Mandrake__comment__c FROM Comments__r) ,Mandrake__Contents__c ,Mandrake__Group__c ,Mandrake__Title__c FROM Mandrake__Blog__c ORDER BY createdDate ASC ]; }
<aura:attribute name="expense" type="Mandrake.Expense__c" /> <div class="recordItem"> <aura:iteration items="{!v.expense.Comments__r}" var="Comment"> <ui:outputText value="{!Comment.Mandrake__Comment__c}"/> </aura:iteration> </div>
Hello,
I am trying to display child records.
I have no errors but no dispaly as well.
How can i debug the issue
- Simrin
- April 21, 2015
- Like
- 0
- Continue reading or reply
What are the pros and cons when using a Workflow Rule Field Update vs. a Formula Field?
- Neelam Singh
- April 06, 2015
- Like
- 0
- Continue reading or reply
Community User to create Account
I check the Community User profile and see that the create permission is disable for Account object.
So my question is that how community user can create account when they do registration?
- Long Nguyen 19
- April 06, 2015
- Like
- 0
- Continue reading or reply
Line Break and Indent for Alignment In Apex Repeat
I am using Apex Repeat to get all the children objects of a parent object and print out their fields values. Apex OutputText does not respect new line characters for a Text Area field, so I had to write a split function in the controller to cut the text by line break characters.
The issue is that it goes down a new line but does not align with the previous text in the same field. So it will be like this:
1. Goals for this year: * Complete all training
* Sell more goods
* Get customer's feedback
("Sell more goods" and "get customer's feedback" should be indented to right below "Complete all training").
This is Apex Repeat's getting data and "complete all training .... feedback" is 1 field data, so I don't know how to put indentation in this scenario. Any suggesstions or help will be appreciated.
- John Da
- April 02, 2015
- Like
- 0
- Continue reading or reply
not getting the details on 2nd visualforce page
- Sugandhi Verma
- April 02, 2015
- Like
- 0
- Continue reading or reply
Hide and show output panel
Can anyone tell me how to hide and show outpanel
My usecase is:
I have 2 output panel. In the first I have a button when I click on the button the 1st outputpanel should get hide and 2nd one get display.
and same for second output panel
For that how can i write code for visualforce page
Is ther any sample code for this usecase
Thanks in advance
Karthick
- SS Karthick
- December 01, 2014
- Like
- 0
- Continue reading or reply
Create Lookup field in VFP using Bootstrap
Can anyone tell me how to create lookup field in viusalforce page using bootstrap library?
My use case is create contact record fields(LastName,AccountName and Lead Source).
For that I have created a page and it doest give the proper style for lookup field..
My VFP as follows:
<apex:page standardController="Contact" sidebar="false" standardStylesheets="false" showHeader="false" > <head> <title>Create New Contact</title> <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/> <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> <apex:includeScript value="{!URLFOR($Resource.js, '/js/bootstrap.js')}"/> <apex:includeScript value="{!URLFOR($Resource.js, '/js/bootstrap.min.js')}"/> <apex:stylesheet value="{!URLFOR($Resource.css, '/css/bootstrap.css')}"/> <apex:stylesheet value="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/> <style type="text/css"><!-- Spacing for the Nav bar --> body { padding-top: 60px; padding-bottom: 40px; } </style> <script type="text/javascript"> var $j = jQuery.noConflict(); </script> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="brand" href="#">Bootstrap Page</a> <div class="nav-collapse collapse"> <ul class="nav"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> </ul> <span class="navbar-form span3 pull-right"> <li><a href="#">Right Link</a></li> </span> </div><!--/.nav-collapse --> </div> </div> </div> <div class="container"> <apex:pageBlock > <apex:form > <h3>LastName </h3> <apex:inputField value="{!Contact.LastName}" styleClass="form-control" html-placeholder="Enter Your Last Name" /><br/> <h3>Account name</h3> <apex:inputField value="{!Contact.accountid}" styleClass="form-control" html-placeholder="Enter Account Name" /> <br/> <h3>Lead Source </h3> <apex:inputField value="{!contact.LeadSource}" styleClass="form-control" /><br/> <apex:commandButton action="{!save}" styleClass="btn btn-success" value="Create New Contact" /> </apex:form> </apex:pageBlock> </div> <!-- /container --> </body> </apex:page>
The above page gives like
I wanna looks like
Please help me What I've to modify code
Thanks in advance
Karthick
- SS Karthick
- November 27, 2014
- Like
- 0
- Continue reading or reply
Purpose of Work.com
Can anyone tell me what is the purpose of work.com and how to use work.com?
Thanks in advance
Karthick
- SS Karthick
- November 11, 2014
- Like
- 0
- Continue reading or reply
Get the query string value in Remote Action Method
Can anyone tell me how to get the value of query string in Remote Method?
My code as follows
@RemoteAction global static Contact getContact() { String CID=ApexPages.currentPage().getParameters().get('id'); String ContactId=CID.trim(); contact c= [SELECT Id, FirstName, LastName,Phone FROM Contact WHERE Id= :ContactId]; return c; }
I get the following error message while running the above code
attempt to de reference a null object
How can I fix this error?
Thanks in advance
Karthick
- SS Karthick
- November 07, 2014
- Like
- 0
- Continue reading or reply
What is salesforce radian6 ? Any simple explanation is sufficent enought ? Also please provide the relevant link to get the documentation ?
- Soumya Behera
- August 09, 2014
- Like
- 0
- Continue reading or reply
how to create phoneGap Application step by step???
- pintoo rajput
- August 01, 2014
- Like
- 0
- Continue reading or reply
General debugging in developer console
Can anyone tell me what is debugging in developer console and how to use that???
Thanks in advance
Karthick
- SS Karthick
- August 01, 2014
- Like
- 0
- Continue reading or reply
How to bypass validations
Iam trying to update few fields of a record which are not mandatory fields...
there are some required fields in the record....
when I click on "update" button from vf...the following error arises...
System.DmlException: Update failed. First exception on row 0 with id a0O9000000FiK6pEAF; first error: REQUIRED_FIELD_MISSING, Required fields are missing
- Vempally
- July 31, 2014
- Like
- 0
- Continue reading or reply
Flow of sales cloud object
I want to know about flow(which means where its start and where its ends) of sales objects I mentioned below
Campaign,Lead,Account,Contact,Opportunity,Product,Quotes,orders,Contract,cases and solution..
Thanks in advance
Kathick
- SS Karthick
- July 29, 2014
- Like
- 0
- Continue reading or reply
JSON data becoming Null After Deserialzation
Hi All,
I have one JSON Data , i am serializing that data, but it is becoming NULL after deserialization.
I want to access the value form JSON data into the VF page.
Here is my JSON Data:
{ "mindTouchPage":{ "id":"1", "guid":"00000000000000000000000000000000", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/1?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 20:30:17 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"fixed", "text":"" }, "subpages":{ "mindTouchPage":[ { "id":"288", "guid":"a7afffb2634b453485bff59faed455f6", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/288?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 21:33:04 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"custom", "text":"The_MindTouch_Workbook/Chapter_I_-_Understand_users_&_groups/010_User_types_defined" }, "subpages":"", "title":"1. User types defined", "uriui":"https://steadfast-prod.mindtouch.us/?title=The_MindTouch_Workbook/Chapter_I_-_Understand_users_%26_groups/010_User_types_defined" }, { "id":"289", "guid":"88eae1c3ae25449eb27a518bfabf51ae", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/289?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 21:33:09 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"custom", "text":"The_MindTouch_Workbook/Chapter_I_-_Understand_users_&_groups/011_Create_groups" }, "subpages":"", "title":"2. Create groups", "uriui":"https://steadfast-prod.mindtouch.us/?title=The_MindTouch_Workbook/Chapter_I_-_Understand_users_%26_groups/011_Create_groups" }, { "id":"290", "guid":"e6da4dab743846f3bef6cd2826964937", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/290?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 21:33:20 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"custom", "text":"The_MindTouch_Workbook/Chapter_I_-_Understand_users_&_groups/012_Create_users" }, "subpages":"", "title":"3. Create users", "uriui":"https://steadfast-prod.mindtouch.us/?title=The_MindTouch_Workbook/Chapter_I_-_Understand_users_%26_groups/012_Create_users" } ] } } }
Here is My Wrapper Class
public class JSON2Apex { public list<MindTouchPage> mindTouchData; public list<path> pathData; public class Path { public String seo; public String type1; public String text; } public class MindTouchPage { public String id; public String guid; public String draftstate; public String href; public String deleted; public String datecreated; public String language; public String namespace; public Path path; public Subpages subpages; public String title; public String uriui; } public class Subpages { public List<MindTouchPage> mindTouchPage; } public static JSON2Apex parse(String json) { return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class); } }
controller class
global with sharing class ViptelaCustLandingController { global static String responseData{get;set;} global static String status{get;set;} public boolean isUserAuthenticated{get;set;} Public Integer closeCaseCount{get;set;} public Integer openCaseCount{get;set;} public JSON2Apex mindTouch{get;set;} public MindTouchDataWrapper wrapper { get; set; } // Constructor public ViptelaCustLandingController(){ // Get the count of closed Cases closeCaseCount = [SELECT COUNT() FROM CASE WHERE status = 'closed']; openCaseCount = [SELECT COUNT() FROM CASE WHERE status !='closed']; } // Code will invoke on pageLoad public pageReference redirectToCustomAuthPage(){ if(UserInfo.getUserType()=='Guest'){ return new pagereference ('/viptelaLoginController'); } else{ // status = 'User Authenticated'; // Call the webService Function // getDataFromMindTouch(); isUserAuthenticated = TRUE; getDataFromMindTouch(); return null; } } // WebService Method to Call the "MindTouch" API // @future(callout = true) public void getDataFromMindTouch(){ status = 'method Called'; System.debug('WebService Method Called'); // MindTouch User Name String userName = '**********'; String password = '***********'; String mindTouchURL = 'https://***************'; // Prepare the HTTP request and response HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); // Construct Authorization and Content Header // Blob headerValue = Blob.valueOf(userName+':'+password); Blob headerValue = Blob.valueOf(username + ':' + password); String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue); // String authorizationHeader = 'Basic'+ EncodingUtil.base64Encode(headerValue); // req.setHeader('Authorization', 'Basic UmlzaGF2OlJpc2hAMTk5MSo='); req.setHeader('Authorization', authorizationHeader); req.setHeader('Content-Type','application/json'); // Set Method,endpoint,and body req.setMethod('GET'); req.setEndpoint(mindTouchURL); try{ res = http.send(req); System.debug('Response is =======' + res.getBody()); //responseData = res.toString(); responseData =res.getBody(); status = 'TRUE'; System.debug('response data variable value is' +responseData ); //**************************Added by V****************************************** //To overcome the limitation of @ variable in response, it is converted to the SFDC acceptable form using replace keywork //and same is reference in the MindTouchWrapper Class responseData = responseData.replace('"page"', '"mindTouchPage"'); responseData = responseData.replace('"@id":', '"id":'); responseData = responseData.replace('"@guid":', '"guid":'); responseData = responseData.replace('"@draft.state":', '"draftstate":'); responseData = responseData.replace('"@href":', '"href":'); responseData = responseData.replace('"@deleted":', '"deleted":'); responseData = responseData.replace('"date.created":', '"datecreated":'); responseData = responseData.replace('"@seo":', '"seo":'); responseData = responseData.replace('"@type":', '"type1":'); responseData = responseData.replace('"#text":', '"text":'); responseData = responseData.replace('"uri.ui":', '"uriui":'); System.debug('response2 data variable value is' +responseData); //Parse is the deserialize method in the MindTouchWrapper class // MindTouchWrapper mindTouch = MindTouchWrapper.parse(responseData); mindTouch = JSON2Apex.parse(responseData); System.debug('Deserialized data is '+mindTouch); //*************************Added by V******************************************* }Catch(System.CalloutException e){ System.debug('ERROR' +e); System.debug('Response is ' + res.getBody()); } } }
VF Code to get Data
<apex:pageBlock > <apex:pageBlockSection columns="2"> <apex:repeat value="{!mindTouch}" var="data"> <apex:outputText value="{!data.id}"></apex:outputText> </apex:repeat> </apex:pageBlockSection> </apex:pageBlock>
Please hlep me to show data from JSON into VF page.
- Rishav
- June 17, 2016
- Like
- 0
- Continue reading or reply
Developer console not working
why my developer console is not working ?
First this problem was with ap2 instance but now it's started happening with AP1 instance too.
When i click on devleoper console it prompt to open in new window but after opening it minimized and after that it become irresponsive so atlast browser give the option to kill the pages.
Any help will be appreciated.
Thanks
Rishav
- Rishav
- April 09, 2015
- Like
- 0
- Continue reading or reply
aura:iteration not showing records from sObject
I was just trying to learn some aura comonent, while trying with aura:iteration to take dynamic value it's not working
<aura:component> <aura:attribute name="expenses" type="rishav.Expense__c[]"/> <div class="row"> <aura:iteration items="{!v.expenses}" var="expense"> <p>{!expense.Name}, {!expense.rishav__Client__c}, {!expense.rishav__Amount__c}, {!expense.rishav__Date__c}, {!expense.rishav__Reimbursed__c} </p> </aura:iteration> </div> </aura:component>I am not getting where i am doing mistake , but it is not showing any record even after some records are there in my database.
Can anyone tell me where i am doing mistake.
Thanks
Rishav
- Rishav
- April 01, 2015
- Like
- 0
- Continue reading or reply
test classe for controller extension
I am Writing a test class for cotroller but it is not getting pass , it is always throwing error in the controller part as"DML Exception".
This is my extension class
public CPCommAttachCls(ApexPages.StandardController stdController) { objId = ApexPages.currentPage().getParameters().get('CaseID'); objCaseRec = [select CaseNumber, Subject from case where case.id =: objId]; caseNumber = objCaseRec.CaseNumber; subject = objCaseRec.Subject; // initializing caseComment comment = new CaseComment(); comment.parentid=objid; // initializing the variable for Attachment process CaseAttachment = new Attachment(); CaseAttachment.parentId=objid; } // Controller scope finished
And this is my test class for passing the controller
@isTest(SeeAllData=true) public class CPCommAttachTestCls { public static TestMethod void Testclass() { // CaseComment comment = new CaseComment(); Case c = Cse(); ApexPages.StandardController sc = new ApexPages.StandardController(c); CpCommAttachCls ContCls = new CpCommAttachCls(sc); // This line giving error } static Case cse(){ Case c = new Case(); c.subject = 'LogMeIn Pro2'; c.Description='Test Description'; c.General_App_Area__c='A'; c.Priority='High'; c.Status='New'; insert c; return c; } }
I am using the standard controller case. But it is giving me error.
- Rishav
- October 25, 2014
- Like
- 0
- Continue reading or reply
Displaying "View stat Image" and "VoteStatImage" with every article using <knowledgeArticleList>
I want to build one visualforce page for showing the list of article in the visualforce page. I want to use <KnowledgeArticleList> component for getting the list of article and want to show the "VIEWStat" image and "VotesTat" image with every article in the list.
I want to implement this functionality with standard component.
Any suggestion please !
Thanks
Rishav Kumar
- Rishav
- October 21, 2014
- Like
- 0
- Continue reading or reply
How to get "CATEGORY" field value in visualforce page
i am trying to show all the "CATEGORY" values from the knowledge base in the visualforce pages.
But i am not getting any field so calles category so that i can fetch it using query.
If anyone having idea then please tell me.
Thanks
Rishav
- Rishav
- September 25, 2014
- Like
- 0
- Continue reading or reply
visualforce with JQTree plugins
I am trying to use jqTree with visualforce page for creating the tree list view. But i am not getting anything, i tested my jQuery it's working.
Here is my code please tell me what mistakes i doing
<apex:page standardStylesheets="false" showHeader="false"> <apex:includeScript value="{!$Resource.jqTree}"/> <apex:includeScript value="{!$Resource.jquery}"/> <apex:includeScript value="{!$Resource.jqTreeCss}"/> <apex:includeScript value="{!$Resource.jqTreeData}"/> <script> $j = jQuery.noConflict(); var data = [ { label: 'node1', children: [ { label: 'child1' }, { label: 'child2' } ] }, { label: 'node2', children: [ { label: 'child3' } ] } ]; $j(document).ready(function(){ $j("[id$=tree1]").tree({ data: data }); }); </script> <div id="tree1"> hii </div> </apex:page>I tried with static JSON resources also but not working.
Can anyone tell me what mistakes i am doing here.
Thanks
Rishav
- Rishav
- September 24, 2014
- Like
- 0
- Continue reading or reply
community URL not working in the Mobile SDK
I am trying to access the community through mobile SDK.
i have modified the server.xml file and now it look like this:
<xml version="1.0" encoding="utf-8"?>
<servers>
<server name="Sandbox" url="https://test.salesforce.com"/>
<server name="production" url="https://rishav-developer-edition-na15.force.com"></server>
</servers>
But now i am getting the error like this.
Is there anything that i need to do in configuration. Or i am doing some mistakes.
If anybody have already have done this then please help me.
Thanks
Rishav
- Rishav
- September 17, 2014
- Like
- 0
- Continue reading or reply
can a community user access the data using REST API in mobile application?
i want to make one mobile app for community user.
Is it possible to fetch the data using the REST API for community user? I don't want to use force.com site, i just want to give access of data using the REST API to the community user.
so tell me is it possible or not?
Thanks
Rishav
- Rishav
- September 11, 2014
- Like
- 0
- Continue reading or reply
Accessing the customer portal via android application
i have one requirement and it is , Customer want to use the customer portal or knowledge by using the android application.
Now in this scenario i want to use the OAUTH with the android application.
My question is that , can a customer portal user, knowledge user login into the salesforce by using "login.salesforce.com/OAUTH2 via android application ?
I think it is not possible for customer portal license user to enter into the system by using the "login.salesforce.com/OAUTH2"
now my second scenario is that if the first one is not possible then i have second question and that is
can a customer portal user can login into the system by using the community.FORCE.COM URL that is created after creation of community with the help of OAUTH ?
Thanks
Rishav
- Rishav
- September 04, 2014
- Like
- 0
- Continue reading or reply
Login method in salesforce mobile SDK
Hii,
I have just started to study the salesforce mobile SDK API . I am trying to find out what exact method we use for "LOGIN" into the salesforce but i am not gettiing it .
If anyone have implementd the salesforce SDK then please tell me what exact method we are using for login in that API or it will be more good if someone give me the login Module for using in android .
Thanks
Rishav Kumar
- Rishav
- August 26, 2014
- Like
- 0
- Continue reading or reply
Accessing the visualforce pages inside android app
Can i access the visualforce pages if i develop an android application with the help of salesforce mobile SDK?
If yes then pelase give me some link where i can learn .
If no then why, What is the reason?
Rishav
- Rishav
- August 24, 2014
- Like
- 0
- Continue reading or reply
Showing attachment related with the article in pKB
I am trying to use PKB package (worked as knowledge base), but i am facing the problem while using it.
I am unable to see the attachment related with the article in the article detail page in the mobile browser.
If anybody have used this PKB then please reply ASAP.
Thanks
Rishav Kumar
- Rishav
- August 23, 2014
- Like
- 0
- Continue reading or reply
accessing the id of the nested element using jQuery in visualforce pages
I am having problem in accessing the id of the element using jQuery, what is the accurate method to access the interna or nested elements
in the visualforce using jQuery.
<script> $(document).ready(function(){ $("#createUserLink").click(function() { alert('hello'); }); }); </script> </head> <apex:form id="popupForm"> <div id="lean_overlay"> <table> <tr> <td><apex:outputLabel value="Enter customer name:"></apex:outputLabel></td> <td> <apex:inputtext value="{!cust_name}"/> </td> </tr> <tr> <td><apex:outputLabel value="Enter customer contact number:"></apex:outputLabel></td> <td><apex:inputText value="{!cust_contact}"/> </td> </tr> <tr> <td><apex:outputLabel value="Enter customer email"></apex:outputLabel></td> <td><apex:inputText value="{!cust_email}"/></td> </tr> <tr> <td><apex:outputLabel value="Enter customer's address"></apex:outputLabel> </td> <td><apex:inputText value="{!cust_address}"/></td> </tr> <tr><td><apex:commandButton value="submit" id="submitButton"/> </td> <td><apex:commandButton value="Cancel" id="cancelButton"/></td> </tr> </table> </div> <a href="#" id="createUserLink">Create User </a> // This element not accessible </apex:form> <a href="#" id="createUserLink">Create User </a> // same element working fine </apex:page>what is the exact way to access the id of nested element.
- Rishav
- August 19, 2014
- Like
- 0
- Continue reading or reply
Replication of Knowledge functionality in visualforce pages
As i am thinking it is not possible but if there is any way to replicate the functionality without writing the code then please let me know.
- Rishav
- August 14, 2014
- Like
- 0
- Continue reading or reply
Implementation of SSO in community
I have one requirement to implement SSO in community. I have plan to build community(partner portal, customer portal) in that i want to implement
SSO. Now scenario is that i am having one website and from that website i want to transfer the user into community portal on click of a single link.
I went through the SSO implementation document but i am not clear with this so please anyone can tell me that how can implement this scenario.
Thanks
Rishav
- Rishav
- August 12, 2014
- Like
- 0
- Continue reading or reply
Data Loader Error
I am frequently getting this error while using the data loader from command prompt.
[7/11/2014 7:00:06 PM] Justin: 2014-07-03 18:09:42,189 FATAL [main] process.ProcessRunner topLevelError (ProcessRunner.java:238) - Unable to run process insertCustomerCodeUsage
java.lang.RuntimeException: com.sforce.ws.ConnectionException: Failed to send request to https://cs13.salesforce.com/services/Soap/u/30.
please if anyone know about this then help me ASAP.
Thnaks
Rishav
- Rishav
- July 12, 2014
- Like
- 0
- Continue reading or reply
Migrating the data from SQL server or Apache server to the salesforce server
can anyone tell me how to migrate the data from SQL server and Apache server to the salesforce.
I want to move my data from the web server to the salesforce on daily basis.
please suggest me all possible and best way to do this task.
Rishav
- Rishav
- July 11, 2014
- Like
- 0
- Continue reading or reply
recordsetVar not working
So if anyone know the reason then tell me please.
- Rishav
- June 20, 2014
- Like
- 2
- Continue reading or reply
Dynamic pagination
i have to use the single pagination functionality with multiple records .
IN my vf page i have some static data on that time pagination should work with that static data but in the same page there is again i have implemented the search functionality and there is a search button so after clicking on search button some records will come , so now my same pagination functionality should work with the search record also. It means pagination functoinality should switching the data source according to the situation.
i tried but not success . any suggestion or idea if you people have then give me.
- Rishav
- June 17, 2014
- Like
- 0
- Continue reading or reply
recordsetVar not working
So if anyone know the reason then tell me please.
- Rishav
- June 20, 2014
- Like
- 2
- Continue reading or reply
JSON data becoming Null After Deserialzation
Hi All,
I have one JSON Data , i am serializing that data, but it is becoming NULL after deserialization.
I want to access the value form JSON data into the VF page.
Here is my JSON Data:
{ "mindTouchPage":{ "id":"1", "guid":"00000000000000000000000000000000", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/1?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 20:30:17 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"fixed", "text":"" }, "subpages":{ "mindTouchPage":[ { "id":"288", "guid":"a7afffb2634b453485bff59faed455f6", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/288?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 21:33:04 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"custom", "text":"The_MindTouch_Workbook/Chapter_I_-_Understand_users_&_groups/010_User_types_defined" }, "subpages":"", "title":"1. User types defined", "uriui":"https://steadfast-prod.mindtouch.us/?title=The_MindTouch_Workbook/Chapter_I_-_Understand_users_%26_groups/010_User_types_defined" }, { "id":"289", "guid":"88eae1c3ae25449eb27a518bfabf51ae", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/289?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 21:33:09 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"custom", "text":"The_MindTouch_Workbook/Chapter_I_-_Understand_users_&_groups/011_Create_groups" }, "subpages":"", "title":"2. Create groups", "uriui":"https://steadfast-prod.mindtouch.us/?title=The_MindTouch_Workbook/Chapter_I_-_Understand_users_%26_groups/011_Create_groups" }, { "id":"290", "guid":"e6da4dab743846f3bef6cd2826964937", "draftstate":"inactive", "href":"https://steadfast-prod.mindtouch.us/@api/deki/pages/290?redirects=0", "deleted":"false", "datecreated":"Fri, 10 Jun 2016 21:33:20 GMT", "language":"en-US", "namespace":"main", "path":{ "seo":"true", "type1":"custom", "text":"The_MindTouch_Workbook/Chapter_I_-_Understand_users_&_groups/012_Create_users" }, "subpages":"", "title":"3. Create users", "uriui":"https://steadfast-prod.mindtouch.us/?title=The_MindTouch_Workbook/Chapter_I_-_Understand_users_%26_groups/012_Create_users" } ] } } }
Here is My Wrapper Class
public class JSON2Apex { public list<MindTouchPage> mindTouchData; public list<path> pathData; public class Path { public String seo; public String type1; public String text; } public class MindTouchPage { public String id; public String guid; public String draftstate; public String href; public String deleted; public String datecreated; public String language; public String namespace; public Path path; public Subpages subpages; public String title; public String uriui; } public class Subpages { public List<MindTouchPage> mindTouchPage; } public static JSON2Apex parse(String json) { return (JSON2Apex) System.JSON.deserialize(json, JSON2Apex.class); } }
controller class
global with sharing class ViptelaCustLandingController { global static String responseData{get;set;} global static String status{get;set;} public boolean isUserAuthenticated{get;set;} Public Integer closeCaseCount{get;set;} public Integer openCaseCount{get;set;} public JSON2Apex mindTouch{get;set;} public MindTouchDataWrapper wrapper { get; set; } // Constructor public ViptelaCustLandingController(){ // Get the count of closed Cases closeCaseCount = [SELECT COUNT() FROM CASE WHERE status = 'closed']; openCaseCount = [SELECT COUNT() FROM CASE WHERE status !='closed']; } // Code will invoke on pageLoad public pageReference redirectToCustomAuthPage(){ if(UserInfo.getUserType()=='Guest'){ return new pagereference ('/viptelaLoginController'); } else{ // status = 'User Authenticated'; // Call the webService Function // getDataFromMindTouch(); isUserAuthenticated = TRUE; getDataFromMindTouch(); return null; } } // WebService Method to Call the "MindTouch" API // @future(callout = true) public void getDataFromMindTouch(){ status = 'method Called'; System.debug('WebService Method Called'); // MindTouch User Name String userName = '**********'; String password = '***********'; String mindTouchURL = 'https://***************'; // Prepare the HTTP request and response HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); // Construct Authorization and Content Header // Blob headerValue = Blob.valueOf(userName+':'+password); Blob headerValue = Blob.valueOf(username + ':' + password); String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue); // String authorizationHeader = 'Basic'+ EncodingUtil.base64Encode(headerValue); // req.setHeader('Authorization', 'Basic UmlzaGF2OlJpc2hAMTk5MSo='); req.setHeader('Authorization', authorizationHeader); req.setHeader('Content-Type','application/json'); // Set Method,endpoint,and body req.setMethod('GET'); req.setEndpoint(mindTouchURL); try{ res = http.send(req); System.debug('Response is =======' + res.getBody()); //responseData = res.toString(); responseData =res.getBody(); status = 'TRUE'; System.debug('response data variable value is' +responseData ); //**************************Added by V****************************************** //To overcome the limitation of @ variable in response, it is converted to the SFDC acceptable form using replace keywork //and same is reference in the MindTouchWrapper Class responseData = responseData.replace('"page"', '"mindTouchPage"'); responseData = responseData.replace('"@id":', '"id":'); responseData = responseData.replace('"@guid":', '"guid":'); responseData = responseData.replace('"@draft.state":', '"draftstate":'); responseData = responseData.replace('"@href":', '"href":'); responseData = responseData.replace('"@deleted":', '"deleted":'); responseData = responseData.replace('"date.created":', '"datecreated":'); responseData = responseData.replace('"@seo":', '"seo":'); responseData = responseData.replace('"@type":', '"type1":'); responseData = responseData.replace('"#text":', '"text":'); responseData = responseData.replace('"uri.ui":', '"uriui":'); System.debug('response2 data variable value is' +responseData); //Parse is the deserialize method in the MindTouchWrapper class // MindTouchWrapper mindTouch = MindTouchWrapper.parse(responseData); mindTouch = JSON2Apex.parse(responseData); System.debug('Deserialized data is '+mindTouch); //*************************Added by V******************************************* }Catch(System.CalloutException e){ System.debug('ERROR' +e); System.debug('Response is ' + res.getBody()); } } }
VF Code to get Data
<apex:pageBlock > <apex:pageBlockSection columns="2"> <apex:repeat value="{!mindTouch}" var="data"> <apex:outputText value="{!data.id}"></apex:outputText> </apex:repeat> </apex:pageBlockSection> </apex:pageBlock>
Please hlep me to show data from JSON into VF page.
- Rishav
- June 17, 2016
- Like
- 0
- Continue reading or reply
MD5 alogorithm
Wil u help me what is MD5 alogorithm how it is implimented in salesforce why we have to go for that algorithm...
- Swathi Cse
- October 20, 2015
- Like
- 0
- Continue reading or reply
Example lightning component stops working when anything is changed?
I'm creating a Lightning component, and to farmiliarize myself with the process I followed the Salesforce Lightning component creation tutorial (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one_demo_load.htm). I followed the tutorial to the letter, and everything works fine until either of the .cmp files (one for contacts, one for contactList) change at all from the tutorial version. And I mean literally any change breaks the component. I'll open the component view on the Salesforce1 app, contacts are retrieved and listed properly, and then I make a change to contactList.cmp or contacts.cmp, be it a comment, a newline, anything, and the conacts won't load. For instance, editing a pre-existing comment in contactList.cmp like "<!-- Display the edit record page when the icon is clicked -->" and changing it to "<!-- Display the edit record page when an icon is clicked -->" breaks the entire component. No errors are thrown, but once contactList.cmp is saved the list is never displayed. I've tried relaunching the app and restarting the phone, both to no avail.
This problem has me banging my head against the wall. It's bizaree that a change in a comment could break the enitre componet. Is there some compile step I'm missing or something? Why would any change break functionality?
Thanks!
- Brennon Willams ts2-dev-tools
- June 10, 2015
- Like
- 0
- Continue reading or reply
display dependent picklist in visualforce page
I have 3 picklist fields f1,f2,f3 which are dependent pciklist. f2 is dependent on f1 and f3 is dependent on f2. I want to display these 3 fields in a vf page.
Can anyone please share me some code.
Regards
- ❤Code
- June 05, 2015
- Like
- 0
- Continue reading or reply
How to add new currency "SKK- Slovak Koruna" on manage currencies in Company profiles?
I am trying to add the below new currency on manage currencies in Company profiles(Setup->Comapny profiles->Manage Currencies->New).
Currency Code- SKK
Currency Name - Slovak Koruna
But I can not find the SKK - Slovak Koruna in Currency Type.
Anybody help on this to add the new currency SKK.
Thanks in Advance.
Thanks,
Chandra
- Chandra Sekaran
- June 05, 2015
- Like
- 0
- Continue reading or reply
Can any one help me in bypass Salesfoce SSL Validation?
But when I am trying to call web service at that time I am receiving below error
System.CalloutException: IO Exception: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Please Provide me way to by pass this error.
- Hetal Sheth
- June 05, 2015
- Like
- 0
- Continue reading or reply
How to improve sales force admin skills and bit developmet too
I am working on salesforce platform for 6 months.
I have cleared certif DEV 401 and mainly work on development part (visualforce + apex). I have also have backgroud of JAVA.
I a taking up a new opportunity in new company, so i want to increase my skills more.
I want to be know more about salesforce, majorityly admin and also imrove my development slkills a bit.
Devlopment skills cant be increased by reading. I auusme though.
can someone tell me about Study plan i should follow. I have 1.5 month, i ccan dedicate around 2 hours per day for the studying
- Simrin
- June 05, 2015
- Like
- 0
- Continue reading or reply
how to make message board feature like codeproject.com in salesforce
User can add article by selecting Category->sub-forums and then topics and other user can add post on it.
- moinuddin saifi
- June 05, 2015
- Like
- 0
- Continue reading or reply
From Address as noreply@salesforce.com in email services
I have created Email Services to create case through email.
Issue I am facing is, from most of case's FRom address is coming right and for few Cases From Address coming as "noreply@salesforce.com"and From Name as "Salesforce Email Processor".
I also did setting for "noreply@salesforce.com" in Email Administration ---> Deliverability ---->Email Security Compliance ----> Enable Sender ID compliance ( checkbox = false ).
Please help to resolve this issue
- Shikha Devi 14
- June 05, 2015
- Like
- 0
- Continue reading or reply
How can I add dynamic option in dataSource of Design Component in lightning component?
- Jyoti Gupta 8
- May 29, 2015
- Like
- 2
- Continue reading or reply
Lightning Component aura:iteration is throwing error upon rerendering
Component to display list of filtered contacts-ContactItemList.cmp
<aura:component controller="ContactItemListController" > <ltng:require styles="/resource/EquinixBootstrap/equinixbootstrap.css" scripts="/resource/Bootstrapjs/bootstrap.min.js" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <aura:handler event="c:PFAppEvent" action="{!c.doInit}"/> <aura:attribute name="contacts" type="Contact[]"/> <aura:iteration items="{!v.contacts}" var="p"> <c:ContactItem fullName="{!p.Name}" accountName="{!p.Account.Name}" /> </aura:iteration> </aura:component>Component to type in the search string-SearchComponent.cmp
<aura:component > <ltng:require styles="/resource/EquinixBootstrap/equinixbootstrap.css" scripts="/resource/Bootstrapjs/bootstrap.min.js,/resource/jQuery/jquery-1.11.3.min.js" afterScriptsLoaded="{!c.loadJQuery}"/> <aura:registerEvent name="PFAppEvent" type="c:PFAppEvent"/> <input type="text" style="width:100%;" class="form-control" placeholder="Name or Username" id="searchBox" /> </aura:component>Helper method to call Server Side controller and fetch matching contacts-ContactItemListHelper.js
({ getContacts: function(component,event) { var action = component.get("c.getContacts"); var searchString; if(typeof event != 'undefined'){ searchString=event.getParam("searchString"); }else{ searchString=''; } console.log('Contact List Item:'+searchString); action.setParams({ "searchString": searchString }); action.setCallback(this, function(a) { component.set("v.contacts", a.getReturnValue()); }); $A.enqueueAction(action); } })Listener to Search Component-SearchComponentController.js
({ loadJQuery: function(component, event, helper) { console.log('I am loaded'); var lastValue = ''; setInterval(function() { if ($("#searchBox").val() != lastValue) { lastValue = $("#searchBox").val(); console.log('New Value:'+lastValue); var appEvent = $A.get("e.c:PFAppEvent"); appEvent.setParams({ "searchString" : lastValue }); appEvent.fire(); } }, 1500); } })
- Suneel#8
- May 28, 2015
- Like
- 0
- Continue reading or reply
I am facing a different issue as when I use bootstrap css in salesforce lightning
<ul id="insideScroller" class="scrollable-menu scrollbar list-group" style="-webkit-overflow-scrolling: touch;" >
<aura:iteration var="sobj" items="{!v.SobjectRecords}">
<!-- Navigation to record detail page works only SF1-->
<li class="list-group-item" id="{!sobj.SId}" onclick="{!c.navigateToRecord}" >
<aura:renderIf isTrue="{!0 lt v.fieldsToDisplayCount}"> {!v.lstFldDisp[0]} : {!sobj.f1}<br/>
</aura:renderIf>
<aura:renderIf isTrue="{!1 lt v.fieldsToDisplayCount}"> {!v.lstFldDisp[1]} : {!sobj.f2}<br/>
</aura:renderIf>
<aura:renderIf isTrue="{!2 lt v.fieldsToDisplayCount}"> {!v.lstFldDisp[2]} : {!sobj.f3}<br/>
</aura:renderIf> </li>
</aura:iteration>
</ul>
I am using bootstrapcss in which I am able to see scrollbar in SF1 and even on the desktop.But when I load the same page in mobile the scrollbar disappears.
Any workarounds over this?
- Nayana K
- May 27, 2015
- Like
- 0
- Continue reading or reply
How to deployment of application on app exchange in sales force?.
please tell me the process of application deployment on app exchange.
- Bhushan Mahajan 5
- May 26, 2015
- Like
- 0
- Continue reading or reply
Picklist field and lookup field is not displaying in salesforce lightning.
There I have created one picklist field and one lookup field but that I don't know how to give those fields for that in component.
THIS IS MY COMPONENT CODE:-
<aura:component >
<link href='/resource/Boot1' rel="stylesheet"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="newExpense" type="LightningSF1.Expense__c"
default="{ 'sobjectType': 'LightningSF1__Expense__c',
'Name': '',
'LightningSF1__Amount__c': 0,
'LightningSF1__Client__c': '',
'LightningSF1__Date__c': '',
'LightningSF1__Reimbursed__c': false
}"/>
<div class="row " style="background-color:blue !important;">
<div style="text-align:center;font-weight:bold;color:white;">
Outlet Information
</div>
</div>
<br/>
<div class="container">
<div class="row" >
<div class="col-sm-12">
<div class="col-sm-6">
<label class="col-sm-4" >Expense Name</label>
<span class="col-sm-8">
<ui:inputText aura:id="expname"
class="form-control"
value="{!v.newExpense.Name}"
placeholder="My Expense" required="true" />
</span>
</div>
<div class="col-sm-6">
<label class="col-sm-4">Amount</label>
<span class="col-sm-8">
<ui:inputNumber aura:id="amount"
class="form-control"
value="{!v.newExpense.LightningSF1__Amount__c}"
placeholder="20.80" required="true"/>
</span>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<label class="col-sm-4">Client</label>
<span class="col-sm-8">
<ui:inputText aura:id="client"
class="form-control"
value="{!v.newExpense.LightningSF1__Client__c}"
placeholder="ABC Co."/>
</span>
</div>
<div class="col-sm-6">
<label class="col-sm-4">Expense Date</label >
<span class="col-sm-8">
<ui:inputDateTime aura:id="expdate"
class="form-control"
value="{!v.newExpense.LightningSF1__Date__c}"/>
</span>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<label class="col-sm-4">Country</label>
<span class="col-sm-8">
<ui:outputText aura:id="country"
class="form-control"
value="{!v.newExpense.LightningSF1__Country__c}"/>
</span>
</div>
<div class="col-sm-6">
<label class="col-sm-4">Types</label >
<span class="col-sm-8">
<!-- <aura:attribute name="Name" type="String" /> -->
</span>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<span class="col-sm-6">
<ui:button label="Submit" press="{!c.createExpense}"/>
</span>
<span class="col-sm-6">
<ui:button label="Cancel" press="{!c.createExpense}"/>
</span>
</div>
</aura:component>
Here country is loookup field I want to show on page but fieldset tag
<ui:____for lookup I don't know like we know that tag for inout field is <ui:inputText> same way can anyone tell me tag for Lookup and picklist field...
- Gaurav Puranik
- May 26, 2015
- Like
- 0
- Continue reading or reply
Need help in converting dynamic query into direct query?
'SELECT Id 'FROM Account ' +
'WHERE DISTANCE(GeoLocation__c, GEOLOCATION('+lat1+','+lon1+'), \'mi\') < ' + Integer.valueOf(SelectedWithin) ;
Here lat1, lon1, selectedWithin are the variables.
Can you help me in converting this dynamic query into direct query?
- Mohit Bansal6
- May 20, 2015
- Like
- 0
- Continue reading or reply
How to check the Lightning component output
I have created a lightning component with the help of some online tutorials, but i dont know how to see the output of that component. Can any one please guide me how to check the output of lightning compoent and also how to debug ligntning components.
Thanks
- sunil taruvu
- May 09, 2015
- Like
- 0
- Continue reading or reply
actionFunction cross Domain Error
It is not a question, I share my experience because I spent hours on this...
on my visualforce page, chrome kept telling me (in the Javascript console):
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'https://c.eu3.visual.force.com' is therefore not allowed access.
At the end, It appears this was due to a call to the "alert" javascript box just before the call to an "<apex:actionFunction". See below,
Javascript is:
afRemoveLineItemCatBtn( String(vLICInProgressNum) );
Since I commented the call to alert, I don't have the error message anymore...
Hope to help few to save time.
- Angulix
- January 28, 2015
- Like
- 10
- Continue reading or reply
I want to generate the pdf of the record after save.
- Aravind R
- November 25, 2014
- Like
- 1
- Continue reading or reply
Salesforce to Salesforce (S2S) Visualforce Page
I would like to build a VisualForce page to take the place of the Opportunities from Connections view for S2S so that I can add a couple custom fields to what is displayed. However, I can't figure out where the data resides to get access to it. The PartnerNetworkRecordConnection only shows that data that is shared and accepted. How do I see the opportunity record data that is shared with my organization but not yet accepted? Thanks!
Bridget
- Bridget Brown
- November 23, 2014
- Like
- 1
- Continue reading or reply
Soql for user Id
can anyone tell me soql for getting user id who has access the record??
Like
I have created test objects
5 users in my org.
if user 1 creates record on test object then user2,user3,user5 access that reocrd and user4 cannot access the reocrd
I wanna soql query for get all user id who has permission to access the record that is created by user1
Thanks in advance
Karthick
- SS Karthick
- August 28, 2014
- Like
- 2
- Continue reading or reply
How to upload photo on facebook from salesforce ?
- Ravikant Kedia 8
- August 05, 2014
- Like
- 1
- Continue reading or reply
Intergration with google adwords
I have a requirement to integrate salesforce with google adwords. so that we can create ,run and stop a campaign through salesforce. i just need a bit of help to start with code. we can integrate it with SOAP API. has anyone done it before?
Thanks in advance
Shailesh
- shailesh.gusain.sfd1.3960741070027976E12
- July 30, 2014
- Like
- 1
- Continue reading or reply
Salesforce Integration With SAP
I am new to Salesforce and learning new skills. Need some details regarding integrating SAP and Salesforce.
I have created a interface using SAP PI(with SAP ECC) .. its a SOAP to RFC synchronous interface, created a WSDL.
Tested the WSDL using SOAP UI, its working perfectly fine.
In Salesforce, I have created a Apex Class using that WSDL. Now, I need to know how to call this service.
Can anyone Help ?? ( I will provide the Apex Class generated from WSDL)
Regards,
Roopa
- Roopa Sarathkumar
- July 28, 2014
- Like
- 1
- Continue reading or reply
Tempworks & SFDC integration: notes
Has anyone done integration between Tempworks and SFDC, at least one-way, from Tempworks to SFDC? What's involved - does Tempworks have the capability of pushing out data, or will SFDC have to pull it somehow?
Thanks.
- Forza di Sogno
- July 27, 2014
- Like
- 1
- Continue reading or reply
Hw to display columns horizontally in a table
I was not able to display records in horizontally.
Ex : In a table am retrieving phone,email from contact. Now i want to show phone,Email in horizontally.
Normally we can show them in columns, but my client needs thus to be display in horizontally.
Phone 98451212312 9876789989 9888999999
Email test@test.com test1@tes.com test2@test.com
Waiting for your respnse buddies.
- kishore64
- July 08, 2014
- Like
- 1
- Continue reading or reply
How to integrate authorize.net in salesforce
How to integrate authorize.net in salesforce for the credit card and echeck transactions.
- Atif Mohammed
- January 31, 2013
- Like
- 1
- Continue reading or reply
integration of salesforce with authorize.net
Hi,
i will try to run this class, i got an error like <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CreateCustomerProfileResponse xmlns="https://api.authorize.net/soap/v1/"><CreateCustomerProfileResult><resultCode>Error</resultCode><messages><MessagesTypeMessage><code>E00007</code><text>User authentication failed due to invalid authentication values.</text></MessagesTypeMessage></messages><customerProfileId>0</customerProfileId></CreateCustomerProfileResult></CreateCustomerProfileResponse></soap:Body></soap:Envelope>
Public class callExternalWS
{
public void invokeExternalWs()
{
HttpRequest req = new HttpRequest();
//Set HTTPRequest Method
req.setMethod('POST');
req.setEndpoint('https://api.authorize.net/soap/v1/Service.asmx');
req.setMethod('POST');
req.setHeader('Content-Type', 'text/xml; charset=utf-8');
req.setHeader('SOAPAction', 'https://api.authorize.net/soap/v1/CreateCustomerProfile');
string b = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'+
'<soap:Body><CreateCustomerProfile xmlns="https://api.authorize.net/soap/v1/">'+
'<merchantAuthentication><name>8j4W5UyB</name>'+
'<transactionKey>7mR2ah8655gLSR8q</transactionKey></merchantAuthentication>'+
'<profile><description>description</description>'+
'<email>sforce2009@gmail.com</email>'+
'<paymentProfiles>'+
'<CustomerPaymentProfileType><customerType>individual</customerType>'+
'<payment><creditCard><cardNumber>6011000000000012</cardNumber>'+
'<expirationDate>2009-12</expirationDate></creditCard>'+
'</payment></CustomerPaymentProfileType></paymentProfiles></profile>'+
'</CreateCustomerProfile></soap:Body></soap:Envelope>';
req.setBody(b);
Http http = new Http();
try {
//Execute web service call here
HTTPResponse res = http.send(req);
//Helpful debug messages
System.debug(res.toString());
System.debug('STATUS:'+res.getStatus());
System.debug('STATUS_CODE:'+res.getStatusCode());
System.debug('STATUS_CODE:'+res.getBody());
//YOU CAN ALWAYS PARSE THE RESPONSE XML USING XmlStreamReader CLASS
} catch(System.CalloutException e) {
//Exception handling goes here....
}
}
}
thanks
sravani
- sravani
- July 25, 2011
- Like
- 1
- Continue reading or reply