• Adrian-E
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 40
    Questions
  • 34
    Replies
I would like to know when Inline editing will be available for Visualforce pages

Anyone know how I can create a formula that will return True if a given case has child cases and False if not?

Thanks! 

I was wondering how you can create several Visualforce Page Layouts and then customize it so that certain users see page X while others see page Y when they click on CREATE, or EDIT or any of the other buttons which can be overridden to show VF page layouts.

Thanks

I am getting the following error on a custom Visualforce page:

Type is not visible: test

 

Vforce Page:

<apex:page controller="EditCases" tabstyle="Case"> <apex:sectionHeader title="Edit Cases" subtitle="Bug Meeting Mass Update" /> <apex:form > <apex:pageBlock mode="edit" title="Mass Update Cases"> <p><apex:outputText value="{!headerMessage}" /></p> <h3>Report Criteria: </h3> <p></p> <table style="width: 100%"> <tr> <td rowspan="3" width="50px" height="50px"><img src="https://ssl.salesforce.com/servlet/servlet.ImageServer?id=01500000000crMo&oid=00D00000000hZTB&lastMod=1235399976000"></img></td> <td>Sub Status contains <i>bug</i> </td> </tr> <tr> <td>ETA is <i>NULL</i></td> </tr> <tr> <td>Status is <i>Pending</i> or <i>Suspended</i></td> </tr> </table> <br /> <apex:pageblockSection id="Cases" columns="1" title="Bug Meeting Cases" rendered="{!canEdit}"> <apex:pageblocktable align="center" value="{!Cases}" var="Case" title="Cases" width="100%"> <apex:column headerValue="Case Number" width="10%"><apex:outputLink value="/{!Case.ID}">{!Case.CaseNumber}</apex:outputlink></apex:column> <apex:column headerValue="Account" width="15%"><apex:outputLink value="/{!Case.Account.ID}">{!Case.Account.Name}</apex:outputlink></apex:column> <apex:column headerValue="Bug ID" width="50%"><apex:inputField value="{!Case.Bug_ID__c}" /></apex:column> <apex:column headerValue="Subject" width="50%"><apex:inputField value="{!Case.Subject}"/></apex:column> <apex:column headerValue="Bug Description" width="50%"><apex:inputField value="{!Case.Bug_Description__c}" /></apex:column> <apex:column headerValue="Summary" width="50%"><apex:inputField value="{!Case.Bug_Meeting_Summary__c}" /></apex:column> <apex:column headerValue="ETA" width="50%"><apex:inputField value="{!Case.ETA_version__c}" /></apex:column> <apex:column headerValue="Assigned To" width="50%"><apex:inputField value="{!Case.Bug_Assigned__c}" /></apex:column> <apex:column headerValue="Status" width="15%"><apex:inputField value="{!Case.Status}"/></apex:column> <apex:column headerValue="Sub Status" width="15%"><apex:inputField value="{!Case.Sub_Condition__c}"/></apex:column> </apex:pageblockTable> </apex:pageblockSection> <p/> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save Cases" rendered="{!canEdit}" /> <apex:commandButton action="{!cancel}" value="Cancel" /> </apex:pageblockButtons> </apex:pageBlock> </apex:form> </apex:page>

 

 

Apex Class+Test:

