• Ravikant Saini 1
  • NEWBIE
  • 90 Points
  • Member since 2014

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 30
    Replies
Hi All,

I am working on the following requirement where on a Case detail page I need to provide a custom button, when clicked we need to show Case detailes and all its related records in detailed mode as a PDF. We need to show in a PDF the following:
  • Case record details
  • All related items on a Case in detailed mode, not as a list view for ex, Customers associated a Case, and other custom objects. 
  • Even the Customer object that I mentioned is a Custom object that has many related items, even that also has to be shown in the detailed mode. 
All of the above needs to be show in a PDF in one page on click of a button. 

I am mainly worried about the view state here. There would be so many records returned, many SOQL queries and even all fields needs to be displayed in detailed mode in a single page. Can any of you suggest me the best approaches to take here so that I do not hit a View state error. Also any suggestions on approaching to this solution will be highly appreicated. 

Thanks a lot in advance!

Raghu
Suddenly getting this error from no where. All classes which are involved in sending email are failing. Please suggest.


I would like to simmply call a javascript function (setOtherBox) that is triggered by checkbox1 and sets checkbox2 as selected. I'm using the inputField within a PageBlockSection. Can't seem to get this to update the second checkbox. Would appreciate any help and prefer to do this using the standardcontroller.

<apex:page doctype="HTML-5.0" standardController="Audit__c">

<script>
        function setOtherBox(input, textid) {
            if(input.checked) {
                document.getElementById(textid)..checked=true;
            }
            else {
                 document.getElementById(textid)..checked=false;
            }
        }
    </script>

<apex:variable var="audit" value="{!Audit__c}" />  
<apex:form id="form1">
<apex:pageBlock id="block1" title="Audit Sample Selection">
<apex:outputPanel id="ajaxrequest">
........
<apex:pageBlockSection columns="14" id="section2" title="My Sections"  >

<table id="t01" style="width:100%">
 <tr>
    <th><apex:inputField id="check1" value="{!audit.Policy_Information__c}" onclick="setOtherBox(this, '{!$Component.check2}')" />  </th>     
    
    <th><apex:inputField id="check2" value="{!audit.Driver_Information__c}"/> </th>      
   
</tr>

</table>

</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
 

Hi! I need to correct a known issue with Chatter Answers and one of the triggers that needs modification (chatter_answers_question_escalation_to_case_trigger) is unavailabe in Eclipe, i.e. I can't access it. I've gone through all the oject permissions/class permission, etc. in Salesforce on my profile and nothing seems to be working. Does anyone understand why I wouldn't be able to see this trigger in IDE?
Hello,

I had this problem, I want to open the apex code of the custom object but I couldn't I tried with this link below

https://help.salesforce.com/HTViewHelpDoc?id=accessing_layout_custom.htm&language=en_US

But I don't see any option, I don't know if I need other rights to Edit the Layout.

User-added image
 
If anyone can help me I would appreciate.

Thanks and Regards.

We have a flow that creates a record in custom object and requirement is we need to write trigger on the custom object to update the contact Fields with the data in the record. Can some one please help with the code.
I need to pass 'BenefitsTab' string from vfp1 to vfp2 when i click command button in vfp1 which calls vfp2 into iframe. Plz help.This avoids me to write 11 VFP's
VFP 1:
<apex:page controller="BenefitsTabControllernew" access="global" id="benecomp">
    <apex:iframe src="/{!BenefitsTab.Default_Article__c}&isdtp=vw" id="mainframe" rendered="{!Benefitsframeflag}" scrolling="true" />
    <apex:commandButton value="Search Articles" onclick="document.getElementById('mainframe').src='/apex/Article_ResultsList';return false" id="submitButton" rerender="benefitspanel"/>
  <!-- I Need To pass 'BenefitsTab' string from this page to another VFP2-->
         
</apex:page>


VFP 2:
<apex:page sidebar="false" title="Article List" controller="BenefitsTabControllernew" standardStylesheets="false" showHeader="false" >
<knowledge:articleList articleVar="article" pageNumber="{!currentPageNumber}" categories="{!BenefitsTab.Search_Category__c}" Keyword="{!searchstring}" hasMoreVar="false" pageSize="10">
</knowledge:articleList>
</apex:page>
Hello,

I have a CASE standard object (Parent) on which there is a custom lookup field "Pick-up Location" whereby, a user clicks on a magnifying glass icon and selects a value.

