• Tall 642
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies

We have recently implemented the Salesforce.com Live Agent. The system itself is a little immature and does not allow a lot of avenues to get the data out of it. It does have a "HTTP" post method. We would like to push the chat data into a custom object in salesforce. I am not a developer so I have been struggling to do this. I am not sure of the exact URL that I need to give the Live Agent, but this is the one that I have determined is closest: https://cs4.salesforce.com/services/async/24/a0Q 

 

There is no way for me to currently see why this is failing from the live agent console. If I go directly to the URL I see this error message: 

<error xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<exceptionCode>InvalidSessionId</exceptionCode>
<exceptionMessage>Unable to find session id</exceptionMessage>
</error>

I assume that this is because I have not provided my credentials to the system, but I'm not sure how to do that. 

 

I guess the bottom line question is, does anyone know what I have to do to get the HTTP post from Salesforce live agent to create a custom object record in Salesforce.com?

I am trying to implement entitlements and I have a few chunks of code that I found here on developerforce. The problem is one trigger that I found, I needed to clone it and change it so that it ran after update instead of after insert. I am using both blocks of code. One is 100% covered and the other (the one I changed) is 0% covered. It works perfectly and I would like to push it into our production org, but since it's a trigger I can't deploy it unless it is at least 1% covered. Can anyone help me out here?

 

Original Block of Code:

trigger completeFirstResponseCaseComment on CaseComment (after insert) {
         
        // Cannot be a portal user
        if (UserInfo.getUserType() == 'Standard'){
            DateTime completionDate = System.now();
            List<Id> caseIds = new List<Id>();
            for (CaseComment cc : Trigger.new){
                // Only public comments qualify
                if(cc.IsPublished == true)
                    caseIds.add(cc.ParentId);
            }
            if (caseIds.isEmpty() == false){
                List<Case> caseList = [Select c.Id, c.ContactId, c.Contact.Email,
                                  c.OwnerId, c.Status,
                                  c.EntitlementId, c.SlaStartDate,
                                  c.SlaExitDate
                               From Case c
                               Where c.Id IN :caseIds];
                if (caseList.isEmpty() == false){
                    List<Id> updateCases = new List<Id>();
                    for (Case caseObj:caseList) {
                        // consider an outbound email to the contact on the case a valid first response
                        if ((caseObj.Status != 'Awaiting Customer Reply')&&
                            (caseObj.EntitlementId != null)&&
                            (caseObj.SlaStartDate <= completionDate)&&
                            (caseObj.SlaStartDate != null)&&
                            (caseObj.SlaExitDate == null))
                            updateCases.add(caseObj.Id);
                    }
                    if(updateCases.isEmpty() == false)
                        milestoneUtils.completeMilestone(updateCases, 'First Response', completionDate);
                }
            }
        }
    }

 

 

Here is the code as I have altered it: 

trigger completeFirstResponseCaseCommentUpdateToPublic on CaseComment (after update) {
         
        // Cannot be a portal user
        if (UserInfo.getUserType() == 'Standard'){
            DateTime completionDate = System.now();
            List<Id> caseIds = new List<Id>();
       
            for (CaseComment cc : Trigger.new){
                // Only public comments qualify
               if(cc.IsPublished == true)
                   caseIds.add(cc.ParentId);
            }
            for (CaseComment cc : Trigger.old){
                // Only public comments qualify
                if(cc.IsPublished == true)
                    caseIds.add(cc.ParentId);
            }
            if (caseIds.isEmpty() == false){
                List<Case> caseList = [Select c.Id, c.ContactId, c.Contact.Email,
                                  c.OwnerId, c.Status,
                                  c.EntitlementId, c.SlaStartDate,
                                  c.SlaExitDate
                               From Case c
                               Where c.Id IN :caseIds];
                if (caseList.isEmpty() == false){
                    List<Id> updateCases = new List<Id>();
                    for (Case caseObj:caseList) {
                        // consider an outbound email to the contact on the case a valid first response
                        if ((caseObj.Status != 'Awaiting Customer Reply')&&
                            (caseObj.EntitlementId != null)&&
                            (caseObj.SlaStartDate <= completionDate)&&
                            (caseObj.SlaStartDate != null)&&
                            (caseObj.SlaExitDate == null))
                            updateCases.add(caseObj.Id);
                    }
                    if(updateCases.isEmpty() == false)
                        milestoneUtils.completeMilestone(updateCases, 'First Response', completionDate);
                }
            }
        }
    }

 

I have implemented some code from developerforce to the auto-clomplete milestones, and in doing so I am getting the error in the Subject line. I'm not sure what is going wrong, here are the segments where tests are indicating being broken:

 

  Entitlement entl = [select id from Entitlement limit 1];
        String entlId;
        if (entl != null)
          entlId = entl.Id;

here is the link to the code that I am using. Any help would be appreciated:

 

http://wiki.developerforce.com/index.php/Case_Milestones_Utilities_Class

 

 

Can anyone tell me how I can delete a list view that continues to time out everytime that it is run? I cannot seem to get to it through the UI to be able to click the edit button. Is there any other way?

There is not currently a way to add the auto-responses to the case directly. I was wondering if anyone has done this, or has any idea as to how to do this?

I have implemented some code from developerforce to the auto-clomplete milestones, and in doing so I am getting the error in the Subject line. I'm not sure what is going wrong, here are the segments where tests are indicating being broken:

 

  Entitlement entl = [select id from Entitlement limit 1];
        String entlId;
        if (entl != null)
          entlId = entl.Id;

here is the link to the code that I am using. Any help would be appreciated:

 

http://wiki.developerforce.com/index.php/Case_Milestones_Utilities_Class

 

 

I'm looking for some Sample APEX that would, upon Case creation, do a lookup to the Contacts Account and find the Entitlement Associated to the Account.  In my case, there will only ever be one Entitlement associated to an Account so the results would return one record.  I need this entitlement to be automatically associated to the Case and automatically kick off.  Essentially, when a case is created, I need the entitlement to kick off immediately.  Does anyone have any sample APEX I can look at that might point me in the right direction.

Hi,

 

I want to be able to add followers to an opportunity. Does anyone know how to do this.

 

this use case is that I have an opportunity and that I want to get some other people involved, do get them involved I want to add them on as followers. I want the adding of the users to be driven from the user level

  • June 17, 2010
  • Like
  • 0

I can approve a ProcessInstanceWorkitem using Apex or the API, but I just can't figure out how to write the same code using the Ajax Toolkit in javascript? 

 

I see the Process Request function and the ProcessWorkItemRequest Function in the connection.js file, but not sure how to use it.

 

Below is the code to approve using Apex

//I query for the ProcessInstanceWorkitem associated to the parent object Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest(); req.setComments('Approving request.'); req.setAction('Approve'); req.setNextApproverIds(new Id[] {tumgr.Id}); //Use the ID from the newly created item to specify the item to be worked req.setWorkitemId(ProcessInstanceWorkitem.Id); //pass id queried //Submit the request for approval Approval.ProcessResult result = Approval.process(req); //Verify the results System.assert(result.isSuccess(), 'Result Status:'+result.isSuccess());

 

Any help is greatly apprieciated, thanks.