• Jconsultant
  • NEWBIE
  • 50 Points
  • Member since 2008

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 18
    Replies

Hi - I want to dynamically update a record when a user clicks a checkbox on my vf page, but I cannot figure out how to pass the record id of the row that is clicked to the Controller.

 

 

 

 

 

  • April 17, 2012
  • Like
  • 0

Send an Email can be overridden from Admin>App Setup>Activities>Activity Buttons with an s-control. This overrides the Send an Email button as well as the Reply and Reply To All links on the email related list. Does anyone know how to identify within the overriding s-control which email/activity was clicked when a reply link is clicked. There doesn't seem to be any relevant merge fields but I assume, seeing as the email related list reply links are overridden, that there must be a way to identify which item in the list was actually clicked.

 

Any ideas?

  • December 10, 2009
  • Like
  • 0

I have a Unit Test class that I am using to test 12 triggers.  I've noticed at the bottom of the debug log that I have used 93 of the 100 SOQL queries I'm allowed to use for a test pass.  Is there a way to split out the testing so that I don't run into this limit as I continue to develop in this environment and need to unit test my new code?  If I split the tests into seperate classes will that change the way the limits are evaluated when I run "all tests"?  My concern is that I'm going to add code and try to deploy it and even though it's test covered I'll hit this query limit.  Thoughts?

I am trying to create a report using VF that I render as a PDF.  I am able to get it to render landscape like I want to using style sheets, but I am not able to get the header row for my table to repeat.  The size of the table changes based on which record the report is run from.  If the table extends past 1 page I want to have the column headers repeat.  I have not been able to find this functionality anywhere on the web.  Also, the height of the rows is also dynamic so I can't do a print header every 10 rows type of fix.


Message Edited by Jconsultant on 11-17-2008 10:43 AM
I just wrote a new trigger in a sandbox environment and when I try to deploy it to production I get an UNKNOWN_EXCEPTION error with a long error code that it tells me to pass on my support rep.  I get this error if I deploy via Eclipse or using ANT.  I have  go-live on Tuesday and this would be a major setback if I can't get this trigger into production by then.  The strange thing is that I deployed a trigger two days ago without any issues.  I have the required test coverage.  I believe the issue is between Winter '09 in the Sandbox environment and Summer '08 in Production.  Is there an update that I need to download for Winter '09?  Any help on this would be greatly appreciated.

Joe
Hi All,

I have an custom object where i have 3 record types. There is a trigger on this object which will calucate serial no for each record type and it will insert.

Ex - 
Custom Object X__c.
Record Types = A, B , C
if i select record type A then one custom field will get inserted by A001.
if i select record type B then one custom field will get inserted by B001. 

When i am uploading the data with data loader with batch size 20, for 20 records with record type A is having the same serial no A001.

Need help how to resolve this.
Hey folks, 
We have a client that is trying to install our managed package. As part of this process, the setup steps involve the creation of a Connected App along with the requirement to edit the OAuth policy options. They can create the Connected App, but then client says they only have the single option of "Immediately expire refresh token" in the Refresh Token Policy. The other options for "Refresh token is valid until revoked" is not available (screenshot below shows what we typically see during other installations)


User-added image


They also cannot see the Consumer Key and Consumer Secret. The OAuth API section of the screen is blank in their case. 
User-added image

Why are these settings not showing up on their screen? They are logged in with admin role during this install process.

 

A customer of ours wants to have a field filled in from the user in the pre-chat form stored to the transcript. I get the field in fine, but it isn't stored to the Live Chat Transcript object I have tried several things but it just don't want to stick. Below is my current pre-chat form. The custom field I want to have saved to is (obviously) subject__c- does someone know a way to do this?

 

<apex:page showHeader="false"> 
<!-- This script takes the endpoint URL parameter passed from the deployment page and makes it the action for the form -->
<script type="text/javascript">
     (function() { 
     function handlePageLoad() {
       var endpointMatcher = new RegExp("[\\?\\&]endpoint=([^&#]*)");
       document.getElementById("prechatForm").setAttribute("action",
       decodeURIComponent(endpointMatcher.exec(document.location.search)[1]));
     } if (window.addEventListener) {
              window.addEventListener("load", handlePageLoad, false);
   } else { window.attachEvent("onload", handlePageLoad, false);
              }})(); 
