• Jake Gharib
  • NEWBIE
  • 20 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
Hi all,

I focus more on the Admin side of things in our environment.  I've been messing around with a task to get an "eye popper" to appear on our Account Page Layout.  The goal is to bring in one field into a VF Page called "Account_Status__c".  This picklist contains the values "Active", "Dormant", "Inactive".  We want to place the VF Page in it's own section of the Account Page Layout.  For each value, we want to display them in large, bold letters with a colored highlight.  See highlights below:
  • Active = Green Highlight
  • Dormant = Yellow Highlight
  • Inactive = Red Highlight
Any advice on where to start or how to get this setup as a VF Page with a Controller would be sincerely appreciated.

Thank you~
Hi all,

we have a VF Page and Apex Class for Inline Edit Table to update each month in a separate column.  We have an Edit, Save and Cancel function for the table itself, however, whenever we update the actual record or refresh the page the values wipe and reset.  Below is the details of the VF Page.  Any recommendations on how to get these values to stick?

<apex:page standardController="Case" extensions="MonthTableExample">
    <apex:form >
        <apex:pageBlock title="Inline Visualforce Page Example">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!edit}" id="editButton" value="Edit"/>
                <apex:commandButton action="{!save}" id="saveButton" value="Save" style="display: none;"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display: none;"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!caseList}" var="month" id="thePageBlockTable">
                <apex:repeat value="{!months}" var="month" >
                    <apex:column >
                        <apex:facet name="header">
                            <apex:outputText value="{!month}"/>
                        </apex:facet>
                        <apex:outputField value="{!caseList[0].Jan__c}" rendered="{!If(month == 'January', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Feb__c}" rendered="{!If(month == 'February', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Mar__c}" rendered="{!If(month == 'March', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Apr__c}" rendered="{!If(month == 'April', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].May__c}" rendered="{!If(month == 'May', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Jun__c}" rendered="{!If(month == 'June', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Jul__c}" rendered="{!If(month == 'July', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Aug__c}" rendered="{!If(month == 'August', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Sep__c}" rendered="{!If(month == 'September', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Oct__c}" rendered="{!If(month == 'October', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Nov__c}" rendered="{!If(month == 'November', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Dec__c}" rendered="{!If(month == 'December', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                    </apex:column>
                </apex:repeat>
            </apex:pageBlockTable>
        </apex:pageBlock>
        
    <!--
<apex:pageBlock id="thePageBlock">
        <apex:pageBlockTable value="{!caseList}" var="month" id="thePageBlockTable">
            <apex:column >
                <apex:outputField value="{!month.Jan__c}" />
                <apex:facet name="January">Name</apex:facet>
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Feb__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Mar__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Apr__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.May__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Jun__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Jul__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Aug__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Sep__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Oct__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Nov__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Dec__c}" />
            </apex:column>
            <apex:inlineEditSupport event="ondblClick" 
              showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
            
           </apex:pageBlockTable>
        </apex:pageBlock> -->

       </apex:form>
</apex:page>
Hi all,

We have a custom button below that changes Ownership and the Status of a Case record if a specific value is placed in one of our Locale fields.  We also have a few Validation Rules in place to make sure Ownership cannot change without details being filled in.  When attempting to change Ownership manually in Salesforce, the Validation Rules fire without issue.  However, when using the JavaScript Button, it's basically ignoring the Rules and changing Ownership anyway.  Does anyone know why this is or what we may be doing wrong?  I've included both the button and our Validation Rules below.  Thank you for any help in advance.

Custom Button:
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}

var query = "select Id, CSM_Locale__c, OwnerId, Status from Case where Id = '{!Case.Id}' limit 1";

var result = sforce.connection.query(query); 
var records = result.getArray("records"); 
        
var caseObj = records[0];

if(caseObj.CSM_Locale__c =="en-US"){
caseObj.OwnerId = '00GL0000003E78X';}
else{
caseObj.OwnerId = '00GL0000003E78d';}
caseObj.Status = "Customer Confirmed / Sent to Supply Chain";
var results = sforce.connection.update([caseObj]);
window.location.href=window.location.href;

Validation Rule 1:

AND(
RecordType.Name = "Customer Supplied Materials",
ISPICKVAL(Status, "New"),
ISCHANGED(OwnerId),
OR(
ISBLANK(AccountId),
ISBLANK(TEXT(Type)),
ISBLANK(TEXT(Supplying__c))
))

Validation Rule 2:

AND(
RecordType.Name = "Customer Supplied Materials",
ISPICKVAL(Status, "New"),
ISCHANGED(OwnerId),
ISPICKVAL(Type, "Stocked"),
OR(
ISBLANK(AccountId),
ISBLANK(Trade_Name_and_Grade_with_Colorant__c),
ISBLANK(Proprietary_Formulation__c),
ISBLANK(Colorant_Part_Number__c),
ISBLANK(Colorant_Description__c),
ISBLANK(Colorant_Mix__c),
ISBLANK(Safety_Stock_in_lbs__c),
ISBLANK(Supplier_Contact__c),
ISBLANK(Supplier_Name__c)
))
Hi All,

I handle more of the Admin side of things at my company so haven't done much coding / development work in my experience.  We have an ask to generate an Opportunity from specific Tasks that are created in our environment.  I've attempted a Process Builder which works just fine once I hit the criteria we need, however, bringing in the Task that started the Opportunity and tying it back to it is the trouble I have.  I was told this could be done with coding and if there's any assistance anyone could provide, it would be greatly appreciated.  Below is the criteria needed...
  • Starting on the Task record - Click custom button "Create RGO"
  • Have it mark the Task as Status "Completed"
  • Create new Opportunity with Stage "Pre-Upload Needs Assessment"
  • Assign the same OwnerId, WhoId, and AccountId on Task to the new Opportunity created
  • Tie back the SAME Task record that started the process and relate it to the created Opportunity
