• Salesforce Beginner
  • NEWBIE
  • 45 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 8
    Questions
  • 12
    Replies
Hi All,

I am trying to understand, how do we mention a community (partner) user using (@-mention) via Chatter API? To give you all a little background of the scenario, we have a custom sharing component, which works pretty much like the standard sharing functionality. There were several considerations to go for custom sharing functionality which ultimately uses share__c object. After sharing the record of a custom__c object, we are using the information from share object to post a chatter message for the shared record. We are using 'ConnectApi.ChatterFeeds.postFeedItem'. In the body of the FeedItem, we are using @-mention user, and the checkbox to receive email notification is checked to receive an email (OOB functionality) when somebody mentions that user.

That being said, on succussful share of the record between two internal users, feed item is posted on the chatter and since we use @-mention in the feeditem body, the email notifications are being sent as we expect - All good here.

Similary when we share the record as an internal user to external user (partner community) user, Share is successful and the insertion of the feed item is successful as well. However, in the body of the feeditem, '@JohnSmith (partner)'  is greyed out. When I hover over the user name, it says, you do not have access to this user. I have tried to understand better, why am I not able to make it work with no luck. Any help to tackle this is greatly appreciated. 


 
Hi All,

I am calling a flow (auto launched flow) from an Apex class. In the flow I am using fast lookup to get custom object records. One of the fields on the custom object is a date field. After I get the fast lookup results, I am assigning the field values to a flow local variable. When I am doing this for all other fields, flow works fine and I get the field values back into the class. But when I use date field assignment, flow throws un handled exception.

I am still new to flow and your suggestions and help are very useful as I am out of ideas on this.
 
Hi All,

We have an extensive trigger on Account. As our trigger is expensive in terms of CPU utilization, we are hitting CPU time limit exception frequently. As part of improving the performance, we are thinking to move few methods which can be run asynchronous and we are moving those methods out of the trigger into Queueable class.

By including debug statements in our trigger, I identified the methods which is taking comparitively more CPU times. Also, to start with, moved a method to queueable following the documentation.


public class AccountQueueable implements Queueable {
        
    private ID parent;
    Private Boolean isBefore;
    Private Boolean isAfter;
    Private Boolean isInsert;
    Private Boolean isUpdate;
    Private Boolean isDelete;
    Private Boolean isUndelete;
    private List<Account> newList;
    private Map<Id, Account> newMap;
    private List<Account> oldList;
    private Map<Id, Account> oldMap;
    
    public AccountQueueable(Boolean isBefore, Boolean isAfter, Boolean isInsert,
                              Boolean isUpdate,Boolean isDelete,Boolean isUndelete,List<Account> newList,
                              Map<Id, Account> newMap,List<Account> oldList,Map<Id, Account> oldMap)
    {
        this.isBefore = isBefore;
        this.isAfter = isAfter;
        this.isInsert = isInsert;
        this.isUpdate = isUpdate;
        this.isDelete = isDelete;
        this.isUndelete = isUndelete;
        this.newList = newList;
        this.newMap = newMap;
        this.oldList = oldList;
        this.oldMap = oldMap;
    }

    public void execute(QueueableContext context) {
          
        UtilityClass.AccountsUpdate(newList, oldMap);
    }  // End of execute method
  
}

And in the trigger I am using the below statements to enqueue the job:

AccountQueueable AccountsAfterUpdateJob = new AccountQueueable(false,true,false,true,false,false,newAccountList,null,null,oldAccountMap);
System.enqueueJob(AccountsAfterUpdateJob);

When I do the update test, I do not see much improvement in the CPU time (it is pretty much same or bit higher). The purpose of moving it to the queueable was to save the CPU time of the trigger during the transaction. Can anybody please let me know if I am doing anything incorrectly here?

Need help and suggestions.

 
Hello Guys,

I am trying to split Apex column into two sub columns. How do we do this in VisualForce.

I am using the below code :
    <apex:pageBlockTable border="true" align="center" value="{!lstwrapper}" var="x" >  
           
           <apex:column headerValue="Admin Ticket" style="text-align:center" colspan="2">
               
            </apex:column>

             <apex:column headerValue="Answer Sheet" style="text-align:center"  colspan="2">
               
            </apex:column> 
            <apex:column headerValue="Exam Book" style="text-align:center"  colspan="2">
               
            </apex:column>
   
        </apex:pageBlockTable>




I need two sub columns under 3 main columns.
Ex:        Admin Ticket
               AM     PM

 
Hello Frens,

I have a map<ID,ID>. Is there any way I get the key from value ?

ex: Map<1,101>

I have access to 101 but anyway I can get its key ?
Note: values are unique too. No redundant values.
Hello All,

I am using a Map<string,List<string>> mapEmailtoBodyFields = new Map<string,List<string>>(); to map the email ids to description fields of an object.

