• Haystack Certified
  • NEWBIE
  • 85 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 34
    Questions
  • 12
    Replies
Suppose there is a trigger where I don't want exceptions to rollback the entire transaction.  Can savepoints help here?  i don't want to suppress any errors by wrapping a try/catch around everything.  if the trigger gets to a certain point, then the transaction should save regardless of downstream exceptions.
Is there a way for a custom controller to programmatically check if the view state exists?  I am troubleshooting an issue where it seems the view state is missing and the controller's constructor runs again. This occurs intermittently, so I am considering detecting this situation and creating a log entry in my logger table.
I am using the AutomatedTestJobQueuer class mentioned in this article to execute all test classes via apex on a schedule.

http://developer.force.com/cookbook/recipe/automated-unit-test-execution

It uses ApexTestQueueItem object to execute each test class.  I need to write a test class for AutomatedTestJobQueuer, but get this error on Line 63 where it tries to insert the test request:

"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Apex tests cannot be enqueued during a test.: []"

Anyone know of a way to get around this?
Do queued jobs using Queueable class get their own set of govenor limits?  For example, the limit for DMLs is 150.  If a trigger has 10 DMLs, does the queued job still have all 150 DMLs allowed?
I can't seem to get a clear answer to this problem via Google search.  What is the best way to prevent trigger recursion with Data Loader in Bulk mode?  For example, consider needing to load 500,000 records and there is an After trigger updating the same records that caused the trigger to fire.  Any advice?
I would like to know if this is possible with Service Cloud Console.  There would be a case page layout with a sidebar component.  I would like to use the standard page layout for the case detail, but the sidebar would be a VF page for gathering additional information.  The sidebar would be dynamically showing and hiding fields based on selections.  The idea is to isolate custom coding to the sidebar so that the standard page layout could still be used.

The issue I am trying to solve is the communcation between the sidebar and the detail section.  I know how to do this once the case detail record is saved since the record ID becomes available to use in the sidebar.  But, is there a way to use the sidebar on case creation when still in edit mode?

I think there would have to be some kind of direct communication between the components, such as notifying the sidebar of the record ID as the record is being saved.  Or, sending sidebar data back to the detail section so that it gets saved along with the rest of the record.  Or, maybe some other way I am not thinking of.

If this is possible, I would appreciate some pointers on how to get it started.  Thanks.



 
I have some questions on the special SOQL FOR loop using the List version.
//Example
for (Account[] tmp : [SELECT Id FROM Account WHERE Name = 'yyy']) {
  tmp.Type = 'Customer';
  if( tmp.Industry == 'Electronics' ) {
    tmp.Rating = 'High';
  }
}
update tmp;
  1. Does the update to Type (tmp.Type = 'Customer') apply to all the records in the batch?
  2. Does the condition (tmp.Industry == 'Electronics')  get evaluated for individual records in the batch?
  3. Unrelated to the example above, is this a way to handle governor limits when updating numerous child records?  For example, let's say a trigger on Account needs to update related Contact records and each Account has 50 Contacts.  If a single batch update of 200 Accounts occurs, then 10,000 Contact records could be updated without hitting any limits?  It sounds like this would use only one SOQL query and one Update statement to save to the database.
This help page has an example of using a canvas navigation call to start a new record in mobile.

The page is: http://www.salesforce.com/us/developer/docs/platform_connect/Content/canvas_apps_salesforce1_navigation_methods.htm
The example is: var event = {name:"s1.createRecord", payload: {entityName: "Account", recordTypeId: "00h300000001234"}};

Could someone show me what method to use to leverage the "event" variable in the example.  This would be for a VF page embedded as part of a publisher action.  My understanding is that canvas publisher methods can be used without actually creating a full blown canvas app.

Thanks.
I have been using code like this for calling Visual Workflows from a trigger.
 
public static void start(List<Account> TriggerNew) {
        Map<String, Object> myMap = new Map<String, Object>();
        
        for(Account ac: TriggerNew) {
            myMap.put('txtAccountRecordID', String.valueOf(ac.Id));
            Flow.Interview.Set_Account_Zero_Tax_Rate myFlow = new Flow.Interview.Set_Account_Zero_Tax_Rate(myMap);
            myFlow.start();
        }
    }