</script>
<h1>Pre-chat Form</h1> 
<form method="post" id="prechatForm"> 
      Mitt telefonnummer: <br />
<input type="text" name="liveagent.prechat:phone" /><br /> 
      Mitt kundenummer: <br />
<input type="text" name="liveagent.prechat:kundeident" /><br /> 
      Min henvendelse gjelder: <br />
<input type="text" name="liveagent.prechat:subject" id="prechat_field" /><br /> <br />
      
      
      <!-- Creates an auto-query for a matching Contact records Email field based on the 
      value of the liveagent.prechat:Email field -->    
      <input type="hidden" name="liveagent.prechat.query:phone" 
      value="Account,Account.Phone" /> 
      <input type="hidden" name="liveagent.prechat.query:kundeident" 
      value="Account,Account.Email" /> 
      <input type="hidden" name="liveagent.prechat.save:subject" value="LiveChatTranscript, LiveChatTranscript.subject__c" /> 
      <input type="submit" value="Request Chat" id="prechat_submit"/> 
<style type="text/css"> 
p {font-weight: bolder } 
</style> 
</form> 
</apex:page>

 

Hi - I want to dynamically update a record when a user clicks a checkbox on my vf page, but I cannot figure out how to pass the record id of the row that is clicked to the Controller.

 

 

 

 

 

  • April 17, 2012
  • Like
  • 0

I have a Unit Test class that I am using to test 12 triggers.  I've noticed at the bottom of the debug log that I have used 93 of the 100 SOQL queries I'm allowed to use for a test pass.  Is there a way to split out the testing so that I don't run into this limit as I continue to develop in this environment and need to unit test my new code?  If I split the tests into seperate classes will that change the way the limits are evaluated when I run "all tests"?  My concern is that I'm going to add code and try to deploy it and even though it's test covered I'll hit this query limit.  Thoughts?

I have a visual force page that was created in Summer 10 in my FCS to update cases.

 

The page allowed the user to change the case status and also create an entry into a customer object and create a case comment all from the same page.

 

It was working perfect in until today.  the only change was my Sandbox was updated to Spring 10.

 

Now whenever I try to update the case from the Visual Force Page I get the following error:

 

System.DmlException: Update failed. First exception on row 0 with id 50030000005o8ETAAY; first error: FIELD_INTEGRITY_EXCEPTION, No selected contact: [ContactId]

 

If I edit the case from GUI I do not get the error.  If I select a contact (Which is not a required field) and then execute the visual force page ot works fine.

 

What has chnaged in Spring 10 that is causing this to happen.

 

Any help is apprciated.

 

 

Here is the page:

 

 

<apex:page Controller="newEnhancemnetController" tabStyle="Case" id="thePage"> <script> function confirmCancel() { var isCancel = confirm("Are you sure you wish to cancel?"); if (isCancel) return true; return false; } </script> <apex:sectionHeader title="New Enhancemnet Approval" subtitle="for change board Case"/> <apex:form > <apex:pageBlock mode="edit"> <apex:pageMessages ></apex:pageMessages> <apex:pageBlockButtons > <apex:commandButton action="{!Save}" value="Save"/> <apex:commandButton action="{!Cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Change Current Case Status" columns="1"> <apex:outputField value="{!Case.id}"/> <apex:outputField value="{!Case.subject}"/> <apex:outputField value="{!Case.description}"/> <apex:pageBlockSectionItem > <apex:outputLabel value="{!$ObjectType.Case.fields.Status.label}" for="casestatus" style="font-weight:bold"/> <apex:outputPanel styleClass="requiredInput" layout="block"> <apex:outputPanel styleClass="requiredBlock" layout="block"/> <apex:selectList value="{!casestatus}" id="casestatus" size="1" title="Status" required="true"> <apex:selectOptions value="{!items}"/> </apex:selectList> </apex:outputPanel> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Add Enhancement Approval Information" columns="2"> <apex:inputField id="eaAprovedFor" value="{!EnhancementApproval.Approved_For__c}" required="true"/> <apex:inputField id="eaEnvironment" value="{!EnhancementApproval.Environment__c}" required="true"/> <apex:inputField id="eaValidFrom" value="{!EnhancementApproval.Valid_From__c}" required="true"/> <apex:inputField id="eaOtherQCS" value="{!EnhancementApproval.Other_QCS__c}" required="False"/> <apex:inputField id="eaValidTo" value="{!EnhancementApproval.Valid_To__c}" required="true"/> </apex:pageBlockSection> <apex:pageBlockSection title="Add a Case Comment"> <apex:inputField id="caseComment" value="{!CaseComment.CommentBody}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 Here is the controller:

 

 

