• FrankJSalinas
  • NEWBIE
  • 0 Points
  • Member since 2013
  • Medtronic

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

To jump right to the question, I have a test class that works great in our Sandbox. It uses a custom Data Factory class that creates all the data it needs. It simulates loading status updates to a load object called Loader_GE_Status_Update__c which then updates various opportunities based on rules. I create the Load data, insert it, then query the opportunity to verfy the rules updated it correctly. Like I said, it works great in the Sandbox. But trying to move it to production, the opportunity query always fails for "zero rows found". Based on googling this, I saw a post that said that queries against data in production and sandboxes work differently. I would find that hard to believe, but does anyone know if it is different?
Here's some more information on what I'm doing:
I created a data factory class to create test data for my test methods. It's called TestDataFactory.  I created a Test Trigger class for an object called Loader_GE_Status_Update__c. This object is a loader for new statuses to opportunities.  The Test Trigger needs a few Accounts and Opportunities created before I use the trigger, then it inserts a load of Status updates through the Loader_GE_Status_Update__c object. The load object has rules that determine what Opportunity fields get updated. My test is to verify that the opportunity. After the insert, I check if the opportunity to see if it got updated corrected. I do that by querying the opportunity to see if the update happened. In EQA, this test class works great. I see the field was updated. But in Production, it fails validation because the query always returns no rows. A co-worker says that googling shows that Production test methods behave differently in Production than they do in Sandboxes. Is that what is going on?  I can't think of any other reason this is failing in production

    static testMethod void myUnitTestCancelled() {
        // TO DO: implement unit test
        system.debug('myUnitTestCancelled being executed');
        List<String> visitNumbers = new List<String>();
        List<String> encounterNumbers = new List<String>();
        List<Opportunity> myOpps = testDataFactory.dfacCreateOpportunityVisitsWithAccounts (5, 
               'SHIP', 'Customer', 'New', 500000, 700000);
        //capture the Visits and Encounters to create a Load list       
        for ( Opportunity myOpps1: myOpps ) {
         visitNumbers.add(myOpps1.VisitNumber__c);
         encounterNumbers.add(myOpps1.Encounter_Number__c);
        }
        system.debug('myUnitTestCancelled visitNumbers.size()'+visitNumbers.size());
        //Create the Load from GE
        List<Loader_GE_Status_Update__c> loadCxd = testDataFactory.dfacCreateGEStatusLoad(5, 'CANCELLED', 
            'DUPLICATE ORDER', visitNumbers, encounterNumbers);
        test.startTest();
        insert loadCxd; <-- Here's the INSERT - based on rules, it should update the opportunity fields with new statuses
        test.stopTest();
        Opportunity opp = [Select VisitStatus__c From Opportunity Where VisitNumber__c in :visitNumbers LIMIT 1]; <-- This is always zero in production
        system.assertEquals( opp.VisitStatus__c, 'CANCELED' );
        
    }

This is the error (happens only in production):
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.TestLoader_GE_Status_Update_AfterInsert.myUnitTestCancelled: line 44, column 1
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.TestLoader_GE_Status_Update_AfterInsert.myUnitTestDealerShipped: line 100, column 1

    
Can someone give me insight as to why there is a difference between Sandbox and production.
Thanks!
We have an urgent situation at work where we need to replace our existing WebMethods adapter that uses Salesforce "Replication API".  The Replication API is unstable (per Salesforce) and Salesforce suggested we use the Streaming API instead. This WebMethods Adapter polls the Replication API and is supposed to return only new changes since the last time it was polled (every 5 minutes). However, the "last" Polling datetime gets stuck up to 48 hours behind - this causes an excessive amount of records to be sent to the 3rd party webservice. Instead of sending only the last 5 minutes of changes (10 to 50 records) it is sending thousands of records for the last two days
Streaming API uses Push Topics to send notifications of new records and updates. 

Our Development team is leery of using another Salesforce API because of the bad experience we had with the Replication API. The other option for us is to use a Webservice that SOQL polls the Objects we need and sends it to another external Webservice. Can anyone share their experience with the Streaming API to know if it is stable?

I have to make a recommendation to the team this week. Anything you can share would be appreciated. 
We want to create a Apex Webservice that receives a set of training records for customers from an external system. Our security group want to ensure that only an authorized external system can access the webservice. The external system will use .NET or Java call the webservice.  What is the best security method to ensure to that only external systems that are authorized can send data to the Salesforce webservice? 

I'm having a problem with a Visualforce page that operates in the Service Cloud Console that has a phone field that needs to be made "Click-to-Dial". We have successfully done other visualforce pages with Click-to-Dial capability, but this particular page complains "sforce.console.cti is null or not an object". For those not familiar with how to add Click-to-Dial, you just need to add a javascript file named "/support/console/26.0/integration.js"  That scripts creates the sforce.console component. However, it appears the IncludeScript is not including the javascript "/support/console/26.0/integration.js" because the error says "sforce.console.cti is null or not an object".

Other people have similar post that say it is the order that the ajax and integration scripts are being declared (ajax must be first in IE8), but that hasn't fixed this problem.

The only other thing is that I thought might be happening is that this page is placed in the top window of the service console (replacing the standard Salesforce Highlight Panel). The other VF page that works is in the main frame. Could it be a visibility issue with that top position?

Any help would be greatly appreciated!

