• Tory Netherton
  • NEWBIE
  • 0 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am attempting to complete the aforementioned trailhead step on a Windows 10 machine. When I attempt to test the setup via sfdx force:auth:jwt:grant, I get the following error:

This org appears to have a problem with its OAuth configuration. Reason: invalid_grant - user hasn't approved this consumer

When it gives the error, SFDX provides a list of possible issues to check for. I have done so repeatedly. I have gone through the Trailhead step backwards and forwards. Every other part seems to work just fine. This part does not. Unfortuntely the Google results haven't really been all that helpful, so now I turn to you oh great and powerful forum. What do you say?
In get the following message in the inbound change set.  Help me please
nventoryReportTest    TestInventoryReport    System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Container__c]: [Container__c]  Stack Trace: Class.InventoryReportTest.TestInventoryReport: line 20, column 1

My class is:


public with sharing class InventorySearchController { 
public list <Articles_Containers__c> inventoryItem {get;set;} 
public string searchstring {get;set;} 
public InventorySearchController( ) { 

public void search(){ 
string searchquery= 'select Name , Prod__c, UM__c, Container__c, Number__c, On_Hand__c,  Pending__c,  Available__c, Purpose__c, Condition__c, Age__c, Comments__c FROM Articles_Containers__c  WHERE Prod__c like \'%'+searchstring+'%\'  AND On_Hand__c >0  AND IsOpened__c = 1  Limit 50000';
     
      inventoryItem= Database.query(searchquery); 

}
public void clear(){ 
inventoryItem.clear(); 

}

The test class is:

@isTest (SeeAllData=true)
public class InventorySearchTest {
    static testMethod void testMethod1(){
      
          Articles_Containers__c ac = new Articles_Containers__c();
          Product2 p = new Product2(Name ='TestProduct'); 
          Container__c c = new Container__c( Name = 'CMLU', Provenance__c='OTHER', Statut__c='Open');
          ac.Product__c=p.ID;
           ac.Unit_Weight__c = 45; 
           ac.Unit_Cost__c = 87;
            ac.Container__c= c.ID;
             ac.Number__c = 54;
            ac.UM__c ='UNIT(S)';    
           ac.Local_ID__c = 7888;
           ac.Comments__c = 'UNIT(S)';
           ac.Purpose__c='Consignment';
           ac.Condition__c= 'New';
           insert c;
           insert p;
           insert ac;
           
           
           InventorySearchController Inv = new  InventorySearchController();
             Inv.searchstring = 'testFullName';
             Inv.search();
             Inv.clear();
            
        }
}
 
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