I have a SHIPMENT custom object (Child to the CASE) on which I have created a new custom formula field "Pick-up Location" of return type Text. I want to display the value from the parent's "Pick-up Location" lookup field but cannot seem to figure out the correct formula.

I tried in the formula editor Pick-up Location = parent_object.field_name but it doesn't display the value, instead, it displays the ID (a2Bo0000000PXIw) as plain Text.

I tried TEXT(parent_object.field_name) but it throws an error since it is not a Picklist field but a Lookup field whose value we need.

I'd appreciate the response to be within the Declarative Click configuration instead of APEX code.

Thanks!
Hello,

I created a new Custom Object and could'nt see my app in Setup -> Build -> Customize.....How I can see it there or how I can open the page Layout for customize my page in order to modify an a pick list for change it manual values to dynamically.

Thank you very much,
Greetings.
  • October 16, 2014
  • Like
  • 0
I have a 263-line class and associated test class and I'm m trying to test to make sure I get good coverage.  I'm in the Developer Console in the Sandbox.  I run a test on the class.  After it's finished I double-click on the class in the Overall Code Coverage panel; it brings up my class with highlighted lines showing what lines were hit and which ones were missed.  It looks fine until line 121, when the highlighting gets messed up: some comment lines as well as some lines with just a bracket are highlighted with red, while some code is not highlighted at all.  The last line with any highlighting (red) is line 149.  There's a *lot* of code below that tline with no highlighting on it.  Obviously something is messed up here...is this a bug in Developer Console on the Sandbox?  I don't see the same problem on Production.

Here's the code between lines 102 and 130 that illustrate the problem:

Bad highlighting sample

Thanks in advance!
I have a class that has a future call that first has a try which has a callout in it, a catch that sends an email notification, and a finally which updates a custom setting.  However, I am getting cases where the try seems like it should have worked because I'm not getting an email notification from the catch statement, but the finally portion fails to update the custom setting. Then when I go to check if the try portion succeeded, the records haven't been updated.  
Hello,

New to using JS, we have a need on a VisualForce page when the label of a pageBlockSectionItem is clicked, to execute a JS popup. In order to keep the code clean, I have put the JS in a seperate static resource. I am now trying to access a function for the onLabelClick and it is not working. If I put the <script> tags in the VF page and invoke the fuction onLabelclick it works, but is there a way to avoid that?

Below is the VF code I have that is not working:


<apex:page standardController="QA__c">
 <apex:includeScript value="{!$Resource.QA_Javascript}"/>  
 <apex:form >
 <apex:pageMessages />
 <apex:pageBlock title="QA Scoring Form">
 <apex:pageBlockButtons >
     <apex:commandButton action="{!save}" value="Save" />
     <apex:commandButton action="{!cancel}" value="Cancel"/>
 </apex:pageBlockButtons> 
 <apex:actionRegion >
  <apex:pageblockSection title="QA Information">
      <apex:inputField value="{!QA__c.Reviewee__c}"/>
      <apex:inputField value="{!QA__c.Complexity__c}"/>
      <apex:inputField value="{!QA__c.QA_Quote_Number__c}"/>
      <apex:inputField value="{!QA__c.QA_Date__c}"/>
      <apex:inputField value="{!QA__c.Overall_Comments__c}"/>
  </apex:pageblockSection>
  <apex:pageBlockSection title="Phone Etiquette" id="pe">
       <apex:pageBlockSectionItem onLabelclick="appGreet();" >       
           <apex:outputLabel value="Appropriate Greeting" for="ag1"/>
           <apex:panelGrid columns="2">
               <apex:inputField value="{!QA__c.Appropriate_Greeting__c}" id="ag1">
                <apex:actionSupport event="onchange" reRender="pe"/>
               </apex:inputfield>
               <apex:inputField value="{!QA__c.App_Greet_Comment__c}" id="ag2" label="Comments"/>
           </apex:panelGrid>
       </apex:pageBlockSectionItem>


Hi All,

I am working on the following requirement where on a Case detail page I need to provide a custom button, when clicked we need to show Case detailes and all its related records in detailed mode as a PDF. We need to show in a PDF the following:
  • Case record details
  • All related items on a Case in detailed mode, not as a list view for ex, Customers associated a Case, and other custom objects. 
  • Even the Customer object that I mentioned is a Custom object that has many related items, even that also has to be shown in the detailed mode. 
All of the above needs to be show in a PDF in one page on click of a button. 

I am mainly worried about the view state here. There would be so many records returned, many SOQL queries and even all fields needs to be displayed in detailed mode in a single page. Can any of you suggest me the best approaches to take here so that I do not hit a View state error. Also any suggestions on approaching to this solution will be highly appreicated. 

