• ImNick
  • NEWBIE
  • 75 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 18
    Replies
trying to get Authorization token by hitting https://www.linkedin.com/oauth/v2/authorization via REST API get call.

but not able to get the access token in response.
String Client_ID      = '81********51oj' ;
String Client_Secrete = '4u**********7wCD';
       
        String endPoint        = 'https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=' + Client_ID ;
        String redirectPageURL = 'https://myDevInstance-dev-ed--c.ap5.visual.force.com/apex/LinkedInAuthPage'; 
        
        redirectPageURL = EncodingUtil.urlEncode(redirectPageURL, 'UTF-8');
        endPoint += '&redirect_uri=' + redirectPageURL ;
        endPoint += '&state=fooobar&scope=r_liteprofile%20r_emailaddress%20w_member_social';
        
        Http http = new Http();
        HTTPRequest req = new HTTPRequest();
        req.setEndpoint(endPoint);
        req.setHeader('Content-Type', 'application/json');

        req.setMethod('GET');
               
        HTTPResponse res = http.send(req);

but not able to get Response code as 200 whch gives me Authorization code  in response.
  • October 07, 2019
  • Like
  • 0
How to check error in VS code as after deployment it is saying "Deploy failed [1,1]"VS code error message
I am newly using Visual studio code.
Recently I had installed visual studio code with salesforce extension pack.
but when I am trying to deploy any code from VS i am getting same error every time "Deployment failed [1,1].
Idelly it should show BillingCity6 is not a valid field on line 9 but it is showing deployment failed.
VS code error message
 
I am trying to post a messge on twitter using API but unable to update Following is the error message I am getting 
Your credentials do not allow access to this resource. 

I am trying to call POST method on 'https://api.twitter.com/1.1/direct_messages/events/new.json'
  • April 26, 2019
  • Like
  • 0
I am having two custom field on custom object with details as Source address and destination address and tries to show there co-ordinates on map as well as route with distance.

Can any one help me to use it in a visalforce page.
  • April 08, 2019
  • Like
  • 0
I am trying to display comment icon as a place holder for a text field but not able to add it as expected.
Following is the peace of code i am refering 
<apex:page showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<style>
  .inputFieldClass
   {
        height: 40px;
        width: 400px;
        /* color: green; */
        /*border-color: green;*/
        background-image: "http://icons.iconarchive.com/icons/bokehlicia/captiva/256/chat-bubbles-icon.png" ;
        background-repeat: no-repeat;
        text-indent: 20px;
   }
   

</style>
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">

    <head>
        <apex:slds />
    </head>    
    <body>
        <div class="slds-scope">
            <div class="slds-grid">
                <div class="slds-col slds-size_1-of-6">
                    <ul class="slds-list--vertical slds-has-inline-block-links--space">
                        <li class="slds-list__item"><a href="#void">Geeting started</a></li>
                        <li>
                            <ul class="slds-list--vertical slds-is-nested">
                                <li class="slds-list__item"><a href="#void">Find a place</a></li>
                                <li class="slds-list__item"><a href="#void">Experience</a></li>
                            </ul>
                        </li>
                        <li class="slds-list__item"><a href="#void">Booking your trip</a></li>
                        <li class="slds-list__item"><a href="#void">Payments</a></li>
                        <li class="slds-list__item"><a href="#void">Yours Trips</a></li>
                    </ul>
                </div>
                <div class="slds-col slds-size_5-of-6">
                    <div id="mydiv" class="slds-size_1-of-2 slds-p-top_x-large" >      
                            <h5 class="slds-text-heading_large" style="font-weight: 600;">How are we doing ?</h5>
                    </div>
                    <div class="slds-p-top_medium">
                        We are always there to improve our expeience so we would love to hear what's working and how we could make it better.
                    </div>
                    <div class="slds-p-top_medium">
                        <h1 style="display:inline ;font-weight: 700;" >This isn't the way to contact us ,through. </h1>
                        We can't reply to bug report indvijually. If you have question regarding solving problem. you will find answer in help center or you can 
                        <h1 style="color: darkseagreen;"><a href="">contact us. </a></h1>      
                    </div>
                    <div class="slds-p-top_xx-large">
                        <div style="font-weight :600 ;">
                            What would you like to do ?  
                                <div class="slds-grid slds-gutters">    
                                &#xf075;
                                    <div class="form-group" style="font-weight :500 ;">
                                        <span class="inputFieldClass11"><i class='icon-search'></i></span>
                                        <input name="firsttext" class="inputFieldClass" placeholder="&#xF002; dsafffffffffff" onchange="hideImage()"/>  
                                        <input type="text" placeholder="&#xF002; Search" style="font-family:Arial, FontAwesome" />
                                        <textarea placeholder='&#xf075; Add Comment'></textarea>
                                    </div>
                                    <div class="slds-col">
                                        <span>2</span>
                                    </div>
                                </div>    
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
    </body>

    </html>
