• Subbu
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 8
    Replies
I configured knowledge base in my org but knowledge one widget is not appearing in case layout , Pleas find below steps which  I followed. Please help me any one Thanks in advance.



Disable previous article sidebar components.
To disable the Knowledge sidebar, in Setup go to App Setup | Customize | Cases | Page Layouts and click Edit next to your case page layout. In the page layout editor, click Layout Properties and ensure Knowledge Sidebar Show in the Console is unchecked.
To disable the case feed article tool, go to Setup | App Setup | Customize | Cases | Page Layouts and click Edit next to your case page layout. In the page layout editor, click Feed View and ensure Use Case Feed Article Tool in the Console is unchecked.
Go to Setup | App Setup | Customize | Cases | Page Layouts and click Edit next to the case page layout where you want to display the Knowledge One widget.
In the page layout editor, click Custom Console Components.
In the sidebar where you want the Knowledge One widget, select Knowledge One in the Type drop down and set the sidebar parameters.
  • July 17, 2018
  • Like
  • 0
I am new for Integration , Please help me  How to establish a connection One Org to another Org by using Rest API Oauth 2 and Consumer Id and consumer Secret .

Could you please give me sample code ......       

Thanks in advance
  • January 04, 2017
  • Like
  • 0
I created a resource to insert an Account record with fields- Name and Description in SF1(say), and i want to send the values from another instance SF2(say) using REST API from URL parameters.

I created one VF page with fields Name and Description. when i entered Name and Description fields respectively they should go to contoller dynamically and create the record in resource instance.

Target Org :

User-added image


@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource {
  
  @HttpPost
    global static String doPost(String name,String phone, String website) {
        Account account = new Account();
        account.Name = name;
        account.phone = phone;
        account.website = website;
        insert account;
        return account.Id;
    }
}

Source Org :

User-added image
Controller :


public class ApexController {
    
    public String response{get;set;}
    public String accName{get;set;}
    public String accPhone{get;set;}
    public String accWebsite{get;set;}
    
    public PageReference CreateAccount() {
        //find access token using Auth 2.0 
        String Access_Token='3MVG9fMtCkV6eLheWOt4w544Nluwm1zx0HUAFGdCpPoWBGVOQv2K2fD7t8XotR3c9OE2bIHuXOhRv.ZEzjHYNI';
        Httprequest req=new httprequest();
        String domainName='subbuorg2-dev-ed.my.salesforce.com';
        String endPointURL='https://'+domainName+'/services/data/v27.0/sobjects/Account';
        req.setendpoint(endPointURL);
        req.setHeader('Content-Type', 'application/xml; charset=utf-8');
        req.setBody('<?xml version="1.0" encoding="UTF-8" ?><request><name>'+accName+'</name><phone>'+accPhone+'</phone><website >'+accWebsite+'</website > </request>');
        req.setmethod('POST');
        req.setHeader('Authorization','Authorization: Bearer '+Access_Token);
        Http http = new Http();
        HTTPResponse res = http.send(req);
        response=res.getbody();
        System.debug('****************res.getStatusCode();'+res.getStatusCode());
        System.debug('****************res.getbody();'+res.getbody());
        return null;
    }
}


Visualforce Page ;

<apex:page controller="ApexController">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockButtons >
            <apex:commandButton value="Create Account in SF1 instance" action="{!CreateAccount}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
                <apex:outputLabel for="aname" value="Name"></apex:outputLabel>
                <apex:inputText value="{!accName}" id="aname"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel for="aphone" value="Phone"></apex:outputLabel>
                <apex:inputText value="{!accPhone}" id="aphone"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel for="aw" value="Website"></apex:outputLabel>
                <apex:inputText value="{!accWebsite}" id="aw"/>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
    
    <apex:pageBlock title="Response">
        <apex:pageBlockSection >
            <apex:outputText value="{!Response}"></apex:outputText>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>


I am getting below error


User-added image


Could you please explain about Access_token ,I think issue with Access_token Plz correct......


Is it combination of  Consumer Key + Consumer secret + security token

 
Thakns in Advance
Subbu


 
  • December 31, 2016
  • Like
  • 0