Requirement : Have to check whether email id is present in our system. if present I have to do some logic. my question is, when I am comparing email in the map with the email ids in the system (our salesforce org), I might run into a case mismatch. For example:

key in the map : John.Doe@xyz.com
Email Id in the system : john.doe@xyz.com

When I am comparing these two,it should not fail because both the email ids are same. How can I make sure to compare this case sensitivity. I do not need a boolean result because, I am using map.get(emailID) .Please share your thoughts.

 
Hello All,

I am writing a trigger on Task. When a new task is created, I am using the who.id (in my case mostly lead) and converting lead in to Account, contact and opp. Duing this process I am reading subject line (standard subject pattern) of the task to use the fields in the contact creation. example subject line: NewTask-email@email.com-field3-field4.

Note : ' - ' is the delimiter.

I am using as below:
if(task.Subject.indexOf('NewTask-') > -1) 

Now, I have a similar requirement to read the standard pattern (company-firstname-lastname-phoneno) etc from the decription(body/comments) field of the task. 

If anybody has any thoughts please share.
Hello All,

I have a contact object and custom__c object. Where in Custom__c has a lookup relation to contact. My requirement is, for every contact record, have to loop through all the child records. For this I need a map<contact_Id, List<custom__c>>. 

I am trying different ways to do it with no luck. Any thoughts on this is appreciated.

Once I have a map, I am planning to do the following:
for (ID conid:  map.keyset())
{
      for(custom__c cust : map.get(conid))
      {
            if(cust.status==True)
            {
                   // update few fields on contact
            }
      }
}
Hi
I am plannning to give salesforce developer winter 17 maintenance exam. But in my Webassessor account I dont see any option to register for maintenance Exam. Can any one pls help me to register for salesforce developer winter 17 maintenance exam.

Thanks,
Dilip
Hello Guys,

I am trying to split Apex column into two sub columns. How do we do this in VisualForce.

I am using the below code :
    <apex:pageBlockTable border="true" align="center" value="{!lstwrapper}" var="x" >  
           
           <apex:column headerValue="Admin Ticket" style="text-align:center" colspan="2">
               
            </apex:column>

             <apex:column headerValue="Answer Sheet" style="text-align:center"  colspan="2">
               
            </apex:column> 
            <apex:column headerValue="Exam Book" style="text-align:center"  colspan="2">
               
            </apex:column>
   
        </apex:pageBlockTable>




I need two sub columns under 3 main columns.
Ex:        Admin Ticket
               AM     PM

 
Hello All,

I am using a Map<string,List<string>> mapEmailtoBodyFields = new Map<string,List<string>>(); to map the email ids to description fields of an object.

Requirement : Have to check whether email id is present in our system. if present I have to do some logic. my question is, when I am comparing email in the map with the email ids in the system (our salesforce org), I might run into a case mismatch. For example:

key in the map : John.Doe@xyz.com
Email Id in the system : john.doe@xyz.com

When I am comparing these two,it should not fail because both the email ids are same. How can I make sure to compare this case sensitivity. I do not need a boolean result because, I am using map.get(emailID) .Please share your thoughts.

 
Hello All,

I am writing a trigger on Task. When a new task is created, I am using the who.id (in my case mostly lead) and converting lead in to Account, contact and opp. Duing this process I am reading subject line (standard subject pattern) of the task to use the fields in the contact creation. example subject line: NewTask-email@email.com-field3-field4.

Note : ' - ' is the delimiter.

I am using as below:
if(task.Subject.indexOf('NewTask-') > -1) 

Now, I have a similar requirement to read the standard pattern (company-firstname-lastname-phoneno) etc from the decription(body/comments) field of the task. 

If anybody has any thoughts please share.
Hello All,

I have a contact object and custom__c object. Where in Custom__c has a lookup relation to contact. My requirement is, for every contact record, have to loop through all the child records. For this I need a map<contact_Id, List<custom__c>>. 

I am trying different ways to do it with no luck. Any thoughts on this is appreciated.

Once I have a map, I am planning to do the following:
for (ID conid:  map.keyset())
{
      for(custom__c cust : map.get(conid))
      {
            if(cust.status==True)
            {
                   // update few fields on contact
            }
      }
}

Is there a way to ignore the case when comparing string with a Map Key? 

 

I tried tolowercase (), toupperCase, but for my requirement that's not a viable solution. 

 

Any other way?

 

Map<string, string> colorCodes = new Map<String, String>();

string s1='RED';
string s2='BLUE';

 

colorCodes.put(s1.tolowercase(), 'FF0000');
colorCodes.put(s2.tolowercase(), '0000A0');

Boolean contains = colorCodes.containsKey('BluE');
System.assertEquals(contains, True);    // Assertion fails

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.