• oleksandr vashchenko
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi guys! 

I am creating CanvasPost FeedItems. It works well, but when I make SOQL:
SELECT Id, type, ParentId, body, HasLink, IsRichText, RelatedRecordId, Title, HasContent FROM FeedItem Order by CreatedDate desc limit 10
I see records with next (example) RelatedRecordId: 
0AW1a0000004DjAGAU

And now is a question. How to get an information about this record? (Title, size, anything)

 
Hi, 

I am working with chatter api, and I have to create FeedItems, from API, that uses rich editor. 

http://docs.releasenotes.salesforce.com/en-us/winter16/release-notes/rn_chatter_api_resources.htm#ChatterRESTFeeds 

Make a rich-text feed post
Make a POST request to the existing /chatter/feed-elements resource with the new Message Segment Input: Markup Begin and Message Segment Input: Markup End request bodies to make a rich-text feed post.

Could somebody give me an example, of creating rich-text record?

Thank you,
Alex
I've got an after update trigger on account that works fine when individual records are updated.  But when I go to do a bulk update on say 200 accounts in my sandbox the trigger is not fired.  

Here's the class that the account after update trigger calls that does the work.  Something is not bulkified in here but I can't see it.  I don't think I've got any queries in for loops which usually is the problem.  What is wrong with this code?
 
public without sharing class RelatedAccountsManager{

    public static void createRelatedAccounts(object[] newTrigger) {

        List<Account> accList = (List<Account>) newTrigger;
            List<Account> accList3 = new List<Account>();
            List<Related_Account__c> raList = new List<Related_Account__c>();
            String thisDUNS;
            Id originalAccount;
                                
            for(Account a: accList){
                thisDUNS = a.Convey_Global_Ultimate_D_U_N_S__c;
                originalAccount = a.Id;
            }
         
            List<Related_Account__c> raListCheck = [SELECT Id, Related_Account__c, Account_Connection__r.Id from Related_Account__c WHERE Account_Connection__r.Id =: originalAccount LIMIT 1];
          
            if(raListCheck.size()>0){
            }else{                
              List<Account> accList2 = [SELECT ID,Type,Convey_Global_Ultimate_D_U_N_S__c FROM Account WHERE Convey_Global_Ultimate_D_U_N_S__c =: thisDUNS AND Convey_Global_Ultimate_D_U_N_S__c != null];        
                for(Account a1: accList2){
                    if(a1.Id != originalAccount && a1.Convey_Global_Ultimate_D_U_N_S__c!= null && accList2.size()>0 && a1.Type != 'Prospect'){
                        Related_Account__c ra = new Related_Account__c();
                        ra.Account_Connection__c = originalAccount;
                        ra.Related_Account__c = a1.Id;
                        raList.add(ra);       
                        accList3.add(a1);             
                     }
                }
             }
             insert raList;  
             
             List<Account> accList4 = new List<Account>();
             
             for(Account a2: accList3){
                accList4.add(a2);
             }
             
             update accList4;
     }   
}

 
Hi, 

I am working with chatter api, and I have to create FeedItems, from API, that uses rich editor. 

http://docs.releasenotes.salesforce.com/en-us/winter16/release-notes/rn_chatter_api_resources.htm#ChatterRESTFeeds 

Make a rich-text feed post
Make a POST request to the existing /chatter/feed-elements resource with the new Message Segment Input: Markup Begin and Message Segment Input: Markup End request bodies to make a rich-text feed post.

Could somebody give me an example, of creating rich-text record?

Thank you,
Alex
I want to cover atleast 75% of class. Now am on 74% just need only one percent but i found it hard. One part of my method is not covering that contains variables and its assignments.
if( Discount != 0 && MDiscount != 0)
                {
           
                    Discount = ((UnitRate )*Discount)/100; 
                    MDiscount = ((UnitRate  - Discount)*MDiscount)/100;
                    objvar.Discount__c = Discount;
                    objvar.MDiscount__c = MDiscount;
                }
                else if(Discount != 0 && MDiscount == 0)
                {
                   
                    Discount = ((UnitRate )*Discount)/100; 
                    objvar.Discount__c = Discount;
                }
                else if(Discount == 0 && MDiscount != 0)
                {
                
                    MDiscount = ((UnitRate )*MDiscount)/100;
                    objvar.MDiscount__c= MDiscount;
    
                }
                else
                {
                    objvar.Discount__c = 0;
                    objvar.MDiscount__c = 0;
                }

above apex class code is one part of condition checking. This part is not covering in my Test class. Help me to cover this.
variables are Discount, MDiscount and UnitRate