I have a custom picklist on Account objects it contains values A,B and C. I am accessing this picklist at visualforce by using the <apex:inputfield> .So I don't want to get all the picklist values  , I want values (B and C) at visualforce, Could you please suggest me.
  • May 17, 2016
  • Like
  • 0
If  I am writhing the code directly in side the class , getting errors like Right curly brace({) and unexpected token error . Same code when i am writing in side the method i did not get any Error , my code is working fine ,Could you please let me know what is the technical thing here...like oops concept , please i am new for the APEX coding , should not hesitate .
  • October 10, 2015
  • Like
  • 0
string ratingValue = 'Hot';
public List<Account> lstAccount{get;set;}
string strQuery = 'select id, name, rating, industry,( select id, firstname, lastname, phone, fax from contacts) from account where rating =: ratingValue';
lstAccount = Database.Query(strQuery);
    if(lstAccount.size()!= 0)
    {
    for(Account acc : lstAccount)
    {
        system.debug(acc.id + ' ----> '+ acc.name + ' ----> '+acc.rating + ' ----> '+ acc.industry );
        
        system.debug('Contact Records Information.');
        system.debug('Contact Count ....: '+ acc.contacts.size());
        
        if(acc.contacts.size() > 0)
        {
            for(contact con : acc.contacts)
            {
                system.debug(con.id + ' ---> ' + con.firstname + ' ----> ' + con.lastname);
            }
        }
        else
            system.debug ('No Contacts for this Account');
    }
}
else
{
    system.debug('Account Record Not Found.');
}
  
  • October 08, 2015
  • Like
  • 0
string ratingValue = 'Hot';
public List<Account> lstAccount{get;set;}
string strQuery = 'select id, name, rating, industry,( select id, firstname, lastname, phone, fax from contacts) from account where rating =: ratingValue';
lstAccount = Database.Query('strQuery');
    if(lstAccount.size()!= 0)
    {
    for(Account acc : lstAccount)
    {
        system.debug(acc.id + ' ----> '+ acc.name + ' ----> '+acc.rating + ' ----> '+ acc.industry );
        
        system.debug('Contact Records Information.');
        system.debug('Contact Count ....: '+ acc.contacts.size());
        
        if(acc.contacts.size() > 0)
        {
            for(contact con : acc.contacts)
            {
                system.debug(con.id + ' ---> ' + con.firstname + ' ----> ' + con.lastname);
            }
        }
        else
            system.debug ('No Contacts for this Account');
    }
}
else
{
    system.debug('Account Record Not Found.');
}
   
  • October 07, 2015
  • Like
  • 0
I created a resource to insert an Account record with fields- Name and Description in SF1(say), and i want to send the values from another instance SF2(say) using REST API from URL parameters.

I created one VF page with fields Name and Description. when i entered Name and Description fields respectively they should go to contoller dynamically and create the record in resource instance.

Target Org :

User-added image


@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource {
  
  @HttpPost
    global static String doPost(String name,String phone, String website) {
        Account account = new Account();
        account.Name = name;
        account.phone = phone;
        account.website = website;
        insert account;
        return account.Id;
    }
}

Source Org :

User-added image
Controller :


public class ApexController {
    
    public String response{get;set;}
    public String accName{get;set;}
    public String accPhone{get;set;}
    public String accWebsite{get;set;}
    
    public PageReference CreateAccount() {
        //find access token using Auth 2.0 
        String Access_Token='3MVG9fMtCkV6eLheWOt4w544Nluwm1zx0HUAFGdCpPoWBGVOQv2K2fD7t8XotR3c9OE2bIHuXOhRv.ZEzjHYNI';
        Httprequest req=new httprequest();
        String domainName='subbuorg2-dev-ed.my.salesforce.com';
        String endPointURL='https://'+domainName+'/services/data/v27.0/sobjects/Account';
        req.setendpoint(endPointURL);
        req.setHeader('Content-Type', 'application/xml; charset=utf-8');
        req.setBody('<?xml version="1.0" encoding="UTF-8" ?><request><name>'+accName+'</name><phone>'+accPhone+'</phone><website >'+accWebsite+'</website > </request>');
        req.setmethod('POST');
        req.setHeader('Authorization','Authorization: Bearer '+Access_Token);
        Http http = new Http();
        HTTPResponse res = http.send(req);
        response=res.getbody();
        System.debug('****************res.getStatusCode();'+res.getStatusCode());
        System.debug('****************res.getbody();'+res.getbody());
        return null;
    }
}


Visualforce Page ;

<apex:page controller="ApexController">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockButtons >
            <apex:commandButton value="Create Account in SF1 instance" action="{!CreateAccount}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
                <apex:outputLabel for="aname" value="Name"></apex:outputLabel>
                <apex:inputText value="{!accName}" id="aname"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel for="aphone" value="Phone"></apex:outputLabel>
                <apex:inputText value="{!accPhone}" id="aphone"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel for="aw" value="Website"></apex:outputLabel>
                <apex:inputText value="{!accWebsite}" id="aw"/>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
    
    <apex:pageBlock title="Response">
        <apex:pageBlockSection >
            <apex:outputText value="{!Response}"></apex:outputText>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>


I am getting below error


User-added image


Could you please explain about Access_token ,I think issue with Access_token Plz correct......


Is it combination of  Consumer Key + Consumer secret + security token

 
Thakns in Advance
Subbu


 
  • December 31, 2016
  • Like
  • 0
I have a custom picklist on Account objects it contains values A,B and C. I am accessing this picklist at visualforce by using the <apex:inputfield> .So I don't want to get all the picklist values  , I want values (B and C) at visualforce, Could you please suggest me.
  • May 17, 2016
  • Like
  • 0
string ratingValue = 'Hot';
public List<Account> lstAccount{get;set;}
string strQuery = 'select id, name, rating, industry,( select id, firstname, lastname, phone, fax from contacts) from account where rating =: ratingValue';
lstAccount = Database.Query(strQuery);
    if(lstAccount.size()!= 0)
    {
    for(Account acc : lstAccount)
    {
        system.debug(acc.id + ' ----> '+ acc.name + ' ----> '+acc.rating + ' ----> '+ acc.industry );
        
        system.debug('Contact Records Information.');
        system.debug('Contact Count ....: '+ acc.contacts.size());
        
        if(acc.contacts.size() > 0)
        {
            for(contact con : acc.contacts)
            {
                system.debug(con.id + ' ---> ' + con.firstname + ' ----> ' + con.lastname);
            }
        }
        else
            system.debug ('No Contacts for this Account');
    }
}
else
{
    system.debug('Account Record Not Found.');
}
  
  • October 08, 2015
  • Like
  • 0
string ratingValue = 'Hot';
public List<Account> lstAccount{get;set;}
string strQuery = 'select id, name, rating, industry,( select id, firstname, lastname, phone, fax from contacts) from account where rating =: ratingValue';
lstAccount = Database.Query('strQuery');
    if(lstAccount.size()!= 0)
    {
    for(Account acc : lstAccount)
    {
        system.debug(acc.id + ' ----> '+ acc.name + ' ----> '+acc.rating + ' ----> '+ acc.industry );
        
        system.debug('Contact Records Information.');
        system.debug('Contact Count ....: '+ acc.contacts.size());
        
        if(acc.contacts.size() > 0)
        {
            for(contact con : acc.contacts)
            {
                system.debug(con.id + ' ---> ' + con.firstname + ' ----> ' + con.lastname);
            }
        }
        else
            system.debug ('No Contacts for this Account');
    }
}
else
{
    system.debug('Account Record Not Found.');
}
   
  • October 07, 2015
  • Like
  • 0
I created a resource to insert an Account record with fields- Name and Description in SF1(say), and i want to send the values from another instance SF2(say) using REST API from URL parameters.

I created one VF page with fields Name and Description. when i entered Name and Description fields respectively they should go to contoller dynamically and create the record in resource instance.

My question is how to pass the values from VF page to Controller(into URL parameters.)?