<apex:page controller="CtlrAccountHighlight" standardstylesheets="false">      
    <script src="/soap/ajax/11.1/connection.js"></script>
    <apex:includeScript value="/support/console/26.0/integration.js"/>
    <script type="text/javascript">
        function sendCTI(phone) {
            sforce.console.cti.sendCTIMessage('http://localhost:7332/CLICK_TO_DIAL?DN='+encodeURIComponent(JSENCODE('818-576-4897'))+'&ID=001c00000086jJu&ENTITY_NAME=ACCOUNT');
        }

 

Hi,

 

We use a Custom Interaction Log (CIL) instead of the Standard Interaction Log (SIL) in our Service Console Cloud app. It is nicely integrated except for one irratating detail: When an edit is made in the CIL and the user tries to close the Enclosing Tab, the Service Console correctly recognizes an edit has been made and prompts for a save, but when you click save, it hangs because it doesn't know how to clear the edit in th CIL (that's my guess). The Save progress bar just stays up there and never finishes, so you have to close out the page. To me as a Developer, I think the problem has to be that Console doesn't know how to  clear that edit. I've searched the forums and no one seems to know how to correct this. Salesforce documentation says that "Custom Console Componets like ...., Visualforce pages... can be be fully integrated...in the Service Console"  Has anyone been able to implement a Custom Interaction Log Visualforce page (or any VF page) that can be saved when closing unprompted changes?

 

Thanks in advance for your input!

Frank 


To jump right to the question, I have a test class that works great in our Sandbox. It uses a custom Data Factory class that creates all the data it needs. It simulates loading status updates to a load object called Loader_GE_Status_Update__c which then updates various opportunities based on rules. I create the Load data, insert it, then query the opportunity to verfy the rules updated it correctly. Like I said, it works great in the Sandbox. But trying to move it to production, the opportunity query always fails for "zero rows found". Based on googling this, I saw a post that said that queries against data in production and sandboxes work differently. I would find that hard to believe, but does anyone know if it is different?
Here's some more information on what I'm doing:
I created a data factory class to create test data for my test methods. It's called TestDataFactory.  I created a Test Trigger class for an object called Loader_GE_Status_Update__c. This object is a loader for new statuses to opportunities.  The Test Trigger needs a few Accounts and Opportunities created before I use the trigger, then it inserts a load of Status updates through the Loader_GE_Status_Update__c object. The load object has rules that determine what Opportunity fields get updated. My test is to verify that the opportunity. After the insert, I check if the opportunity to see if it got updated corrected. I do that by querying the opportunity to see if the update happened. In EQA, this test class works great. I see the field was updated. But in Production, it fails validation because the query always returns no rows. A co-worker says that googling shows that Production test methods behave differently in Production than they do in Sandboxes. Is that what is going on?  I can't think of any other reason this is failing in production

    static testMethod void myUnitTestCancelled() {
        // TO DO: implement unit test
        system.debug('myUnitTestCancelled being executed');
        List<String> visitNumbers = new List<String>();
        List<String> encounterNumbers = new List<String>();
        List<Opportunity> myOpps = testDataFactory.dfacCreateOpportunityVisitsWithAccounts (5, 
               'SHIP', 'Customer', 'New', 500000, 700000);
        //capture the Visits and Encounters to create a Load list       
        for ( Opportunity myOpps1: myOpps ) {
         visitNumbers.add(myOpps1.VisitNumber__c);
         encounterNumbers.add(myOpps1.Encounter_Number__c);
        }
        system.debug('myUnitTestCancelled visitNumbers.size()'+visitNumbers.size());
        //Create the Load from GE
        List<Loader_GE_Status_Update__c> loadCxd = testDataFactory.dfacCreateGEStatusLoad(5, 'CANCELLED', 
            'DUPLICATE ORDER', visitNumbers, encounterNumbers);
        test.startTest();
        insert loadCxd; <-- Here's the INSERT - based on rules, it should update the opportunity fields with new statuses
        test.stopTest();
        Opportunity opp = [Select VisitStatus__c From Opportunity Where VisitNumber__c in :visitNumbers LIMIT 1]; <-- This is always zero in production
        system.assertEquals( opp.VisitStatus__c, 'CANCELED' );
        
    }

This is the error (happens only in production):
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.TestLoader_GE_Status_Update_AfterInsert.myUnitTestCancelled: line 44, column 1
System.QueryException: List has no rows for assignment to SObject
Stack Trace: Class.TestLoader_GE_Status_Update_AfterInsert.myUnitTestDealerShipped: line 100, column 1

    
Can someone give me insight as to why there is a difference between Sandbox and production.
Thanks!
We want to create a Apex Webservice that receives a set of training records for customers from an external system. Our security group want to ensure that only an authorized external system can access the webservice. The external system will use .NET or Java call the webservice.  What is the best security method to ensure to that only external systems that are authorized can send data to the Salesforce webservice? 

I am looking for a list of standard messages used by sendCTIMessage in the Service Console. I am interested in all message, but have an urgent need for the message to transfer a call.

 

Thank you!

  • December 13, 2012
  • Like
  • 0

Hi,

Am unable to refresh any of the resources in the IDE from the server.

When am trying to refresh a page from the web, getting an Exception saying:

 

 

Unable to refresh resource 'MileaeExension.cls':
com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Unable to refresh resource 'MileaeExension.cls':


com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Please assist to rectify the issue. 

 

Thanks in advance,

VNath

For a custom object, is there a built-in action I can specify within a command button to get a "Save & New" button?
 
<apex:commandButton value="Save" action="{!Save}"/>