• Daymon Boswell
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
I've installed this Package from the App Exchange https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FOmqSUAT

And recieve flow errors when testing: FIELD_INTEGRITY_EXCEPTION, Custom Setting Name too long: Opportunity-OwnerId-2020 RR West AM's: Name: [Name]

There is a blurb in the managed package descrtiption about a following quirk: 
"Because of how I'm creating a unique tracker for each setting (using object/field/group) if you have some really long descriptive names it's possible to overflow the allowed length for a custom setting name (40), so that's capped at 40 char. This may result in truncation in the custom settings name.
That doesn't impact the functionality but might make it harder for an admin to look through the custom settings and know which one is which"

I'm not sure what I need to change to get around this, I reached out to Salesforce Support but was told to post here. Hoping someone can help.
Hi everyone, I am not a developer and am running into issues when deploying my Apex Class into Production. When I deploy it says that my Code Coverage is 0%. Hoping someone here can help me.

Here is my Apex Class: 

global class ExternalCalloutHelperV2 { 
    //@future(callout=true)
    public static string post(String endpoint, String jsonBody ) {
        System.debug('ExternalCalloutHelper::post');
        //System.debug('ExternalCalloutHelper::post is disabled in sandbox.');
        //return '';
        HttpRequest req = new HttpRequest();
        //req.setEndpoint(xxx + endpoint);
        req.setEndpoint('xxx'); // FOR TESTING ONLY
        req.setMethod('POST');

        req.setbody(EncodingUtil.urlEncode(jsonBody, 'UTF-8'));
         
        // Specify the required user name and password to access the endpoint
        // As well as the header information
        
        String username = 'voices_api';
        String password = 'voiced_dot_com_api_pass';
        
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'BASIC ' +
        EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        
        // Create a new http object to send the request object
        // A response object is generated as a result of the request  
        Http http = new Http();
        HTTPResponse res = http.send(req);
        return res.getBody();
    }
    
    @future(callout=true)
    public static void postContactToServer(id [] contactIds) {
        for (Integer i = 0; i<contactIds.size(); i++) {
            id contactId = contactIds[i];
        
            Contact contactObj;
            Account accountObj;
            User ownerObj;
            
            Organization organizationObj = [SELECT id, Name FROM Organization];
            contactObj = [SELECT AccountId, Account_Number__c, Fax, Phone, Id, Email, FirstName, Terms_of_Service_Privacy_Policy_Opt_in__c, Marketing_Communications_Opt_in__c,
                          LastName,MailingCity, MailingCountry, MailingState, MailingStreet, MailingPostalCode, OwnerId, Owner_ID__c, Username__c, CAG_Opt_in__c, Beta_Group_Opt_In__c FROM Contact
                          where Contact.Id = :contactId];
            
            try {
                accountObj = [SELECT Fax, Id, Name, AccountNumber, Phone, BillingCity, BillingCountry, Billing_Instructions__c, BillingState, BillingStreet, BillingPostalCode, OwnerId FROM Account
                              Where Account.Id = :contactObj.AccountId];            
            } catch (Exception accountError) {
                // accountObj is null
            }
    
            try {
                ownerObj = [SELECT AccountId,ContactId,Email,FirstName, Name, LastName, Phone, Extension, ProfileId, Title, UserRoleId, Id, Username FROM User
                            Where User.Id = :contactObj.OwnerId];
            } catch (Exception owberError) {
                // ownerObj is null
            }
            
            Map<String, SObject> postMap = new Map<String, SObject>();
            
            postMap.put('organization', organizationObj);
            postMap.put('contact', contactObj);
            postMap.put('account', accountObj);
            postMap.put('owner', ownerObj);
            
            //System.debug(postMap);
            String postBodyJSON = JSON.serialize(postMap);
            ExternalCalloutHelper.post('contact_update', postBodyJSON);
        }
    }
    
     webService static string createWebAccount(Id contactId) {
    Contact contactObj;
        Account accountObj;
        User ownerObj;
        //Contact ownerContactObj;
        
        Organization organizationObj = [SELECT id, Name FROM Organization];
        contactObj = [SELECT Pending_Server_Update__c, AccountId, Account_Number__c, Fax, Phone, Id, Email, FirstName, Terms_of_Service_Privacy_Policy_Opt_in__c, Marketing_Communications_Opt_in__c,
                          LastName,MailingCity, MailingCountry, MailingState, MailingStreet, MailingPostalCode, OwnerId, Owner_ID__c, Username__c, CAG_Opt_in__c, Beta_Group_Opt_In__c FROM Contact
                      where Contact.Id = :contactId];
        
        try {
      accountObj = [SELECT Fax, Id, Name, AccountNumber, Phone, BillingCity, BillingCountry, Billing_Instructions__c, BillingState, BillingStreet, BillingPostalCode, OwnerId FROM Account
                          Where Account.Id = :contactObj.AccountId];            
        } catch (Exception accountError) {
            // accountObj is null
        }

        try {
          ownerObj = [SELECT AccountId,ContactId,Email,FirstName, Name, LastName, Title, Phone, Extension, ProfileId, UserRoleId, Id, Username FROM User
                        Where User.Id = :contactObj.OwnerId];
        } catch (Exception owberError) {
            // ownerObj is null
        }
        
         
             
        Map<String, SObject> postMap = new Map<String, SObject>();
        
        postMap.put('organization', organizationObj);
        postMap.put('contact', contactObj);
        postMap.put('account', accountObj);
        postMap.put('owner', ownerObj);
         
        //System.debug(postMap);
        String postBodyJSON = JSON.serialize(postMap);
         
        return ExternalCalloutHelper.post('create_account', postBodyJSON);
         
    }

}


