• RAJ PADMANABHAN 8
  • NEWBIE
  • 20 Points
  • Member since 2015
  • Technical Architect
  • Menon Services Corp


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 12
    Replies
Is there a tool to Migrate Article types to Knowledge Article types Lightning?  I did not see anything in the release notes.
I am trying to see if there is simpler way to disable the Create PDF button on a quote without having to create a new VF page and cutom controllers.  Create PDF button should be disabled based on field value in a quote, for example say the quote is in "Accepted" status then the Create PDF should be disabled OR other option is to display error message when the button is clicked indicating that the Create PDF function is not available when the quote is in "Accepted" status.
Update a custom field on Account object if the account has any chid records using triggers.  I am trying to update the parent account record if the account has any child accounts.  The scenario is when a new account is created , it does not have any child accoounts.  We have some reporting that is built based on a flag field which looks for accounts if it has child accounts and we would like to set a flag on the parent account if a child exists.  I wrote the following trigger but it sets the child account field value and not the parent accoount field value.


trigger updateAccountChildFlag on Account(after insert, after update) {  
    if (trigger.isUpdate) {
        //Identify Child Account
        Set<Id> setAccountChangedIds = new Set<Id>();
        for (Account oAccount : trigger.new) {
            Account oOldAccount = trigger.oldMap.get(oAccount.Id);
            if (oAccount.ChildExists__c == false ) {
                setAccountChangedIds .add(oAccount.Id);
            }
        }
        //If any, get child account associated with each account
        if (setAccountChangedIds.isEmpty() == false) {
            List<Account> listChildAccounts = [SELECT Id, ParentId FROM Account WHERE ParentId IN :setAccountChangedIds];
            for (Account oAccount1 : listChildAccounts) {
                //Get Accounts
            //    oAccount = trigger.newMap.get(oAccount1.Id);
                //Set Address
                oAccount1.ChildExists__c = true;
            }
            //If any, execute DML command to save contact addresses
            if (listChildAccounts.isEmpty() == false) {
                update listChildAccounts;
            }
        }
    }
}

The intent is to update current active account record by looping through all accounts to see if the parent account has child based on parent id field.  if the result set is not empty then set a flag field indicating that the child account exists.
I created a new Article type and created a visualforce page which I would like to use for the custom article type. What is the trick behind displaying the visualforce page that I created in the dropdown list for different channels?

Article Type and Visualforce page
I have created a page with the following code:

<apex:page sidebar="false" >
    <apex:iframe height="300" width="300" src="http://www.yahoo.com" scrolling="true"/>
</apex:page>

objective is display the yahoo.com in a window .  when i preview in the code, I get a blank window.  Can someone tell me why?  Is there a way to use the URLFOR function to invoke the external website URL?
I am getting following error when the code is deployed:  My objective was to display similar cases on the lefside bar of the service console using custom VF page

caused by: System.QueryException: List has no rows for assignment to SObject

Class.SimilarCasesController.getCurrentCase: line 4, column 1
Class.SimilarCasesController.getSimilarCases: line 7, column 1


Here is the controller I created:
public class SimilarCasesController {
public Case getCurrentCase() {
    String cid = ApexPages.currentPage().getParameters().get('cid');
    return [SELECT Id, CaseNumber, Reason, Product__c, Expertise__c FROM Case WHERE Id = :cid];
    }
public Case[] getSimilarCases() {
Case currentCase = getCurrentCase();
return [SELECT Id, CaseNumber, Owner.Name, Subject, Status FROM Case WHERE Product__c = :currentCase.Product__c AND Expertise__c = :currentCase.Expertise__c AND Reason = :currentCase.Reason AND Id != :currentCase.Id];
    }
}
 and here is the Visfualforce page