Thanks a lot in advance!

Raghu
Hi everebody I'm new in this forum and I would like to know if there is a possibilité to authenticate to Salesforce services from a Java client using certificates
now im using the classic methode for authentification that's with a user and password .
I've built a custom app, now I want to uninstall it from Production, but I can't find how to do so, and deleting it doesn't work either.  Help!
HI,

I'm trying to create a controller where I can pass values from a URL into my site.  The controller appears to work as I expected, but the test class doesn't have enough code coverage.  I can't get it to actually set my account number.  I have 19% code coverage, which looks like it's the first lines of my test class, but nothing after where it's supposed to set the account.

Any help is appreciated.


Class:

public class SubmitCaseController {
    public Case c { get; set; }
    public String acctNum { get; set; }
    public SubmitCaseController() {
        c = new Case();
    }
 
    public PageReference submitCase() {
        List<Account> accts = [SELECT Id FROM Account WHERE Billing_Account_Number__c = :
        ApexPages.currentPage().getParameters().get('acctNum')];
        if (accts.size() != 1) {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Invalid account number');
            ApexPages.addMessage(msg);
            return null;
        }

        if (c.Is_Device_Installed__c =='No') {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Please install device');
            ApexPages.addMessage(msg);
            return null;
        }
       
         if (c.Has_SIM_card_been_activated__c=='No') {
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Please activate SIM');
            ApexPages.addMessage(msg);
            return null;
        }
      
        else {
            try {
                c.AccountId = accts.get(0).Id;
              
                // Specify DML options to ensure the assignment rules are executed
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.useDefaultRule = true;
                c.setOptions(dmlOpts);
                // Insert the case
                INSERT c;
                String param = 'RecordType=012G0000001IbQk';
               
               // c = [SELECT Id, CaseNumber, Is_Device_Installed__c, Has_SIM_card_been_activated__c
                //FROM Case WHERE Id = :c.Id];
                return new PageReference('/SubmitCaseThanks');
               
            } catch (Exception e) {
                ApexPages.addMessages(e);
                return null;
            }
        }
    }
}


Test Class:
@istest
public class SubmitCaseControllerTest{
static testMethod void SubmitCaseController(){
   
  SubmitCaseController sc = new SubmitCaseController();  
   
  system.currentPageReference().getparameters().put('Id',sc.acctNum);
     
     Case ca = new Case(Subject='Test Controller Acct Case');

     ca.SuppliedName='JMcD';
     ca.Billing_Acct_Number__c=sc.acctNum;
     ca.SuppliedEmail='test@test.com';
     ca.Subject='test subject controller';
     ca.Is_Device_Installed__c='Yes';
     ca.Has_SIM_card_been_activated__c='Yes';
     ca.Type='012G0000001IbQk';
    
     sc.c = ca;
    
     sc.c.Is_Device_Installed__c='Yes';
     sc.c.Has_SIM_card_been_activated__c='Yes';
     sc.c.Type='012G0000001IbQk';
    
     if (sc.c.Is_Device_Installed__c =='No')
        {
        System.assertEquals('No', sc.c.Is_Device_Installed__c, 'Please install device');
        }
               
     sc.submitcase();  
}
}
<apex:page Controller="Delet">

<apex:form >

  <center>
  <apex:pageBlock >
    <b>Category:&nbsp;&nbsp;</b>
    <apex:selectList value="{!ctgry}" size="1">
      <apex:selectOptions value="{!ctgrys}"/>
    </apex:selectList> 
  </apex:pageBlock>
  </center>
 
</apex:form>
</apex:page>





public class Delet
{

    public String[] ctgry = new String[]{};
   
    public Delet()
    {

    }
   
    public List<SelectOption> getCtgrys()
    {   
      List<SelectOption> options = new List<SelectOption>();
      options.add(new SelectOption('US','US'));
      options.add(new SelectOption('CANADA','Canada'));
      options.add(new SelectOption('MEXICO','Mexico'));
      return options;
    }
   
    public String[] getCtgry()
    {
      return ctgry;
    }
   
    public void setCtgry(String[] ctgry)
    {
    this.ctgry = ctgry;
    }   

}



Can some one tell me in the above code,what is &nbsp;&nbsp and in the line public String[] ctgry = new String[]{};
why [] and {} both the braces is used and what does that line mean.
why  MEXICO','Mexico' caps and small letters used.why constructor,getter and setter used.