My Test Class is: 

@isTest
private class ExternalCalloutHelperV2_Test{
  @testSetup
  static void setupTestData(){
    test.startTest();
    Account account_Obj = new Account(Name = 'Name142', BillingStreet = 'PratapNagar', BillingCity = 'Jaipur', BillingState = 'Raj', BillingPostalCode = '302022', BillingCountry = 'India', Phone = '54343-58789');
    Insert account_Obj; 
    Contact contact_Obj = new Contact(LastName = 'LastName149', FirstName = 'First505', MailingStreet = 'PratapNagar', MailingCity = 'Jaipur', MailingState = 'Raj', MailingPostalCode = '302022', MailingCountry = 'India', Phone = '54343-99290', Fax = '54343-58413', Email = 'Email38@test.com', Username__c = 'Usern790', Terms_of_Service_Privacy_Policy_Opt_in__c = false, Marketing_Communications_Opt_in__c = false);
    Insert contact_Obj; 
    test.stopTest();
  }
  static testMethod void test_post_UseCase1(){
    List<Account> account_Obj  =  [SELECT Name,BillingStreet,BillingCity,BillingState,BillingPostalCode,BillingCountry,Phone from Account];
    System.assertEquals(true,account_Obj.size()>0);
    List<Contact> contact_Obj  =  [SELECT LastName,FirstName,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,Phone,Fax,Email,Username__c,Terms_of_Service_Privacy_Policy_Opt_in__c,Marketing_Communications_Opt_in__c,CAG_Opt_in__c from Contact];
    System.assertEquals(true,contact_Obj.size()>0);
    ExternalCalloutHelperV2 obj01 = new ExternalCalloutHelperV2();
    ExternalCalloutHelperV2.post('test data','test data');
  }
  static testMethod void test_postContactToServer_UseCase1(){
    List<Account> account_Obj  =  [SELECT Name,BillingStreet,BillingCity,BillingState,BillingPostalCode,BillingCountry,Phone from Account];
    System.assertEquals(true,account_Obj.size()>0);
    List<Contact> contact_Obj  =  [SELECT LastName,FirstName,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,Phone,Fax,Email,Username__c,Terms_of_Service_Privacy_Policy_Opt_in__c,Marketing_Communications_Opt_in__c from Contact];
    System.assertEquals(true,contact_Obj.size()>0);
    ExternalCalloutHelperV2 obj01 = new ExternalCalloutHelperV2();
    ExternalCalloutHelperV2.postContactToServer(new List<id>());
  }
}
Hi everyone, 