Thank you again for any help in advance.
Hi all,

I'm not as verse in coding/development.  I'm attempting to create a monthly table on a page layout for Cases where the User(s) can input their monthly numbers while viewing the Case record.  I'd like the table to look like something below...

User-added image

Any assistance would be greatly appreciated.

Thank you,
Jake G
Hi all,

I focus more on the Admin side of things in our environment.  I've been messing around with a task to get an "eye popper" to appear on our Account Page Layout.  The goal is to bring in one field into a VF Page called "Account_Status__c".  This picklist contains the values "Active", "Dormant", "Inactive".  We want to place the VF Page in it's own section of the Account Page Layout.  For each value, we want to display them in large, bold letters with a colored highlight.  See highlights below:
  • Active = Green Highlight
  • Dormant = Yellow Highlight
  • Inactive = Red Highlight
Any advice on where to start or how to get this setup as a VF Page with a Controller would be sincerely appreciated.

Thank you~
Hi all,

we have a VF Page and Apex Class for Inline Edit Table to update each month in a separate column.  We have an Edit, Save and Cancel function for the table itself, however, whenever we update the actual record or refresh the page the values wipe and reset.  Below is the details of the VF Page.  Any recommendations on how to get these values to stick?

<apex:page standardController="Case" extensions="MonthTableExample">
    <apex:form >
        <apex:pageBlock title="Inline Visualforce Page Example">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!edit}" id="editButton" value="Edit"/>
                <apex:commandButton action="{!save}" id="saveButton" value="Save" style="display: none;"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display: none;"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!caseList}" var="month" id="thePageBlockTable">
                <apex:repeat value="{!months}" var="month" >
                    <apex:column >
                        <apex:facet name="header">
                            <apex:outputText value="{!month}"/>
                        </apex:facet>
                        <apex:outputField value="{!caseList[0].Jan__c}" rendered="{!If(month == 'January', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Feb__c}" rendered="{!If(month == 'February', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Mar__c}" rendered="{!If(month == 'March', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Apr__c}" rendered="{!If(month == 'April', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].May__c}" rendered="{!If(month == 'May', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Jun__c}" rendered="{!If(month == 'June', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Jul__c}" rendered="{!If(month == 'July', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Aug__c}" rendered="{!If(month == 'August', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Sep__c}" rendered="{!If(month == 'September', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Oct__c}" rendered="{!If(month == 'October', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Nov__c}" rendered="{!If(month == 'November', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                        <apex:outputField value="{!caseList[0].Dec__c}" rendered="{!If(month == 'December', true, false)}">
                            <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
                        </apex:outputField>
                    </apex:column>
                </apex:repeat>
            </apex:pageBlockTable>
        </apex:pageBlock>
        
    <!--
<apex:pageBlock id="thePageBlock">
        <apex:pageBlockTable value="{!caseList}" var="month" id="thePageBlockTable">
            <apex:column >
                <apex:outputField value="{!month.Jan__c}" />
                <apex:facet name="January">Name</apex:facet>
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Feb__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Mar__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Apr__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.May__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Jun__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Jul__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Aug__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Sep__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Oct__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Nov__c}" />
            </apex:column>
            <apex:column >
                <apex:outputField value="{!month.Dec__c}" />
            </apex:column>
            <apex:inlineEditSupport event="ondblClick" 
              showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
            
           </apex:pageBlockTable>
        </apex:pageBlock> -->

       </apex:form>
</apex:page>
Hi all,

We have a custom button below that changes Ownership and the Status of a Case record if a specific value is placed in one of our Locale fields.  We also have a few Validation Rules in place to make sure Ownership cannot change without details being filled in.  When attempting to change Ownership manually in Salesforce, the Validation Rules fire without issue.  However, when using the JavaScript Button, it's basically ignoring the Rules and changing Ownership anyway.  Does anyone know why this is or what we may be doing wrong?  I've included both the button and our Validation Rules below.  Thank you for any help in advance.

Custom Button:
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")}

var query = "select Id, CSM_Locale__c, OwnerId, Status from Case where Id = '{!Case.Id}' limit 1";

var result = sforce.connection.query(query); 
var records = result.getArray("records"); 
        
var caseObj = records[0];

if(caseObj.CSM_Locale__c =="en-US"){
caseObj.OwnerId = '00GL0000003E78X';}
else{
caseObj.OwnerId = '00GL0000003E78d';}
caseObj.Status = "Customer Confirmed / Sent to Supply Chain";
var results = sforce.connection.update([caseObj]);
window.location.href=window.location.href;

Validation Rule 1:

AND(
RecordType.Name = "Customer Supplied Materials",
ISPICKVAL(Status, "New"),
ISCHANGED(OwnerId),
OR(
ISBLANK(AccountId),
ISBLANK(TEXT(Type)),
ISBLANK(TEXT(Supplying__c))
))

Validation Rule 2:

AND(
RecordType.Name = "Customer Supplied Materials",
ISPICKVAL(Status, "New"),
ISCHANGED(OwnerId),
ISPICKVAL(Type, "Stocked"),
OR(
ISBLANK(AccountId),
ISBLANK(Trade_Name_and_Grade_with_Colorant__c),
ISBLANK(Proprietary_Formulation__c),
ISBLANK(Colorant_Part_Number__c),
ISBLANK(Colorant_Description__c),
ISBLANK(Colorant_Mix__c),
ISBLANK(Safety_Stock_in_lbs__c),
ISBLANK(Supplier_Contact__c),
ISBLANK(Supplier_Name__c)
))