</apex:page>
  • March 21, 2019
  • Like
  • 0

Hi 
As per my understanding in REST service  following annotation we can use
            @HttpGet     : get record read access only
            @HttpPost     : create new record
            @HttpDelete : Delete record
            @HttpPut     : upsert data
            @HttpPatch  : update data 

Can we  delete record in @HttpGet method() in REST call as HttpGet is just used to read record

  • January 17, 2019
  • Like
  • 0

I am trying to add static resource in visualforce page containing JS file.

But when I am trying to add it is  giving error 404 (Not Found).
 
  • November 26, 2018
  • Like
  • 0
  1. what is apex class with shearing and without shearing
  2. what if we called apex with shearing class from another class who is without shearing and vice versa?
  3. if apex  without shearing dont consider looged in user's field/object setting in consideration then what is use of System mode? 
  • October 12, 2018
  • Like
  • 0
how to iterate over map of Map<ID,List<String>>in apex
  • October 02, 2018
  • Like
  • 0
<table id= "maintable" width="100%" >
          <tr>
            <td width="1%">
            	<table id="linkdetails" class="linksection">
                  <tr>
                    <th><a href="" onclick="callmyjs('CreateAccount');">Create Account</a></th>
                  </tr>
                  <tr>
                    <th><a href="" onclick="callmyjs('UpdateAccount');">Update Account</a></th>
                  </tr>
                  <tr>
                    <th><a href="" onclick="callmyjs('RetriveAccount');">Retrive Existing Account Details</a></th>
                  </tr>
               </table> 
            </td>
            <td>
            	<apex:outputPanel id="createacc">
            	            Create 
            	</apex:outputPanel>
            	
            	<apex:outputPanel id="updateacc">
            	            update 
            	</apex:outputPanel>
            	
            	<apex:outputPanel id="retriveacc">
            	            retrive 
            	</apex:outputPanel>
            </td>
          </tr>
        </table>
        
        <apex:actionFunction name="showcreateacc" rendered="createacc">
        </apex:actionFunction>
        
        <apex:actionFunction name="showupdateacc" rendered="updateacc">
        </apex:actionFunction>
        
        <apex:actionFunction name="showretriveacc" rendered="retriveacc">
        </apex:actionFunction>
    

    <script>
            function callmyjs(val)
            {  
                if(val == 'CreateAccount')
                {
                        alert('Create Account');
                        showcreateacc();                       
                }        
                if(val == 'UpdateAccount')
                {
                        alert('Update  Account');
                        showupdateacc();
                }        
                if(val == 'RetriveAccount')
                {
                        alert('Retrive Account'); 
                       showretriveacc();
                }        
                
            }
    </script>
</apex:form>
Above is the piece of code I am refering where i am trying to call action function from javscript method 

but when i am calling it is showing me error as Uncaught ReferenceError: showcreateacc is not defined 

what i want to do here is on create only create output panel should show other should be disable and same for retrive and udpate as well
  • September 20, 2018
  • Like
  • 0
