• Chandrakanth
  • 10 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 5
I have been googling a lot about the fact how to get a refresh token. I have rest integration between salesforce to salesforce and it is working fine. After few hours not using the service I get this message in my debug log :
message: System.HttpResponse[Status=Unauthorized, StatusCode=401]
Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

I totally understand why it is happening ( cause every access has some time limit ). Now i want to request for the refresh token ( I understood by reading multiple articles. sample). In order to request for a refresh token, we should pass some parameters as mentioned below.
POST /services/oauth2/token HTTP/1.1
Host: https://login.salesforce.com/ 
&refresh_token=***your token here***
But just wanted to know that from where I get &refresh_token=your token here mentioned in the above sample code.
The rest integration is setup using Named credentials and Auth providers.

As a work around now, when the session is expired every time, I go to connected app and re-authenticate and my code works just fine.

My goal here is, when i face this Session Expired message, i should be able refresh the token withing the same class where i am invoking the rest service so that other piece of logic works fine.

My connected app looks like this and i am doubting that i should give scope as full +refresh token. Am i correct? please let me know if anyone has suggestions.

User-added image
Hi Everyone, I am on to something where i need to invoke rest class written and exposed in my own developer edition org. 
Its basically a Rest Call ( with 'GET' Method ) and when i test same class invoking with Workbench with required parameters it is giving me the expected result. Now the problem is, I created a new Reomte Site Setting and pasted the URL from my own org - copied from the browser ( In this case remote site setting which i saved is " https://ckdomaintest-dev-ed.my.salesforce.com " and invoking the same method with same parameters is not executing properly. I am getting the follwing error. "System.HttpResponse [Status=Not Found, StatusCode=404] ", So I feel the remote site is not bieng recognized. can somebody please help me here. how do i call my own org.
Hi All,
I am stuck in writing a test class due to this error. Can anyone please let me know where i am going wrong.

here is the test class.
EmailTemplate emailTemp = new EmailTemplate ();
    emailTemp.subject = 'Licence reallocations*******';
    emailTemp.HtmlValue='<messaging:emailTemplate subject="Test sub" recipientType="User" relatedToType="MTR_Email_Notification__c"></messaging:emailTemplate>';
    emailTemp.Name ='ChangeLocation';
    //emailTemp.Body ='xxxxxxxxxx';
    emailTemp.developerName = 'test';
    emailTemp.FolderId = UserInfo.getUserId();
    emailTemp.isActive = true;
    emailTemp.Markup='Body body';
    insert emailTemp;

But whene i run the method i am getting follwing error.Line number 16(from the screen shot) is insert emailTemp.

![enter image description here][1]

 User-added image
Salesforce Org A : will publish event when a Case is been updated.

Salesforce Org B : Case information sent as event message will be consumed in this org and certain business action are trigger based on the Case info.

What is the Apex Code / Configuration on Salesforce Org B to subscribe for the event and consume events ?


Can anybody help/suggest/provide solution on the below requirement,

I have 7 custom objects, Object1 is the Parent Object of all other 6 objects and each object has a lookup relation to its parent object (i.e. Object1 has a child Object2 , Object2 has a child Object3 and Object3 has a child Object4 so on...).

I want to display these custom objects in tree view in a VF page and is it possible to write SOQL query for 7 levels deeper to fetch the records of each object and display the related records under each object in the same tree view.


Any help highly appreciated.

Thanks in Advance.
I'm new to Lightning components and am experimenting with my first app displaying a list of records from a custom object (Aircraft_Relationship__c); each record will include fields from two other related objects (master-detail to Aircraft__c and lookup to Account (field is  Account is Aircraft_User__c). The listing of the primary object (Aircraft_Relationship__c) works fine.

For the life of me I cannot figure out why when I launch the app the related fields do not appear; I've reviewed the documentation and from what I understand the dot notation is supposed to work in traversing these relationships (as I'm familiar with in VF).

Any help would be appreciated (am I missing something obvious?)

Hre's Apex controller pulling the related fields:
public with sharing class auraAClisting {

    public static List<Aircraft_Relationship__c> findAll() {
        return [SELECT id, name,status__c,ownership__c,Aircraft__r.name,aircraft__r.id,New_Used__c,Model__c,Aircraft_User__c,Aircraft_User__r.name,Owner__c,Owner__r.name FROM Aircraft_Relationship__c where status__c = 'Delivered' LIMIT 50];
Here's the client-side controller:
    doInit : function(component, event) {
        var action = component.get("c.findAll");
        action.setCallback(this, function(a) {
            component.set("v.acr", a.getReturnValue());
And the component:
<aura:component controller="auraAClisting">
    <aura:attribute name="acr" type="Aircraft_Relationship__c[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <ul class="list-group">
        <aura:iteration items="{!v.acr}" var="ac">
            <li class="list-group-item">
                <a href="{! '/' + ac.Id }">
                    <p>{!ac.Name}</p>             <-- DISPLAYS VALUE in APP
                    <p>{!ac.Aircraft__c}</p>      <-- DISPLAYS VALUE in APP
                    <p>{!ac.Aircraft__r.id}</p>   <-- NOTHING APPEARS in APP
Hi All,

We have some requirement like update the Queue's DL and email id hard coded in email template will be masked after our sanbox has been refreshed. Is that can be possible via any automated method like Batch process?

HI all,


        In visualforce we can write like this.

<apex:inputField value="{!CreateAnEvent.Event_title__c}" style="width:250px" id="Eventinfo_title"/>.


Is it possible to concatenate another variable which is defined in apex class to the value attribute in <apex:inputField>. Its a very urgent requirement.Please help me. 


My requirement is, I will select few field names randomly  of an Object in apex class.I need to display these fields dynamically in visualforce page. How can I achieve this.


If you need any other information please let me know.



Naresh B