• rtrevo915
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I created a custom button on a custom object and onclick, it should update the status to 'Completed' and the Completed date to NOW().  I tested it in Sandbox and it worked properly, I updated the field id's to Production and it worked the day I deployed it.  However it has not worked since I initially deployed it. 

Here are the details:

Detail Page Button

Behavior: Display in existing Window without Sidebar or Header
Content Source: URL

/{Setup_Request__c.Id}/e?retURL={Setup_Request__c.Id}&00N70000002jHJ9={!NOW()}&00N70000002jHKl=Completed&save=1

Link Encoding: Unicode (UTF-8)

The only other thing I've found online suggested changing the &save=1 to &save=0, but neither option has worked for me.

 

Then based on feedback I received in the Answers Community, I tried modifiying the code to some javascript so it would envoke onclick.  Every time I click on the button, I receive an error message saying 'Object Expected'.  Here is the code I'm using:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}

var sr = new sforce.SObject("Setup_Request__c");
sr.id = "{!Setup_Request__c.Id}";
sr.Status__c = 'Completed';
sr.Completed_Date__c = new Date();
result = sforce.connection.update([sr]);

window.location.reload();

 

Any help is greatly appreciated.

I'm attempting to write a Validation Rule that will require a value in my Call Resolution Field when the user Resolves the Case, but allows them to leave the field blank when the case is in any other status.  Here is what I've tried so far:

 

AND
(OR(ISPICKVAL(Status ,"Resolved"),
ISPICKVAL(Status ,"Closed")),


NOT(ISPICKVAL(ACTS_CALL_RESOLUTION__c, "")),


OR( $RecordType.Name='Level_1_Rep_Layout',
$RecordType.Name='Level_2_Rep', 
$RecordType.Name='Team_Leads', )
)

 

I've also tried pulling the NOT statement out, but either way I can Resolve a case without the field being populated.

 

Any help is greatly appreciated.

 

Thanks,

 

Ryan

This is my first development project and I'm trying to run a query that finds and passes through the Case ID.  I know it's finding the Case ID because when the page initially loads it brings in the the Case ID and all !relatedcase fields, however on save, those !relatedcase fields become blank.  Here is where I believe the issue is in the controller:

 

public Log_a_Call_Controller_Extension_Create(ApexPages.StandardController stdController) { this.log_call = (Case_Call_Log__c)stdController.getRecord(); Map<string, string> query_parameters = ApexPages.currentPage().getParameters(); // find this querystring key / value: CF00NS0000000eZs4_lkid=500S00000014ccK for(String key : query_parameters.keySet()) { if (key.contains('_lkid')) { this.case_id = query_parameters.get(key); } } this.current_case = [select c.Id, c.MERCHANT_NO__c, c.Product_Device_Type__c, c.PSG_Campaign_Name__c, c.PSG_Account_Phone__c, c.PSG_Processor__c, c.POS_Creation_Date__c, c.CaseNumber from Case c where c.Id = :case_id]; }

 

 

 

Here is the Page Markup for those fields:

 

<apex:page standardController="Case_Call_Log__c" extensions="Log_a_Call_Controller_Extension_Create" showHeader="true" tabStyle="Case_Call_Log__c" title="Log a Call" > <apex:form > <apex:pageBlock title="Log a Call"> <apex:pageBlockButtons > <apex:commandButton action="{!Save}" value="Save"/> <apex:commandButton action="{!Cancel}" value="Cancel"/> </apex:pageBlockButtons> <apex:pageBlockSection collapsible="true" columns="2" title="Case Details"> <apex:PageBlockSectionItem > <apex:outputLabel value="SE Number"></apex:outputLabel> <apex:outputText value="{0}"> <apex:param value="{!relatedcase.MERCHANT_NO__c}"/> </apex:outputText> </apex:pageBlockSectionItem> <apex:pageblockSectionItem > <apex:outputLabel value="Case Number"></apex:outputLabel> <apex:outputLink value="/{!relatedCase.CaseNumber}" >{!relatedCase.CaseNumber}</apex:outputLink> </apex:pageblockSectionItem> <apex:PageBlockSectionItem > <apex:outputLabel value="Campaign Name"></apex:outputLabel> <apex:outputText value="{0}"> <apex:param value="{!relatedcase.PSG_Campaign_Name__c}"/> </apex:outputText> </apex:pageBlockSectionItem> <apex:PageBlockSectionItem > <apex:outputLabel value="Campaign Product"></apex:outputLabel> <apex:inputField value="{!Case_Call_Log__c.Campaign_Product__c}"></apex:inputField> </apex:pageBlockSectionItem> <apex:PageBlockSectionItem > <apex:outputLabel value="Current Product"></apex:outputLabel> <apex:outputText value="{0}"> <apex:param value="{!relatedcase.Product_Device_Type__c}"/> </apex:outputText> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Processor"></apex:outputLabel> <apex:outputText value="{0}"> <apex:param value="{!relatedcase.PSG_Processor__c}"/> </apex:outputText> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="POS Creation Date"></apex:outputLabel> <apex:outputText value="{0}"> <apex:param value="{!relatedcase.POS_Creation_Date__c}"/> </apex:outputText> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection collapsible="true" columns="2" title="Contact Details"> <apex:PageBlockSectionItem > <apex:outputLabel value="Contact Method"></apex:outputLabel> <apex:inputField value="{!Case_Call_Log__c.Contact_Method__c}"></apex:inputField> </apex:pageBlockSectionItem> <apex:pageblockSectionItem > <apex:outputLabel value="Contact Phone"></apex:outputLabel> <apex:outputText value="{0}"> <apex:param value="{!relatedcase.PSG_Account_Phone__c}"/> </apex:outputText> </apex:pageBlockSectionItem>

 

 

  

Any suggestions on how to rectify the issue are greatly appreciated.

 

Thank you in advance.

 

Ryan

I created a custom button on a custom object and onclick, it should update the status to 'Completed' and the Completed date to NOW().  I tested it in Sandbox and it worked properly, I updated the field id's to Production and it worked the day I deployed it.  However it has not worked since I initially deployed it. 

Here are the details:

Detail Page Button

Behavior: Display in existing Window without Sidebar or Header
Content Source: URL

/{Setup_Request__c.Id}/e?retURL={Setup_Request__c.Id}&00N70000002jHJ9={!NOW()}&00N70000002jHKl=Completed&save=1

Link Encoding: Unicode (UTF-8)

The only other thing I've found online suggested changing the &save=1 to &save=0, but neither option has worked for me.

 

Then based on feedback I received in the Answers Community, I tried modifiying the code to some javascript so it would envoke onclick.  Every time I click on the button, I receive an error message saying 'Object Expected'.  Here is the code I'm using:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}

var sr = new sforce.SObject("Setup_Request__c");
sr.id = "{!Setup_Request__c.Id}";
sr.Status__c = 'Completed';
sr.Completed_Date__c = new Date();
result = sforce.connection.update([sr]);

window.location.reload();

 

Any help is greatly appreciated.