<apex:page controller="SimilarCasesController" tabStyle="Case">
    <apex:form >
       <apex:sectionHeader title="Similar Cases" subtitle="{!currentCase.CaseNumber}"/>
       <apex:pageBlock title="Similar Cases to {!currentCase.CaseNumber}">
        <apex:pageBlockTable value="{!similarCases}" var="case">
            <apex:column >
                <apex:outputLink value="{!URLFOR($Action.Case.View, case.Id)}">View</apex:outputLink>
            </apex:column>
            <apex:column headerValue="Case Number" value="{!case.CaseNumber}"/>
            <apex:column headerValue="Owner" value="{!case.Owner.Name}"/>
            <apex:column headerValue="Subject" value="{!case.Subject}"/>
            <apex:column headerValue="Status" value="{!case.Status}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
     </apex:form>
</apex:page>
 
We have a requirement to display the list of cases that are related to an article in a service console sidebar when viewing a case that has an article associated to it.  In other words, I have a current case I am working with and I associated an article to the current case in context.  It would be nice to see list of cases that are associated to the same article in context of current case in the left sidebar of the service console (case detail or case feed view).  Support indicated that this is not an OOB feature.  So I am trying to create a apex class and then create a VF page to display the list of cases on the left side bar of the console.  While creating the apex I am getting the folloiwng error .  Can some help provide feed back on what the isue might be?

  [Error] Error: Compile Error: Illegal assignment from List<CaseArticle> to Case at line 16 column 5

Here is the code

public class CaseArticleExtension {

    public final Case thisCase;

    public String CaseId {get;set;}
    
    public String KnowledgeArticleId {get;set;}

    public Case selectedCase {get;set;}

    public CaseArticleExtension(ApexPages.StandardController stdController) {
        this.thisCase = (Case)stdController.getRecord();
        selectedCase = new Case();
    }
    public pagereference CaseArticle(){
    selectedCase = [SELECT CaseId FROM CaseArticle WHERE KnowledgeArticleId = :KnowledgeArticleId];
    return apexpages.currentpage();
}
}
Update a custom field on Account object if the account has any chid records using triggers.  I am trying to update the parent account record if the account has any child accounts.  The scenario is when a new account is created , it does not have any child accoounts.  We have some reporting that is built based on a flag field which looks for accounts if it has child accounts and we would like to set a flag on the parent account if a child exists.  I wrote the following trigger but it sets the child account field value and not the parent accoount field value.


trigger updateAccountChildFlag on Account(after insert, after update) {  
    if (trigger.isUpdate) {
        //Identify Child Account
        Set<Id> setAccountChangedIds = new Set<Id>();
        for (Account oAccount : trigger.new) {
            Account oOldAccount = trigger.oldMap.get(oAccount.Id);
            if (oAccount.ChildExists__c == false ) {
                setAccountChangedIds .add(oAccount.Id);
            }
        }
        //If any, get child account associated with each account
        if (setAccountChangedIds.isEmpty() == false) {
            List<Account> listChildAccounts = [SELECT Id, ParentId FROM Account WHERE ParentId IN :setAccountChangedIds];
            for (Account oAccount1 : listChildAccounts) {
                //Get Accounts
            //    oAccount = trigger.newMap.get(oAccount1.Id);
                //Set Address
                oAccount1.ChildExists__c = true;
            }
            //If any, execute DML command to save contact addresses
            if (listChildAccounts.isEmpty() == false) {
                update listChildAccounts;
            }
        }
    }
}

The intent is to update current active account record by looping through all accounts to see if the parent account has child based on parent id field.  if the result set is not empty then set a flag field indicating that the child account exists.
I created a new Article type and created a visualforce page which I would like to use for the custom article type. What is the trick behind displaying the visualforce page that I created in the dropdown list for different channels?

Article Type and Visualforce page
I have created a page with the following code:

<apex:page sidebar="false" >
    <apex:iframe height="300" width="300" src="http://www.yahoo.com" scrolling="true"/>
</apex:page>

objective is display the yahoo.com in a window .  when i preview in the code, I get a blank window.  Can someone tell me why?  Is there a way to use the URLFOR function to invoke the external website URL?
I am getting following error when the code is deployed:  My objective was to display similar cases on the lefside bar of the service console using custom VF page

caused by: System.QueryException: List has no rows for assignment to SObject

