• Beau Gordon 6
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
Short story is one of our customers wants our app as a tab on their salesforce dashboard.
1) I'm assuming we need to build an app in appexchange for that, correct?
2) Can we potentially just use salesforce API integration for that or do we need to dive into Apex?   

I know it's not much detail and I'm sure it depends on many things, but I'm just looking for a rough/general answer at this point. Thanks so much.
Hi,

I'm setting up Knowledge.  I am not using Lightning Knowledge.  My problem is that I get 'Insufficient Privileges' after I publish Knowledge articles.  I can create and publish the article.  It looks fine.  I just can't view the article after it is published.  I can edit the article.  I am trying to publish to all channels - Internal App, Partner, Customer, Public Knowledge Base.

My profile has Modify All access to the Knowledge Article type I created.  It also has the "Manage Articles" permission.  My user account has Knowledge User enabled.

I have created a Data Category Group and a Data Category.  I made that Data Category Group available to Knowledge  in Setup->Knowledge->Data Category Assignments.  For my profile, the Data Category Visibility is set to All for that Data Category.  I assigned the article to the Data Category.

If you have any ideas I would love to hear them.

 
Hi folks,
I developed a trigger for my production environment in the Eclipse IDE. When I go to save it to my environment, it shows an error that code coverage is 0%. I've developed a test class for this trigger, and when I run the test from the IDE, it shows test coverage for my trigger at 100% (0 lines not tested).

What gives? Is there another way to get my trigger to save onto my environment? I tried using the Development Console but that didn't work due to the 'Metadata can't be changed on an active environment' bug.

Any help is appreciated.

Trigger:
trigger Account_UpdateAccountInterestsList on Interest__c (after delete, after insert, after undelete, 
after update) {
	Interest__c[] interests;
    if (Trigger.isDelete) 
        interests = Trigger.old;
    else
        interests = Trigger.new;
	Set<ID> affected_accounts = new Set<ID>();
	Map<ID, List<String>> account_interests = new Map<ID, List<String>>();
	for(Interest__c interest: interests){
		affected_accounts.add(interest.Account__c);
		account_interests.put(interest.Account__c, new List<String>());
	}

	List<Interest__c> all_interests = [
		SELECT Id, Account__c, Interest__r.Name
		FROM Interest__c
		WHERE Account__c IN :affected_accounts
		ORDER BY Interest__r.Name
	];
	List<Account> accounts_to_update = [
		SELECT Id, Account_Interests_List__c
		FROM Account
		WHERE Id IN :affected_accounts
	];
	
	for(Interest__c interest: all_interests){
		account_interests.get(interest.Account__c).add(interest.Interest__r.Name + '\n');
	}
	for(Account account: accounts_to_update){
		account.Account_Interests_List__c = Util_TMCR.combineList(account_interests.get(account.Id));
	}
	
	update accounts_to_update;
}


Test class:
@isTest
private class TMCR_testAccountInterestList {
  /*
    Testing Account_UpdateAccountInterestsList trigger
  */
  static Account getAccount(){
    Util_TMCR_DataFactory.accounts account = new Util_TMCR_DataFactory.accounts();
    Account acc = [
      SELECT Id, Account_Interests_List__c
      FROM Account WHERE Name = :account.get('name')
    ];
    return acc;
  }
  static Interests__c addInterest(String name){
    Interests__c new_interest = new Interests__c(Name = name);
    insert new_interest;
    return new_interest;
  }
  static Interest__c addToAccount(Account acc, Interests__c interest){
    Interest__c acc_interest = new Interest__c(Interest__c = interest.Id, Account__c = acc.Id);
    insert acc_interest;
    return acc_interest;
  }
  
  @testSetup
  static void setup(){
    List<Interests__c> interests = new List<Interests__c>();
    List<Interest__c> account_interests = new List<Interest__c>();
    for(Integer i=0; i<3;i++){
      interests.add(addInterest('Interest' + i));
    }
    Util_TMCR_DataFactory.accounts account = new Util_TMCR_DataFactory.accounts();
    Account acc = account.generate();
    for(Interests__c interest: interests){
      account_interests.add(addToAccount(acc, interest));
    }
  }
  
    static testMethod void test_addInterest() {
    test.startTest();
    Account account = getAccount();
    Interests__c interest = addInterest('foo');
    Interest__c acc_interest = addToAccount(account, interest);
    test.stopTest();
    
    String concat = Util_TMCR.combineList(new List<String>{'foo', 'Interest0', 'Interest1', 'Interest2'});
    Account acc = getAccount();
    System.assertEquals(acc.Account_Interests_List__c, concat);
    }
    static testMethod void test_changeInterest() {
      test.startTest();
    Interests__c interest = addInterest('foo');
    Interest__c acc_interest = [SELECT Id, Interest__c from Interest__c WHERE Interest__r.Name = 'Interest0' LIMIT 1];
    acc_interest.Interest__c = interest.Id;
    update acc_interest;
      test.stopTest();
      List<String> mylist = new List<String>{'foo', 'Interest1', 'Interest2'};
      String concat = Util_TMCR.combineList(mylist);
      Account acc = getAccount();
      System.assertEquals(acc.Account_Interests_List__c, concat);
    }
    static testMethod void test_deleteInterest(){
      test.startTest();
    Interests__c interest = [SELECT Id, Name FROM Interests__c WHERE Name = 'Interest0' LIMIT 1];
    delete interest;
      test.stopTest();
      List<String> mylist = new List<String>{'Interest1', 'Interest2'};
      String concat = Util_TMCR.combineList(mylist);
      Account acc = getAccount();
      System.assertEquals(acc.Account_Interests_List__c, concat);
    }
    static testMethod void test_undeleteInterest(){
      test.startTest();
    Interests__c interest = [SELECT Id, Name FROM Interests__c WHERE Name = 'Interest0' LIMIT 1];
    delete interest;
    undelete interest;
      test.stopTest();
      List<String> mylist = new List<String>{'Interest0', 'Interest1', 'Interest2'};
      String concat = Util_TMCR.combineList(mylist);
      Account acc = getAccount();
      System.assertEquals(acc.Account_Interests_List__c, concat);
    }
}


 
I will be having email alerts sent to clients and I want their replies to go to an Email Service address. But I can't simply make that long address the "From" address because that must be an org-wide approved email address, which you cannot do with an email service address. 

So, it's been suggested to me to use an org-wide approved address (sales@company.com etc) and simply set up that email account to automatically forward all of its mail to the long email service address. However, I can't use the long email service address as a destination address in the forwarding process either. Gmail needs to send a verification to whatever email will be used and I cannot perform an approval for the email address, or at least I don't know how to.

How can I accomplish this ? 

Thank you.
  • October 02, 2015
  • Like
  • 0
I'be trying find a sample code I can use to add to one of our website pages so our customers can do a simple search in our public knowledge articles. One forum I found suggests to use iframes. Does anyone one have any sample code they can share with me on how to do this?
Short story is one of our customers wants our app as a tab on their salesforce dashboard.
1) I'm assuming we need to build an app in appexchange for that, correct?
2) Can we potentially just use salesforce API integration for that or do we need to dive into Apex?   

I know it's not much detail and I'm sure it depends on many things, but I'm just looking for a rough/general answer at this point. Thanks so much.