The issue is that it is not quite bulkified because the flow is being called individually for each record.  Is there a way to send the entire trigger.new list to the flow?
I am using this technique, Creating Visualforce Pages to Use as Custom Actions (https://help.salesforce.com/HTViewHelpDoc?id=creating_vf_pages_for_custom_actions.htm), and would like to automatically select the "Post" publisher action when the user is finished.  Currently, it doesn't move away from the custom action when the user is finished.  Some of out-of-the-box actions, such as "File," automatically redirect to the "Post" action when it's done.
I am using this technique, Visualforce Pages to Use as Custom Actions (https://help.salesforce.com/HTViewHelpDoc?id=creating_vf_pages_for_custom_actions.htm), which includes a canvas API call.  I believe that canvas apps as publisher actions is in pilot, but is using the canvas API using this technique GA?  Thanks.
Is there a way to determine if a user has Live Agent permissions?  I tried {!$User.USERPERMISSIONSLIVEAGENTUSER} which is what Data Loader returned, but it didn't work in the VF page.  Could not find it in the API doc for User either.  Thanks.
I have a question about the order of execution of intertwined triggers.  If a 'before' trigger causes updates to other records, does the second set of records go through the complete life cycle ('before' and 'update' triggers) before returning to the original trigger.  Or, does it just kickoff the second set and return immediately?  Is it undefined and could run in any order?

I have seen the help articles on order of execution, but they don't seem to address the intertwined scenario.

Any insight would be appreciated.

Thanks.
I am trying to use the console integration kit to automatically set the user to online for Live Agent when they start the service cloud console.  Below is my code for a footer component.  It has two ways to set the agent status.  The first is near the bottom of the script where the function to set online is automatically run when the page loads.  The second is a link that the user can click.

There seems to be a timing problem.  The function does run automatically, but it seems to run before the Live Agent component initializes.  I am guessing that my function sets the agent online and then the Live Agent component resets to offline.

I think it is a timing problem because using the link after everything has started does sets the agent online.

Is there an event I can listen for or something else that allows my component to wait until everything is initialized?
<apex:page showHeader="false" sidebar="false">
    <apex:includeScript value="/support/console/29.0/integration.js"/>

    <a href="#" onClick="fnSetAgentState('Online');return false;">Set Agent Status to Online</a> 

    <script type="text/javascript">
        function fnGetAgentState() {
            sforce.console.chat.getAgentState(function(result) {
                if (result.success) {
                    alert('Agent State: ' + result.state);
                } else {
                    alert('getAgentState has failed');
                }
            });
        }
    
        function fnSetAgentState(state) {
            sforce.console.chat.setAgentState(state, function(result) {
                if (result.success) {
                    fnGetAgentState();
                } else {
                    alert('Live Agent: SetAgentState has failed');
                }
            });
        }
        
        fnSetAgentState('Online');
    </script>
</apex:page>


It is possible to get or construct the URL of an image in a Feed Attachment?  I tried using just the record ID, but that calls up the entire Files page.  I need the URL directly of the image.  The app I want to use this with runs inside of Salesforce so I don't think I need to be concerned with authentication.  Thanks.
Can the Session ID that is passed with Workflow Outbound Messaging be used with REST?  Any challenges associated with this?  Thanks.
The Live Agent help for the Deploymnet record says:

"If you’re using security zones in Internet Explorer 8 or 9, be sure your deployment and any website that hosts that deployment are in the same security zone. Due to an issue with Internet Explorer, it’s not possible to launch a chat window from a website that’s in a different security zone. For more information on security zones, refer to Internet Explorer help."

It is saying that the URLs embedded in the Deployment javascript have to be in the same zone as the website itself?  If so, how do I determine what zone each is in?

Thanks.

Am I correct in thinking that there is no specific platform feature that must be used.  It's just that using more of the platform increases our scoring for this criteria?

 

Can we use a custom web address with the new Communities feature?  Here is how it is done with Force.com Sites.

 

http://www.salesforce.com/docs/developer/cookbook/Content/sites_using_custom_domain.htm

 

I was wondering if there was a similar feature for Communities since domain management is done in a similar way.  I can't enable this in a production org just yet to see for myself.

 

Thanks.

Can the Session ID that is passed with Workflow Outbound Messaging be used with REST?  Any challenges associated with this?  Thanks.
The Live Agent help for the Deploymnet record says:

"If you’re using security zones in Internet Explorer 8 or 9, be sure your deployment and any website that hosts that deployment are in the same security zone. Due to an issue with Internet Explorer, it’s not possible to launch a chat window from a website that’s in a different security zone. For more information on security zones, refer to Internet Explorer help."

It is saying that the URLs embedded in the Deployment javascript have to be in the same zone as the website itself?  If so, how do I determine what zone each is in?

Thanks.
Suppose there is a trigger where I don't want exceptions to rollback the entire transaction.  Can savepoints help here?  i don't want to suppress any errors by wrapping a try/catch around everything.  if the trigger gets to a certain point, then the transaction should save regardless of downstream exceptions.
I am using the AutomatedTestJobQueuer class mentioned in this article to execute all test classes via apex on a schedule.

http://developer.force.com/cookbook/recipe/automated-unit-test-execution

It uses ApexTestQueueItem object to execute each test class.  I need to write a test class for AutomatedTestJobQueuer, but get this error on Line 63 where it tries to insert the test request:

"System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Apex tests cannot be enqueued during a test.: []"

Anyone know of a way to get around this?
I have a question about the order of execution of intertwined triggers.  If a 'before' trigger causes updates to other records, does the second set of records go through the complete life cycle ('before' and 'update' triggers) before returning to the original trigger.  Or, does it just kickoff the second set and return immediately?  Is it undefined and could run in any order?

I have seen the help articles on order of execution, but they don't seem to address the intertwined scenario.

Any insight would be appreciated.

Thanks.
I am trying to use the console integration kit to automatically set the user to online for Live Agent when they start the service cloud console.  Below is my code for a footer component.  It has two ways to set the agent status.  The first is near the bottom of the script where the function to set online is automatically run when the page loads.  The second is a link that the user can click.

There seems to be a timing problem.  The function does run automatically, but it seems to run before the Live Agent component initializes.  I am guessing that my function sets the agent online and then the Live Agent component resets to offline.

I think it is a timing problem because using the link after everything has started does sets the agent online.

Is there an event I can listen for or something else that allows my component to wait until everything is initialized?
<apex:page showHeader="false" sidebar="false">
    <apex:includeScript value="/support/console/29.0/integration.js"/>

    <a href="#" onClick="fnSetAgentState('Online');return false;">Set Agent Status to Online</a> 

    <script type="text/javascript">
        function fnGetAgentState() {
            sforce.console.chat.getAgentState(function(result) {
                if (result.success) {
                    alert('Agent State: ' + result.state);
                } else {
                    alert('getAgentState has failed');
                }
            });
        }
    
        function fnSetAgentState(state) {
            sforce.console.chat.setAgentState(state, function(result) {
                if (result.success) {
                    fnGetAgentState();
                } else {
                    alert('Live Agent: SetAgentState has failed');
                }
            });
        }
        
        fnSetAgentState('Online');
    </script>
</apex:page>


It is possible to get or construct the URL of an image in a Feed Attachment?  I tried using just the record ID, but that calls up the entire Files page.  I need the URL directly of the image.  The app I want to use this with runs inside of Salesforce so I don't think I need to be concerned with authentication.  Thanks.
The Live Agent help for the Deploymnet record says:

"If you’re using security zones in Internet Explorer 8 or 9, be sure your deployment and any website that hosts that deployment are in the same security zone. Due to an issue with Internet Explorer, it’s not possible to launch a chat window from a website that’s in a different security zone. For more information on security zones, refer to Internet Explorer help."

It is saying that the URLs embedded in the Deployment javascript have to be in the same zone as the website itself?  If so, how do I determine what zone each is in?

Thanks.

Is it possible to change the size of the LIve Agent chat window when it launches from a chat button?

 

I tried this example, https://dashboard.liveagentforsalesforce.com/support/Customization/how-to/80, but could not get it to work.  If this is the correct solution, could someone post a complete example of the javascript that goes into the website?  It doesn't have to actually work, but I might be missing some kind of syntax.

 

Thanks.

Hi I am stuck in a point which I believe is almost 'the end', but I am not just able to write test class for this.

 

I have a flow, which shows a list of Opportunities, one by one based on score. This flow has been referenced in a VF page:

<apex:page controller="OppPriorityController">
    <h1>Opportunity Prioritisation Wokflow</h1>
  <flow:interview name="Opportunity_Prioritisation_Flow" interview="{!myflow}" buttonLocation="bottom">
  <apex:param name="varCurrentUserID" value="{!$User.Id}"/> 
  </flow:interview>
</apex:page>

 The OppPriorityController is below:

public class OppPriorityController {

    // Need not instantiate explicitly the Flow object using the class constructor 
    
    public Flow.Interview.Opportunity_Prioritisation_Flow myflow { get; set; }
    public String getPhoneNumber() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.PhoneNumber; 
             }
    public String getAccountID() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.AccId;
    }
     public String getAccountName() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.AccountName;
    }
     public String getOpportunityID() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.OppId;
    }
     public String getOpportunityName() {
        // Access flow variables as simple member variables with get/set methods 
             return myflow.OppName;
    }
}

 The test class which I tried is below:

