• Rob_Alexander
  • NEWBIE
  • 0 Points
  • Member since 2021
  • Chief Technology Officer
  • Tribal EM

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 0
    Questions
  • 3
    Replies
Dear All,

I have a requirement where I need to notify a Chatter Group of a new record creation and record update within Chatter.

I have seen that a FeedItem is created for creation and update events for the record. A simple solution I thought was to mention the Chatter Group within a FeedComment related to the FeedITem created above.

I have tried all the ways I can to "mention" the Chatter Group, however it just comes back as plain text when inserted.

I have tried adding square brackets, @[<<feeditemid>>]. [@<<feeditemid>>], {<<feeditemid>>} and others.

I have manually added a comment from UI and looked at the FeedComment record and tried to replicate the same inside the Flow but again it comes back as plain text without the actual link to the Group.

I am thinking that I am either missing a small thing or its not possible via Flow.

I really did not want to go to Apex Classes to achieve this simple ask.

Please let me know your thoughts and I will give every input a try.

Thanks,
I am trying to create a Chatter post from a visual workflow.  When an Oppty is won, I want to create a Chatter post congratulating the Oppty owner and have it come from their Manager.  So far I can I can do all that using the Create Record Action
User-added image

The issue I am running into, I want to @mention the Manager (so they know they "sent" a chatter post) so I created a text body formula:
User-added image 
but the Chatter post is listing the id, and not doing a true @mention
User-added image

Any ideas on how to do a proper @mention via a formula?

Thanks, 

Todd B. 
 

Hi All,

 

I hope this is a simple problem and I'm just missing something.

 

I am trying to build a controller extension that saves a VF form page details and then reloads the same page.

 

This should be straight forward but when I try and use the documented way to do this, the data is saved and the return page is the page I wanted, but along with it the URL of the page , a long string of test has been appended to the end, the apex seems to be wanting to map the details of the fields on the page when it reloads.

 

This in itself would not a problem, but some users are getting an authentication error when the page reloads, and i assume this has something to do with it.

 

Any help would be great.

 

Thanks all

We are trying to use the E2Excel "Export to Excel" button (downloaded from the App Exchange) on custom objects and it seems to work if you include it directly on the object, but when we try to lauch the button from a 'Related List' we are getting an error message: 

A problem with the OnClick JavaScript for this button or link was encountered: Cannot read property 'value' of undefined

I have very little experience with Java but here is the code they included in the instructions for installation of the botton on the object:

var str = parent.location.href;
var sobjid=str.substring(str.indexOf("?fcf")-3,str.indexOf("?fcf"));
var idArray = {!GETRECORDIDS('selected')};
var listview = document.getElementsByName('fcf')[0];
var listId = listview.value;
var listName = listview.options[listview.selectedIndex].text;
var idString = JSON.stringify(idArray);
window.open('apex/E2Ex__Export_To_Excel?idString='+idString+'&sobjid='+sobjid+'&listid='+listId+'&listName='+listName);

Again, it has worked 'as expected' when added to the Object. But when trying to use it from a 'related list' we get the error message. The buttom appears on the Related List next to the "New" button. Any help you can offer to sort this out, would be greatly appreciated. 
I am trying to create a Chatter post from a visual workflow.  When an Oppty is won, I want to create a Chatter post congratulating the Oppty owner and have it come from their Manager.  So far I can I can do all that using the Create Record Action
User-added image

The issue I am running into, I want to @mention the Manager (so they know they "sent" a chatter post) so I created a text body formula:
User-added image 
but the Chatter post is listing the id, and not doing a true @mention
User-added image

Any ideas on how to do a proper @mention via a formula?

Thanks, 

Todd B. 
 

Sometimes we need to build a table for showing grouped records by a particular field. Here I show one way to accomplish this. 

For example, suppose we want to show all contacts grouped by company as shown in the following image.

Table of Contacts grouped by Account

In order to group cells in a html table we could use the attribute rowspan but we need to know how many records will be grouped in each Account. For this we could use a controller that allow us order and manage the records that will be shown in the Visualforce page.
 
Here is an example that I made for the visualforce and Apex Code. 

<apex:page standardController="Contact" extensions="contactsByAccount_extension" >

  <table border="1" cellspacing="0" width="60%">
    <thead>
        <th> Account </th>
        <th> Title </th>
        <th> Name </th>
        <th> Email </th>
    </thead>
       
    <apex:repeat value="{!contactsByAccount}" var="key" >
      
      <apex:repeat value="{!contactsByAccount[key].contactList}" var="keyvalue" > 
        <tr> 
           <td rowspan="{!contactsByAccount[key].numOfContacts}" style="display:{!IF(CASESAFEID(keyvalue.id)==CASESAFEID(contactsByAccount[key].firstOfList), 'table-data','none' )};"> {!keyvalue.Account.name} </td>
          <td> {!keyvalue.Title} </td>
          <td> {!keyvalue.Name} </td>
          <td> {!keyvalue.Email} </td>  
        </tr>
      </apex:repeat>
      
    </apex:repeat> 
  </table>
    
</apex:page>

In the Visualforce page we iterate through a Map that comes from the extension controller. This Map group the records by Account. So for each Account we also iterate through the contacts of that Account.

The first cell, that show the name of the Account ONLY should be displayed in the first iteration, and it's not recomended to use apex variables in an apex:repeat, so a possible solution for this is making a method in the controller that let us know if the record is the first of the list. Thus we use in the style attribute of the <td> tag a conditional for display the cell. If the record ID of the current record is equal to the first of the list then display the account name. The rest of the cells are displayed without condition. 

Let's see the extension controller now.

public class ContactsByAccount_extension {

    public ContactsByAccount_extension(ApexPages.StandardController controller) {

    }
    
    public Map<String,contactosListWrapper> getContactsByAccount(){
    
      List<Contact> result = [SELECT Account.name, Title, Name, Email FROM Contact ];
    
      // Group Contacts by Account                                
      Map<String,contactosListWrapper> contactsByAccount = new Map<String,contactosListWrapper>();
      for(Contact cont: result){
        if(null == cont.Account.name) continue;
        contactosListWrapper empresa = contactsByAccount.get(cont.Account.name);
        if(null == empresa){
            contactsByAccount.put(cont.Account.name, new contactosListWrapper(new List<contact>()) );    
        }
        contactsByAccount.get(cont.Account.name).contactList.add(cont);
      }
      
      return contactsByAccount;
    }
    
   // List of contacts and details  
   class contactosListWrapper {
       
       public List<Contact> contactList {get; set;}
       
       public Integer numOfContacts {
          get{
            return contactList.size();
          }
          set;
       }
       
       public Id firstOfList{
          get{
            return contactList[0].Id;
          }
          set;
       }
             
       public contactosListWrapper(List<contact> listContacts){
           contactList = listContacts;
           
       }

The inner class contactosListWrapper is a container of a contact list and give us information about wich is the first and how many of them are. 

The extension controller method getContactsByAccount() makes a query of all the contacts and then they are group in the map by Account. For each Account we make a new entry in the Map with the name of the Account (String) and the list of contacts (contactosListWrapper). 

Hi All,

 

I hope this is a simple problem and I'm just missing something.

 

I am trying to build a controller extension that saves a VF form page details and then reloads the same page.

 

This should be straight forward but when I try and use the documented way to do this, the data is saved and the return page is the page I wanted, but along with it the URL of the page , a long string of test has been appended to the end, the apex seems to be wanting to map the details of the fields on the page when it reloads.

 

This in itself would not a problem, but some users are getting an authentication error when the page reloads, and i assume this has something to do with it.

 

Any help would be great.

 

Thanks all