public class newEnhancemnetController { String casestatus; Case oCase; Enhancement_Approval__c oEnahncemnetApproval; Contact contact; CaseComment casecomment; Map<String,String> mCaseStatus = new Map<String,String>(); public Case getCase() { oCase = [select id, subject, status, description from Case where id = :ApexPages.currentPage().getParameters().get('id')]; if(oCase== null) oCase= new Case(); return oCase; } public Contact getContact() { if(contact== null) contact= new Contact(); return contact; } public String getCaseStatus() { if(casestatus==null){casestatus=oCase.Status;} return casestatus ; } public void setCaseStatus(String casestatus ) { this.casestatus = casestatus ; } public List<SelectOption> getItems() { mCaseStatus.Put('New','New'); mCaseStatus.Put('Approved for Analysis & Design','Approved for Analysis & Design'); mCaseStatus.Put('Reqmts/A&D In Progress','Reqmts/A&D In Progress'); mCaseStatus.Put('Reqmts/A&D Completed','Reqmts/A&D Completed'); mCaseStatus.Put('Approved for Sandbox Build/Config/Test','Approved for Sandbox Build/Config/Test'); mCaseStatus.Put('Sandbox Build In Progress','Sandbox Build In Progress'); mCaseStatus.Put('Sandbox Testing Failed','Sandbox Testing Failed'); mCaseStatus.Put('Sandbox Testing Passed','Sandbox Testing Passed'); mCaseStatus.Put('Waiting for Production Release Date','Waiting for Production Release Date'); mCaseStatus.Put('Release Date Assigned/Approved for Prod','Release Date Assigned/Approved for Prod'); mCaseStatus.Put('Production Testing Failed','Production Testing Failed'); mCaseStatus.Put('Production Testing Passed','Production Testing Passed'); mCaseStatus.Put('On Hold / No Activity','On Hold / No Activity'); mCaseStatus.Put('On Hold / Lack of Funding','On Hold / Lack of Funding'); //mCaseStatus.Put('',''); List<SelectOption> options = new List<SelectOption>(); Schema.DescribeFieldResult fieldResult = Schema.sObjectType.Case.Fields.Status; fieldResult = fieldResult.getSObjectField().getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); for( Schema.PicklistEntry f : ple) { if (mCaseStatus.containskey(f.getValue())) options.add(new SelectOption(f.getLabel(), f.getValue())); //options.add(new SelectOption(f.getLabel(), f.getValue())); } return options; } //public List<SelectOption> getItems() { // List<SelectOption> options = new List<SelectOption>(); // for (CaseStatus cs : [Select MasterLabel from CaseStatus order by sortorder]){ // options.add(new SelectOption(cs.MasterLabel,cs.MasterLabel)); // } // return options; //} public CaseComment getCaseComment () { if(casecomment== null) casecomment= new CaseComment(); return casecomment; } public Enhancement_Approval__c getEnhancementApproval() { if(oEnahncemnetApproval== null) oEnahncemnetApproval= new Enhancement_Approval__c(); return oEnahncemnetApproval; } public PageReference cancel() { PageReference casePage = new ApexPages.StandardController(oCase).view(); casePage .setRedirect(true); return casePage ; } public PageReference Save() { if (oEnahncemnetApproval.Environment__c == 'QCS - Other' && oEnahncemnetApproval.Other_QCS__c ==Null ){ ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Other QCS is Required when Environment is equal to "QCS - Other"'); ApexPages.addMessage(myMsg); return null; } oCase.Status=this.casestatus; update oCase; Enhancement_Approval__c oEA; oEA = new Enhancement_Approval__c(); oEA.Approved_For__c = oEnahncemnetApproval.Approved_For__c; oEA.Case__c = ApexPages.currentPage().getParameters().get('id'); oEA.Environment__c = oEnahncemnetApproval.Environment__c; oEA.Valid_From__c = oEnahncemnetApproval.Valid_From__c; oEA.Valid_To__c = oEnahncemnetApproval.Valid_To__c; oEA.Other_QCS__c = oEnahncemnetApproval.Other_QCS__c; insert oEA; if (casecomment.CommentBody != null){ casecomment.ParentId = ApexPages.currentPage().getParameters().get('id'); insert casecomment; } PageReference casePage = new ApexPages.StandardController(oCase).view(); casePage.setRedirect(true); return casePage ; } //*************************************************************************** //** Test Method //** //*************************************************************************** public static testMethod void testChangeBoardApproval() { pageReference p = Page.ChangeBoardApproval; p.getParameters().put('id', [select id from Case limit 1].id); test.setCurrentPage(p); newEnhancemnetController enhancmenetController = new newEnhancemnetController(); //enhancemnetController.cancel(); enhancmenetController.getCase(); enhancmenetController.getitems(); enhancmenetController.getcasestatus(); enhancmenetController.getEnhancementApproval(); enhancmenetController.getContact(); enhancmenetController.getCaseComment(); enhancmenetController.save(); } }

 

 

 

 

 