@isTest (SeeAllData=true)
private class OppPriorityControllerTest {
    public static testMethod void myTestMethodForFlow() {
        PageReference pageRef = Page.OppPriorityPage;
        Test.setCurrentPage(pageRef);
        OppPriorityController oppPriorityController = new OppPriorityController();        
        oppPriorityController.myflow = new Flow.Interview.Opportunity_Prioritisation_Flow(new Map<String, Object>());
        String pNumber = oppPriorityController.getPhoneNumber();
        String accountId = oppPriorityController.getAccountID() ;
        String accountName = oppPriorityController.getAccountName();
        String opportunityID = oppPriorityController.getOpportunityID();
        String opportunityName = oppPriorityController.getOpportunityName();
    }
}

 I received an error: Interview not started.

 

Any help here would be grateful. I tried to serach in various places, but none helped me to solve this.

 

 

 

 

I was using Eclipse and downloading the entire org when I received this message:

 

LIMIT EXCEEDED: The retrieved zip file exceeded the limit of 419430400 bytes.

 

I also read somewhere there was also a limit on the number of files or objects or something like that.

 

Where can I find documentation on this type of limit?  I need reference materials for my project documentation as well as workarounds (hopefully).

 

Thanks.

 

Hello everyone,

I will try to be as clear as possible. So here is my problem:

I have created a Custom Console Component and add it into my Service Cloud Console BUT I want this Custom Component to be able to populate the fields in the Account creation form.

This form:

User-added image


So, I would like to know if it is possible to achieve that?

Many thanks in advance.