I am new to Salesforce and I am confused between use of following apex concepts
  • Action function
  • Action region
  • Action pollar
  • Action support
  • Action status
it will be great if you provide me differentiate between all of them in short

Thanks in advance


 
  • September 17, 2018
  • Like
  • 0
I am trying to connect Salesforce from Pentaho using Salesforce input.
but geeting following error messgage : 

Error connecting to Salesforce!
Failed to send request to https://login.salesforce.com/services/Soap/u/37.0


I am currently using Pentaho 7. I am able to acces Salesforce from same system using browser but not through Pentaho.
 
  • August 20, 2018
  • Like
  • 0
Hi guys,

I want to get all the dates of current month with its current day.
 
DateTime startDate = System.Date.today().toStartOfMonth(); 
        DateTime endDate = startDate.addMonths(1).addDays(-1);
        
        system.debug('Start Date '+ startDate);
        system.debug('End Date '+ endDate);
        
        for(DateTime d = startDate; d < = endDate ; d.addDays(1))
        {
            system.debug('Current date in loop is  '+ d.day());
            String dayofWeek = d.format('EEEE');
            system.debug('Weekeday is '+ dayofWeek);
        }

I am using above code but it is throwing CPU time limit exceded inside loop 
  • August 08, 2018
  • Like
  • 0
In my current scenario I am having two maps and I want them to print in same table.

Map<Custom Object, String 1> map1 ;
Map< String2, Custom Object, > map2 ;

In the above case String 2 is an calculated String not a custom Field
Table output will be like this

 
Column 1                             || Column 2 || Column 3
CustomObejct_ID                 || String1     ||String 2
  • August 01, 2018
  • Like
  • 0
How to sort map if we want to sort it by perticular field ;

Following is the map I am refering :

Map< BMCServiceDesk__BMC_BaseElement__c , String> mymap= new Map< BMCServiceDesk__BMC_BaseElement__c , String>();

I want to sort by its key's respective field as my map's key is an field  i want to sort by Custom Field of Obj.

For Example : If my obj is Myobj i want it ot sort by its field called as Myobj.CustomField
I am having a map<Custom Object , String> type .

I want to iterate over  it so that in a single loop i will get output like

System.debug(key,value);

Hi, 

I had executed a soql query and put the query output in  a list. Now I want to add a custom coloumn in the list.

Following is the way I am used it in code :

List<CustomObject> mylist = [select id,name,ipaddress from CustomObject];

I want to add a custom coloumn and display this all list in a table 

Can anyone suggest me how to achive this???

  • I want to apply horizontal scrollbar to my table which should have fixed header . 
  • I tried with overflow:auto. css property  but it applies to only first coloumn which is list of checkbox in my case , I want that scrollbar should apply to all rows/table so that users can sroll records .
  • I am using <apex:repeat> to print table values. 

Following is the code I am refering :
 
<apex:outputPanel id="refreshServerTable">
                <center>
                    <apex:outputPanel id="serverOutputPanel" title="Table Details using HTML table" layout="block">
                              <div id= "table-scroll">
								  <table width='95%' id="tablestylecss">
										<tr>
											<th><INPUT type="checkbox" id="mainChkBox"  onclick="checkAllCheckbox();" oncomplete="chkBoxes();" /> </th>
											<th>Header 1</th>
											<th>Header 2</th>
											<th>Header 3</th>
											<th>Header 4</th>
											<th>Header 5</th>
										</tr>
									  <tbody id="tableDatatable1"  >
											<apex:repeat id="myTable" value="{!Values}" var="s">
												<tr>
													<td><input type="checkbox" name="sName" id="serverCheckbox" onclick="checkrecord(this)" value="{!record.id}/></td>
													<td>Custom Field 1</td>
													<td>Custom Field 2</td>
													<td>Custom Field 3</td>
													<td>Custom Field 4</td>
													<td>Custom Field 5</td>
													  </tr>
											</apex:repeat>
										</tbody>
								   </table>
                              </div>
                    </apex:outputPanel>
				</center>	