Class.SimilarCasesController.getCurrentCase: line 4, column 1
Class.SimilarCasesController.getSimilarCases: line 7, column 1


Here is the controller I created:
public class SimilarCasesController {
public Case getCurrentCase() {
    String cid = ApexPages.currentPage().getParameters().get('cid');
    return [SELECT Id, CaseNumber, Reason, Product__c, Expertise__c FROM Case WHERE Id = :cid];
    }
public Case[] getSimilarCases() {
Case currentCase = getCurrentCase();
return [SELECT Id, CaseNumber, Owner.Name, Subject, Status FROM Case WHERE Product__c = :currentCase.Product__c AND Expertise__c = :currentCase.Expertise__c AND Reason = :currentCase.Reason AND Id != :currentCase.Id];
    }
}
 and here is the Visfualforce page

<apex:page controller="SimilarCasesController" tabStyle="Case">
    <apex:form >
       <apex:sectionHeader title="Similar Cases" subtitle="{!currentCase.CaseNumber}"/>
       <apex:pageBlock title="Similar Cases to {!currentCase.CaseNumber}">
        <apex:pageBlockTable value="{!similarCases}" var="case">
            <apex:column >
                <apex:outputLink value="{!URLFOR($Action.Case.View, case.Id)}">View</apex:outputLink>
            </apex:column>
            <apex:column headerValue="Case Number" value="{!case.CaseNumber}"/>
            <apex:column headerValue="Owner" value="{!case.Owner.Name}"/>
            <apex:column headerValue="Subject" value="{!case.Subject}"/>
            <apex:column headerValue="Status" value="{!case.Status}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
     </apex:form>
</apex:page>
 
Hello all,

Very new to Salesforce so forgive me.

Each case's SLA is different (some are 5 days others are 20...), this is calculated when the case is created. I need the escalation rule to be based off the SLA of each specific case where the case is not closed.

This is what I have so far:

SLA Breaching rule criteria: IsClosed <> True && SLA_Date__c <= NOW()
Unfortunately I cannot set the Escalation Actions ‘Age Over’ to 0 so it will have to be 30 minutes.

Would this work?
We have a requirement to display the list of cases that are related to an article in a service console sidebar when viewing a case that has an article associated to it.  In other words, I have a current case I am working with and I associated an article to the current case in context.  It would be nice to see list of cases that are associated to the same article in context of current case in the left sidebar of the service console (case detail or case feed view).  Support indicated that this is not an OOB feature.  So I am trying to create a apex class and then create a VF page to display the list of cases on the left side bar of the console.  While creating the apex I am getting the folloiwng error .  Can some help provide feed back on what the isue might be?

  [Error] Error: Compile Error: Illegal assignment from List<CaseArticle> to Case at line 16 column 5

Here is the code

public class CaseArticleExtension {

    public final Case thisCase;

    public String CaseId {get;set;}
    
    public String KnowledgeArticleId {get;set;}

    public Case selectedCase {get;set;}

    public CaseArticleExtension(ApexPages.StandardController stdController) {
        this.thisCase = (Case)stdController.getRecord();
        selectedCase = new Case();
    }
    public pagereference CaseArticle(){
    selectedCase = [SELECT CaseId FROM CaseArticle WHERE KnowledgeArticleId = :KnowledgeArticleId];
    return apexpages.currentpage();
}
}
Hi,

I am trying to write a apex code to get the list of Knowledge Articles associated to a cases. I am particularly interested in ArticleNumber from Knowedge Articles. We have CaseArticle object (middle object in M2M relationship) which stores both, CaseId and KnowledgeArticleId. Using KnowledgeArticleId, I want to get Aritcle Numbers stored in KnowledgeArticle. Struggle I am having is wrining joined query. I can query one by one object starting with Case Id, then getting KnowledgeArticleId and then getting ArticleNumber. But this is not efficient way of doing as I need to loop through multiple cases (say for cases created in last one month). Also, not sure what is relationship names as API doc does not give the details as well as these objects are not visible in salesforce setup (except case object). Please advise.