I am not a developer and am attempting to push my first trigger from Sandbox to Production and need some help. I've created this trigger: 

trigger CasetoJiraPayTeamBug on Case (after Update) {
    for(Case obj: Trigger.new) {
        if(obj.Send_to_Jira__c == true && obj.Pay_Team__C == true && obj.Bug_Report__C == true){
       {
          JCFS.API.createJiraIssue('10429', '1');
       }
   }
}
}

I used a thrid party app that generated this test class for me:

@isTest
private class CaseTrigger_Test{
  static testMethod void test_CaseTrigger(){
   test.startTest();
    Case case_Obj = new Case(Send_to_Jira__c = True, Product_Team__c = 'Pay Team',Type = 'Bug Report');
    Insert case_Obj; 
   test.stopTest();
  }

  static testMethod void test_UseCase1(){
   test.startTest();
    Case case_Obj = new Case(Send_to_Jira__c = True, Product_Team__c = 'Pay Team',Type = 'Bug Report');
    Insert case_Obj; 
    test.stopTest();
}
}


My deployemnt fails with an error message of: Your code coverage is 0%. You need at least 75% coverage to complete this deployment.
I am trying to create a detail page button that marks a checkbox as true. Here is the URL I am currently using for my button: /{!Case.Id}/e?retURL=/{!Case.Id}&00N11000004Dwmh=1&save=1

This opens the edit page but does not mark the checkbox as true. Is there a way to do this without opening the edit page? 

Example
I am hoping to create a trigger to fire when a Lead is created that checks to see if there is a Contact that exists wit the same email address. If it finds a matching email address then convert the Lead to a Contact. Is this possible?
I am writing my first Trigger in Salesforce and am trying to have it only fire based on my Case Record Type but it is not working. Here is what I have so far:

trigger CasetoJira on Case (after insert) {
if(Trigger.new[i].RecordType == '01211000000HG7CAAW'){
JCFS.API.createJiraIssue('10431', '3');
}}
Hi everyone, 

I am not a developer and am attempting to push my first trigger from Sandbox to Production and need some help. I've created this trigger: 

trigger CasetoJiraPayTeamBug on Case (after Update) {
    for(Case obj: Trigger.new) {
        if(obj.Send_to_Jira__c == true && obj.Pay_Team__C == true && obj.Bug_Report__C == true){
       {
          JCFS.API.createJiraIssue('10429', '1');
       }
   }
}
}

I used a thrid party app that generated this test class for me:

@isTest
private class CaseTrigger_Test{
  static testMethod void test_CaseTrigger(){
   test.startTest();
    Case case_Obj = new Case(Send_to_Jira__c = True, Product_Team__c = 'Pay Team',Type = 'Bug Report');
    Insert case_Obj; 
   test.stopTest();
  }

  static testMethod void test_UseCase1(){
   test.startTest();
    Case case_Obj = new Case(Send_to_Jira__c = True, Product_Team__c = 'Pay Team',Type = 'Bug Report');
    Insert case_Obj; 
    test.stopTest();
}
}


My deployemnt fails with an error message of: Your code coverage is 0%. You need at least 75% coverage to complete this deployment.
I am trying to create a detail page button that marks a checkbox as true. Here is the URL I am currently using for my button: /{!Case.Id}/e?retURL=/{!Case.Id}&00N11000004Dwmh=1&save=1

This opens the edit page but does not mark the checkbox as true. Is there a way to do this without opening the edit page? 

Example
I am hoping to create a trigger to fire when a Lead is created that checks to see if there is a Contact that exists wit the same email address. If it finds a matching email address then convert the Lead to a Contact. Is this possible?
I am writing my first Trigger in Salesforce and am trying to have it only fire based on my Case Record Type but it is not working. Here is what I have so far:

trigger CasetoJira on Case (after insert) {
if(Trigger.new[i].RecordType == '01211000000HG7CAAW'){
JCFS.API.createJiraIssue('10431', '3');
}}