</apex:outputPanel>


 
HI,

I am currently desining VF page which is having multiple checkbox,

I want get name of each checked checbox and put them in the text field 

Following is the code I am usign : 
<apex:page controller="mycontroller">
<apex:form >
A<apex:inputCheckbox label="A" id="A"  title="A"/><br/> <br/>
B<apex:inputCheckbox label="B" id="B"  title="A"/><br/> <br/>
C<apex:inputCheckbox label="C" id="C"  title="A"/><br/> <br/>
D<apex:inputCheckbox label="D" id="D"  title="A"/><br/> <br/>
E<apex:inputCheckbox label="E" id="E"  title="A"/> <br/> <br/>


<apex:pageMessages />

 Input Here  : <apex:inputText id="inptID"/>

</apex:form>

</apex:page>

 
How to check error in VS code as after deployment it is saying "Deploy failed [1,1]"VS code error message
I am newly using Visual studio code.
Recently I had installed visual studio code with salesforce extension pack.
but when I am trying to deploy any code from VS i am getting same error every time "Deployment failed [1,1].
Idelly it should show BillingCity6 is not a valid field on line 9 but it is showing deployment failed.
VS code error message
 
I am trying to display comment icon as a place holder for a text field but not able to add it as expected.
Following is the peace of code i am refering 
<apex:page showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
<style>
  .inputFieldClass
   {
        height: 40px;
        width: 400px;
        /* color: green; */
        /*border-color: green;*/
        background-image: "http://icons.iconarchive.com/icons/bokehlicia/captiva/256/chat-bubbles-icon.png" ;
        background-repeat: no-repeat;
        text-indent: 20px;
   }
   

</style>
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">

    <head>
        <apex:slds />
    </head>    
    <body>
        <div class="slds-scope">
            <div class="slds-grid">
                <div class="slds-col slds-size_1-of-6">
                    <ul class="slds-list--vertical slds-has-inline-block-links--space">
                        <li class="slds-list__item"><a href="#void">Geeting started</a></li>
                        <li>
                            <ul class="slds-list--vertical slds-is-nested">
                                <li class="slds-list__item"><a href="#void">Find a place</a></li>
                                <li class="slds-list__item"><a href="#void">Experience</a></li>
                            </ul>
                        </li>
                        <li class="slds-list__item"><a href="#void">Booking your trip</a></li>
                        <li class="slds-list__item"><a href="#void">Payments</a></li>
                        <li class="slds-list__item"><a href="#void">Yours Trips</a></li>
                    </ul>
                </div>
                <div class="slds-col slds-size_5-of-6">
                    <div id="mydiv" class="slds-size_1-of-2 slds-p-top_x-large" >      
                            <h5 class="slds-text-heading_large" style="font-weight: 600;">How are we doing ?</h5>
                    </div>
                    <div class="slds-p-top_medium">
                        We are always there to improve our expeience so we would love to hear what's working and how we could make it better.
                    </div>
                    <div class="slds-p-top_medium">
                        <h1 style="display:inline ;font-weight: 700;" >This isn't the way to contact us ,through. </h1>
                        We can't reply to bug report indvijually. If you have question regarding solving problem. you will find answer in help center or you can 
                        <h1 style="color: darkseagreen;"><a href="">contact us. </a></h1>      
                    </div>
                    <div class="slds-p-top_xx-large">
                        <div style="font-weight :600 ;">
                            What would you like to do ?  
                                <div class="slds-grid slds-gutters">    
                                &#xf075;
                                    <div class="form-group" style="font-weight :500 ;">
                                        <span class="inputFieldClass11"><i class='icon-search'></i></span>
                                        <input name="firsttext" class="inputFieldClass" placeholder="&#xF002; dsafffffffffff" onchange="hideImage()"/>  
                                        <input type="text" placeholder="&#xF002; Search" style="font-family:Arial, FontAwesome" />
                                        <textarea placeholder='&#xf075; Add Comment'></textarea>
                                    </div>
                                    <div class="slds-col">
                                        <span>2</span>
                                    </div>
                                </div>    
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
    </body>

    </html>