public class EditCases { List<Case> cases; String headerMessage; Boolean canEdit = true; public EditCases() { cases = getcases();+ headerMessage = getHeaderMessage(); canEdit = getCanEdit(); } public List<Case> getCases() { if (cases == null) { cases = [ select Id, CaseNumber, Priority, Status, Subject, Case.Account.ID,Case.Account.Name,Case.Bug_ID__c,Case.Bug_Description__c,Case.Bug_Meeting_Summary__c,Case.ETA_version__c, CreatedDate,Sub_Condition__c, Bug_Assigned__c from Case where sub_condition__C like '%Bug%' and ETA_version__C = null and (Status = 'Pending' or Status = 'Suspended') order by CaseNumber]; return cases; } else { return cases; } } public String getHeaderMessage() { String message = ''; if (cases.size() == 0) { message = 'There are no cases to edit.'; canEdit = false; } else { canEdit = true; } return message; } public Boolean getCanEdit() { return canEdit; } // Action that is executed if Save button is clicked public PageReference save() { // Return to Cases tab page after editing PageReference returnPage = new PageReference('/500/o'); // Save all changes update cases; return returnPage; } // Action that is executed if Cancel button is clicked. public PageReference cancel() { // Return to Cases tab page after editing PageReference returnPage = new PageReference('/500/o'); return returnPage; } public static testMethod void tesEditCases() { // Create the necessary records to test automatic order creation // Create a case // This assumes that the pick list values used exist for // - Priority (High) // - Status (New) // - Origin (Phone) Case testCase = new Case( Priority = 'High', Subject = 'Test Subject', Status = 'Pending', LPTicket__c = 'LTK12345X', sub_condition__C = 'Bug Meeting', // ETA_version__C = '8.4', // Bug_ID__C = '1234', Origin = 'Phone'); insert testCase; //************************** // Test EditCases controller //************************** PageReference pageRef = Page.EditCases; Test.setCurrentPage(pageRef); // Create an instance of the controller EditCases editCasesController = new EditCases(); // Get the list of cases from the controller List<Case> casesToEdit = editCasesController.getCases(); // Verify that there is at least one case to edit system.assertEquals(casesToEdit.size() > 0, true); // Retrieve the header message String editCasesMessage = editCasesController.getHeaderMessage(); // Verify that the header message is blank system.assertEquals(editCasesMessage, ''); // Check the Cancel action String canceleditCasesPage = editCasesController.cancel().getUrl(); // Check the save action String editCasesPage = editCasesController.save().getUrl(); } }

 

Nothing has changed in my environment or in my apex class and Vforce pages. Any help or suggestions welcome.

We have parent child account relationships. I currently calculate the RMR rollup on child accounts.

I want the parent account to also display of all RMR rollups on child accounts.

 

How can I achieve this?

 

Thanks 

Is there a way to use field dependancies in Visualforce pages or by using Apex code?

Hi,

 

I know I can pass spaces in a URL using %20. I was wondering if it is possible to pass line breaks as well?

 

Any ideas?

 

 

Hi,

 

I have a field called sub status which tracks the different departments who handle cases.

My trigger sums time between each status change in new custom fields on the case object (in hours). My problem is, that if a case is assigned a sub_status of Deployment and then resolve (closed) with the same sub_status, it doest count the time.

 

Can anyone take a quick look and see what I should change? I dont know how make sure that it sums the time between statuses when the case is closed, even if the sub_status didnt change



trigger calculateSubstatusHours on Case (before insert, before update) {
    if (Trigger.isInsert) {
        for (Case updatedCase:System.Trigger.new) {
            updatedCase.Last_Status_Change__c = System.now();
            updatedCase.Time_With_Customer__c = 0;
updatedCase.Time_With_Tier2__c = 0;
updatedCase.Time_With_Deployment__c = 0;
        }
    } else {


        //Get the default business hours (we might need it)
        BusinessHours defaultHours = [select Id from BusinessHours where IsDefault=true];

        //Get the closed statuses (because at the point of this trigger Case.IsClosed won't be set yet)
        Set<String> closedStatusSet = new Set<String>();
        for (CaseStatus status:[Select MasterLabel From CaseStatus where IsClosed=true]) {
            closedStatusSet.add(status.MasterLabel);
        }

        //For any case where the status is changed, recalc the business hours in the buckets
        for (Case updatedCase:System.Trigger.new) {
            Case oldCase = System.Trigger.oldMap.get(updatedCase.Id);

            if (oldCase.Sub_Condition__c!=updatedCase.Sub_Condition__c && updatedCase.Last_Status_Change__c!=null) {
                //OK, the status has changed
                if (!oldCase.IsClosed) {
                    //We only update the buckets for open cases

                    //On the off-chance that the business hours on the case are null, use the default ones instead
                    Id hoursToUse = updatedCase.BusinessHoursId!=null?updatedCase.BusinessHoursId:defaultHours.Id;

                    //The diff method comes back in milliseconds, so we divide by 60000 to get minutes.
                    Double timeSinceLastStatus = BusinessHours.diff(hoursToUse, updatedCase.Last_Status_Change__c, System.now())/3600000.0;
                    System.debug(timeSinceLastStatus);

                    //We decide which bucket to add it to based on whether it was in a stop status before
boolean foundStatus = false;

                    if (oldCase.Sub_Condition__c == 'Customer - Confirmation of Fix' || oldCase.Sub_Condition__c == 'Customer - More Info') 
{
updatedCase.Time_With_Customer__c += timeSinceLastStatus;
foundStatus = true;
                    } 
                    if (oldCase.Sub_Condition__c == 'Deployment') 
{
updatedCase.Time_With_Deployment__c += timeSinceLastStatus;
foundStatus = true;
                    } 
                    if (oldCase.Sub_Condition__c == 'Support - 2nd Tier') 
{
updatedCase.Time_With_Tier2__c += timeSinceLastStatus;
foundStatus = true;
                    } 

                }

                updatedCase.Last_Status_Change__c = System.now();
            }
        }
    }
}

Message Edited by Adrian-E on 03-11-2009 08:58 AM

ii,

I have two Vforce pages.

 

I want to show page X if the case is high priority and show page Y if it is not.

 

How can I do this within Vforce? 

Message Edited by Adrian-E on 03-09-2009 10:48 PM
I have a trigger that reopens a case and copies all info into a new case number. Anyone know how I can copy the comments out of the old case into the new one?
Anyone know how to write an apex trigger that will copy the parent account team details to all child account teams everytime a change is made to the parent?

we have account hierarchies: parent and child accounts.

The parent account has an account team assigned. Can I reference account team members in custom fields on the child levels?

 

If not, is there any way with apex triggers to make sure that the parent team is copie to the child team each time an update is administered? 

I would like to customize the following trigger to PROMPT the user when a duplicate value is found and ask if he wants to continue. If he clicks yes, then it should save the value

 

 

trigger ContactDuplicateTrigger on Contact (before insert) { for (Contact c : Trigger.new){ Contact[] contacts= [select id from Contact where Email = :c.Email]; if (contacts.size() > 0) { c.LastName.addError('Contact cannot be created - Contact already exists'); } }}

 

 

 

Hi,

I was wondering whether there was any attribute for creating inline editable fields.

I am particulalry looking for the same experience as the standard inline editing option in Salesforce = Doubleclicking on the field allows you to edit it.

 

Nothing found in the documentation.

How do I convert these conditions into SWITCH or CASE format:

 

 

 

if (oldCase.Sub_Condition__c == 'Support - 2nd Tier') { updatedCase.Time_With_Tier2__c += timeSinceLastStatus; } else { if (oldCase.Sub_Condition__c == 'Support - 3rd Tier') { updatedCase.Time_With_Tier3__c += timeSinceLastStatus; } else { if (oldCase.Sub_Condition__c == 'Customer - Confirmation of Fix')...

 


 

 

I have a picklist on a parent field with dropdown options from 1 through 50.

 

I want to have a formula on the child account which copies the same selection from the parent.

I have tried combinations of CASE, ISPICKLIST, OR and evrey other option to no avail.

 

Any suggestions? 

We have a custom field called WAITING_FOR on the case level with 4 options:

 

SUPPORT

DEVELOPMENT

PRODUCTION

CUSTOMER 

 

We'd like to populate 4 additional fields on the case level indicating the time spent in each status in days.

 

How can we achieve this with triggers? 

I use account hierarchies and have PARENT accounts which have multiple CHILD accounts.

The PARENT account contains a custom field which is only displayed on the parent level. How can I pull this field into the CHILD accounts to be displayed?

 

Also, is there any way to include this field in any of the reports for CHILD accounts? 

Can I create a validation rule which checks if a value in a picklist object in contains a certain strong?

I have a picklist of the following

 

SMB_Phone

SMB_Email

ENT_Phone

ENT_Email

 

I dont want to reference each value individually - how can I achieve this?

I am importing a visual force project from my sandbox to my production account.
My sandbox package uses custom fields in the test scenario and my production account keeps alerting me that the fields already exist when I try import the package.

I need the custom fields in the test scenarios and I cannot afford to remove the custom fields from the Production account.

What can I do?

Which edition of Salesforce will allow me to edit apex classes in a production account?
Hi All,

I would like display all open cases where priority = "high" on one page with the "subject" field already open for editing.

Can anyone help me by showing me what the custom controller would look like and how the page would be built?

PS: This is more like a report but with the fields all open for editing. I would then make the changes to each field and hit "submit" to post all changes at once

Hi,

 

I am getting " Unable to fetch organization details " error. I have verified the userid, password and security key. I am using the Production/Developer Editiion with a trial account. 

 

My environment is MyEclipse. Could someone give me some pointers to debug and resolve this??

 

Thank You.

Hi,

 

I have a field called sub status which tracks the different departments who handle cases.

My trigger sums time between each status change in new custom fields on the case object (in hours). My problem is, that if a case is assigned a sub_status of Deployment and then resolve (closed) with the same sub_status, it doest count the time.

 

Can anyone take a quick look and see what I should change? I dont know how make sure that it sums the time between statuses when the case is closed, even if the sub_status didnt change



trigger calculateSubstatusHours on Case (before insert, before update) {
    if (Trigger.isInsert) {
        for (Case updatedCase:System.Trigger.new) {
            updatedCase.Last_Status_Change__c = System.now();
            updatedCase.Time_With_Customer__c = 0;
updatedCase.Time_With_Tier2__c = 0;
updatedCase.Time_With_Deployment__c = 0;
        }
    } else {


        //Get the default business hours (we might need it)
        BusinessHours defaultHours = [select Id from BusinessHours where IsDefault=true];

        //Get the closed statuses (because at the point of this trigger Case.IsClosed won't be set yet)
        Set<String> closedStatusSet = new Set<String>();
        for (CaseStatus status:[Select MasterLabel From CaseStatus where IsClosed=true]) {
            closedStatusSet.add(status.MasterLabel);
        }

        //For any case where the status is changed, recalc the business hours in the buckets
        for (Case updatedCase:System.Trigger.new) {
            Case oldCase = System.Trigger.oldMap.get(updatedCase.Id);

            if (oldCase.Sub_Condition__c!=updatedCase.Sub_Condition__c && updatedCase.Last_Status_Change__c!=null) {
                //OK, the status has changed
                if (!oldCase.IsClosed) {
                    //We only update the buckets for open cases

                    //On the off-chance that the business hours on the case are null, use the default ones instead
                    Id hoursToUse = updatedCase.BusinessHoursId!=null?updatedCase.BusinessHoursId:defaultHours.Id;

                    //The diff method comes back in milliseconds, so we divide by 60000 to get minutes.
                    Double timeSinceLastStatus = BusinessHours.diff(hoursToUse, updatedCase.Last_Status_Change__c, System.now())/3600000.0;
                    System.debug(timeSinceLastStatus);

                    //We decide which bucket to add it to based on whether it was in a stop status before
boolean foundStatus = false;

                    if (oldCase.Sub_Condition__c == 'Customer - Confirmation of Fix' || oldCase.Sub_Condition__c == 'Customer - More Info') 
{
updatedCase.Time_With_Customer__c += timeSinceLastStatus;
foundStatus = true;
                    } 
                    if (oldCase.Sub_Condition__c == 'Deployment') 
{
updatedCase.Time_With_Deployment__c += timeSinceLastStatus;
foundStatus = true;
                    } 
                    if (oldCase.Sub_Condition__c == 'Support - 2nd Tier') 
{
updatedCase.Time_With_Tier2__c += timeSinceLastStatus;
foundStatus = true;
                    } 

                }

                updatedCase.Last_Status_Change__c = System.now();
            }
        }
    }
}

Message Edited by Adrian-E on 03-11-2009 08:58 AM

I would like to customize the following trigger to PROMPT the user when a duplicate value is found and ask if he wants to continue. If he clicks yes, then it should save the value

 

 

trigger ContactDuplicateTrigger on Contact (before insert) { for (Contact c : Trigger.new){ Contact[] contacts= [select id from Contact where Email = :c.Email]; if (contacts.size() > 0) { c.LastName.addError('Contact cannot be created - Contact already exists'); } }}

 

 

 

Hi,

I was wondering whether there was any attribute for creating inline editable fields.

I am particulalry looking for the same experience as the standard inline editing option in Salesforce = Doubleclicking on the field allows you to edit it.

 

Nothing found in the documentation.

I have a picklist on a parent field with dropdown options from 1 through 50.

 

I want to have a formula on the child account which copies the same selection from the parent.

I have tried combinations of CASE, ISPICKLIST, OR and evrey other option to no avail.

 

Any suggestions? 

Question: How do I add new fields to the Duplicate Search list for Leads? I have a custom field called "Account ID #" I want to add this field to the default listing within Duplicate Search for Leads. Advise? Thanks.
  • February 17, 2009
  • Like
  • 0

I use account hierarchies and have PARENT accounts which have multiple CHILD accounts.

The PARENT account contains a custom field which is only displayed on the parent level. How can I pull this field into the CHILD accounts to be displayed?

 

Also, is there any way to include this field in any of the reports for CHILD accounts? 

Is it possible to have inline editing with a visualforce page?  I have created tabbed account and tabbed opportunity pages but without being able to edit by double clicking on fields it is almost pointless.  Any ideas on how to get it to work?  Should it work?
  • November 14, 2008
  • Like
  • 0
Hi All,

I would like display all open cases where priority = "high" on one page with the "subject" field already open for editing.

Can anyone help me by showing me what the custom controller would look like and how the page would be built?

PS: This is more like a report but with the fields all open for editing. I would then make the changes to each field and hit "submit" to post all changes at once
I have a parent account which contains a value called TotalFees.
All child accounts of the parent do not contain this field.

I open cases under contacts belonging to the parent account, how can I bring the TotalFees of the parent account into a page within the case? So far I have only managed to bring in the parent account name... but that's all...
I would like to know when Inline editing will be available for Visualforce pages
I am looking for details on variables which can be passed through the Salesforce URL.
For example: Passing isdtp=mn will open the Salesforce page without the sidebar and menu-tabs.
 
Does anyone know where I can find other options? Perhaps opening with a sidebar and no tabs, or tabs with no sidebar etc?
I could not find any answers on Salesforce help forums
Hi,

I have enabled inline editing feature in my SFDC instance which works fine for all the objects. I tried overriding New/Edit button on Opportunity  which calls an  S-Control and takes back to the Opportuinty Layout after  processing. Once the S-Control moves back to the Opportunity, Inline Editing feature gets disabled for that opportunity and it doesnt works.

Should we pass on some hidden parameter to the opportunity page while transfering control to the opportunity which keeps that inline editing feture enabled?

Please suggest..

Thanks in advance.


Message Edited by GreatG on 12-20-2007 03:03 AM
  • December 20, 2007
  • Like
  • 0