• Shailendra Singh 69
  • NEWBIE
  • 10 Points
  • Member since 2017

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

I am looking to see the best approach for Salesforce CI. I have gone through many forum and blogs but haven't been able to grasp them. I tried to setup CI for the entire org but facing a lot of challeges which I guess you guys quite aware of.

What I am looking to do incremental deployment based on the git diff, dynamically generate package.xml based on the metadata committed which I think would be manageable something like sfdc-git-package https://www.npmjs.com/package/sfdc-git-package. I am having a hard time implementing this.

Please someone help
On Step 5 of Advanced Apex Specialist (Increase test coverage with unit tests), I am getting the following error when checking the challenge:

Challenge Not yet complete... here's what's wrong: 
Ensure that you create an instance of product2Extension.

Reviewing the logs seems to point to a problem in a different area than testing Product2Extension.

"Assertion Failed: Expected: 10, Actual: 20" - TestDataFactory.VerifyQuantityOrdered line 15

My unit tests that use VerifyQuantityOrdered as requested pass and are working as intended. My debug statements in TestDataFactory for setting up test data and in the unit test in OrderTests are not being logged out in this anonymous block execution, pointing to a direct invocation of TestDataFactory.VerifyQuantityOrdered directly by the Trailhead anonymous Apex, passing two Products and a qtyOrdered value of 20. The first Product passed has a Quanity_Ordered__c value of 0 and the updated product passed has a Quanity_Ordered__c value of 10. Since the qtyOrdered passed is 20, the expectation is:

public static void VerifyQuantityOrdered(Product2 originalProduct, Product2 updatedProduct, Integer qtyOrdered) {
     System.assertEquals(updatedProduct.Quantity_Ordered__c, (originalProduct.Quantity_Ordered__c + qtyOrdered));
}

0 + 20 is not equalling 10 as expected. It seems to me as though the anonymous block in this step is passing the wrong value for updatedProduct.Quantity_Ordered__c.

Any recommendations?
The challenge is to search for the inserted record with an inline SOSL search, using Execute Anonymous.

This is what I did using Execute Anonymous Window
 
List<List<sObject>> searchList = [FIND 'Mission Control' IN ALL FIELDS 
                                  RETURNING Contact(FirstName, LastName,
                                  Phone, Email, Description)];
Contact[] searchContacts = (Contact[])searchList[0];
System.debug('Found the following contacts:');
for (Contact c : searchContacts) {
   System.debug('"'+c.LastName + ', ' + c.FirstName+'"');
}

But still there's an error when I check the challenge.

Challenge Not yet complete... here's what's wrong: 
Could not find the contact's name in the debug log. Be sure to run a query for your record, and to write your contact's name to the debug log using the System.debug() method.
I have successfully set up continuous integration process using TeamCity for non-SalesForce projects, but need help with automating SalesFoce manage packages installation. To migrate metadata from source to target org, I used ant migration tool, but how to do in case of managed packages?
Questions:
  1. How will TeamCity know that the new package has been created? I may watch the changes in source code tool, but not in the cloud where the created package is stored.
  2. How to get the latest version of the package from the cloud? I need to compare the versions of the packages: the installed one and the new one
  3. How to install the package using TeamCity?
Please help.