</apex:page>
  • March 21, 2019
  • Like
  • 0

Hi 
As per my understanding in REST service  following annotation we can use
            @HttpGet     : get record read access only
            @HttpPost     : create new record
            @HttpDelete : Delete record
            @HttpPut     : upsert data
            @HttpPatch  : update data 

Can we  delete record in @HttpGet method() in REST call as HttpGet is just used to read record

  • January 17, 2019
  • Like
  • 0
how to iterate over map of Map<ID,List<String>>in apex
  • October 02, 2018
  • Like
  • 0
<table id= "maintable" width="100%" >
          <tr>
            <td width="1%">
            	<table id="linkdetails" class="linksection">
                  <tr>
                    <th><a href="" onclick="callmyjs('CreateAccount');">Create Account</a></th>
                  </tr>
                  <tr>
                    <th><a href="" onclick="callmyjs('UpdateAccount');">Update Account</a></th>
                  </tr>
                  <tr>
                    <th><a href="" onclick="callmyjs('RetriveAccount');">Retrive Existing Account Details</a></th>
                  </tr>
               </table> 
            </td>
            <td>
            	<apex:outputPanel id="createacc">
            	            Create 
            	</apex:outputPanel>
            	
            	<apex:outputPanel id="updateacc">
            	            update 
            	</apex:outputPanel>
            	
            	<apex:outputPanel id="retriveacc">
            	            retrive 
            	</apex:outputPanel>
            </td>
          </tr>
        </table>
        
        <apex:actionFunction name="showcreateacc" rendered="createacc">
        </apex:actionFunction>
        
        <apex:actionFunction name="showupdateacc" rendered="updateacc">
        </apex:actionFunction>
        
        <apex:actionFunction name="showretriveacc" rendered="retriveacc">
        </apex:actionFunction>
    

    <script>
            function callmyjs(val)
            {  
                if(val == 'CreateAccount')
                {
                        alert('Create Account');
                        showcreateacc();                       
                }        
                if(val == 'UpdateAccount')
                {
                        alert('Update  Account');
                        showupdateacc();
                }        
                if(val == 'RetriveAccount')
                {
                        alert('Retrive Account'); 
                       showretriveacc();
                }        
                
            }
    </script>
</apex:form>
Above is the piece of code I am refering where i am trying to call action function from javscript method 

but when i am calling it is showing me error as Uncaught ReferenceError: showcreateacc is not defined 

what i want to do here is on create only create output panel should show other should be disable and same for retrive and udpate as well
  • September 20, 2018
  • Like
  • 0
Hi guys,

I want to get all the dates of current month with its current day.
 
DateTime startDate = System.Date.today().toStartOfMonth(); 
        DateTime endDate = startDate.addMonths(1).addDays(-1);
        
        system.debug('Start Date '+ startDate);
        system.debug('End Date '+ endDate);
        
        for(DateTime d = startDate; d < = endDate ; d.addDays(1))
        {
            system.debug('Current date in loop is  '+ d.day());
            String dayofWeek = d.format('EEEE');
            system.debug('Weekeday is '+ dayofWeek);
        }

I am using above code but it is throwing CPU time limit exceded inside loop 
  • August 08, 2018
  • Like
  • 0
I am having a map<Custom Object , String> type .

I want to iterate over  it so that in a single loop i will get output like

System.debug(key,value);

Hi, 

I had executed a soql query and put the query output in  a list. Now I want to add a custom coloumn in the list.

Following is the way I am used it in code :

List<CustomObject> mylist = [select id,name,ipaddress from CustomObject];

I want to add a custom coloumn and display this all list in a table 

Can anyone suggest me how to achive this???