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

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

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.

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?
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