  • January 25, 2010
  • Like
  • 0

The Case's related object EmailMessage gets Insert and Delete triggers but not any Update triggers. So I can't do anything useful when users read or reply to an email (and the Status changes from New to Read or Replied).

 

Any explanations from SF as to why they haven't given us access to an Update trigger on this object? Is it an oversight or bug?

 

Can anyone think of any sort of workaround (I can't)?

 

regards.

Send an Email can be overridden from Admin>App Setup>Activities>Activity Buttons with an s-control. This overrides the Send an Email button as well as the Reply and Reply To All links on the email related list. Does anyone know how to identify within the overriding s-control which email/activity was clicked when a reply link is clicked. There doesn't seem to be any relevant merge fields but I assume, seeing as the email related list reply links are overridden, that there must be a way to identify which item in the list was actually clicked.

 

Any ideas?

  • December 10, 2009
  • Like
  • 0
I just wrote a new trigger in a sandbox environment and when I try to deploy it to production I get an UNKNOWN_EXCEPTION error with a long error code that it tells me to pass on my support rep.  I get this error if I deploy via Eclipse or using ANT.  I have  go-live on Tuesday and this would be a major setback if I can't get this trigger into production by then.  The strange thing is that I deployed a trigger two days ago without any issues.  I have the required test coverage.  I believe the issue is between Winter '09 in the Sandbox environment and Summer '08 in Production.  Is there an update that I need to download for Winter '09?  Any help on this would be greatly appreciated.

Joe
After the sandbox was updated to Winter '09 on September 19, the Summer '08 Force.com IDE has been unusable for me for Apex code development on both a Linux with Eclipse 3.2 and MacOS X with Eclipse 3.3.

Effectively, any change to a source file, including trivial changes, say to a comment, results in "Save error: invalid server id"

Tests do not run at all - no output in the Errors or Apex Test Code Runner tabs of the IDE.

Code may be edited in the Salesforce web app, and tests run there, but not being able to use the IDE makes deployment considerably less convenient.

I realise that there are some known issues surrounding this, but how widespread is the problem? I haven't found mention of it here on the boards, so I'm wondering if the bug is specific to only some orgs (which raises the question of why). Also, with the IDE going GA in a week, is there a release candidate of the IDE that addresses these issues?

Just hoping to learn more about the nature of this problem...

--Kevin