• Rinigrace Mekala
  • NEWBIE
  • 20 Points
  • Member since 2015

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

How to post related object data of a contact record on the User's feed, who is following that Contact?

Any kind of suggestion is appreciated.

Thanks in advance,
Grace
Hi All,

There is a Contact record. Iam the user following that particular contact. Now, When I create a call record related to the contact, few of the call fields should be displayed on the chatter feed of the contact.

Is there any idea how to implement this?

Any kind of suggestion is accepted.

Thanks in advance,
Grace
 
Hi,

I want to import some data into salesforce using a csv file. For that i am using below code. 
Now, I want to do some data validations while importing the file, such as 'if csv file does not contain data' and 'If the file extension is not csv' the user should see an error.
And every time the user clicks on the Custom button, the page should get refreshed.
Please guide me in this.
The apex class is:
public class Controller {

public List<Parent__c> parentlist{get;set;}
public List<Child__c> childlist{get;set;}
public String conType{get;set;}
public Blob namefile{get;set;}
public string str{get;set;}
public String[] fileLines{get;set;}

public Controller ()
  {
     conType = 'text/html';
  }
    
public void importcsv()
   {
      Set<String> a1= new Set<String>();
      conType = 'text/html'; 
      fileLines = new String[]{};
      parentlist = New List<Parent__c>();
      childlist = New List<Child__c>();
      Set<String> s1= new Set<String>();
       
        try{
            if (namefile==NULL){
                ApexPages.addmessage(new ApexPages.Message(ApexPages.Severity.ERROR,'No file is choosen'));
           }
            else{
                  str = namefile.toString();
                  fileLines = str.split('\n');
                  string[] csvdata; 
                  Parent__c parentob;     
                  Child__c childob;
       
              for(Integer i=1;i<fileLines.size();i++)
               {
                 csvdata = fileLines[i].split(',');
                 system.debug('csvdata[0]'+csvdata[0]);
                
                 a1.add(csvdata[0]);
                 s1.add(csvdata[1]);
               }
                getA1Name(a1);
                getS1Name(s1);
                                          
          for(Integer i=1;i<fileLines.size();i++)                 
           {
            for(Parent__c p1:[SELECT id,A__r.name ,B__r.name, C__c 
                                             FROM Parent__c 
                                             WHERE id =:parentlist])
                {
                 csvdata = fileLines[index].split(',');
                 if(p1.A__r.name== (csvdata[0]) && p1.B__r.name == (csvdata[1]) && p1.C__c == (decimal.valueOf(csvdata[2].trim())))
                   {
                     childob = new Child__c();
                     childob.Parent__c =p1.id;
                     //fields assignment
                   }
                 }
              }
                upsert childlist;
                system.debug('FIND2...'+childlist);
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM,'Data Imported Succesfully')); 
              
            }    
          } 
           catch (Exception e)
             {
              ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,e.getLineNumber()+'\n'+e.getMessage()+'\n'+e.getStackTraceString()+'\n'+e.getTypeName());
              ApexPages.addMessage(errorMessage);
             }   
      } 
  }


The VF page is:
<apex:page controller="DpsForecastingController" contentType="{!conType}">

<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">
<head>
<apex:stylesheet value="{!URLFOR($Resource.SLDS212, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}" />
</head>
<body>


<apex:form >
  <apex:pagemessages />        
    <apex:pageBlock >
       <apex:pageBlockSection >
          <apex:outputLabel >
            <apex:inputFile value="{!namefile}"/>                  
            <apex:commandButton value="Import file" action="{!importcsv}"/>
          </apex:outputLabel>
              
       </apex:pageBlockSection>
  </apex:pageBlock>    
      <apex:pageBlock>
        <apex:pageblocktable value="{!childList}" var="child" >
           <apex:column value="{!child.Child__r.A__r.name}"/> 
            <apex:column value="{!child.Child__r.B__r.name}"/> 
           
        </apex:pageblocktable>
     </apex:pageBlock>            
</apex:form>  

</body>
</html> 
</apex:page>

Any kind of suggestion is appreciable. Thanks in advance.
 
1) There is a multiselect picklist field 'BU_Specialty_Name__c' with values "A","B","C" & "R". The condition is that, If user selects any value along with "R", an error should occur saying that 'R should be selected alone'. For this I have implemented a Validation rule as below: 
IF(OR(AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"A")),
      AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"B")),
      AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"C"))
      ),
  true, false)
It is working fine for the environment(Sandbox) which has "A","B","C"&"R" values for 'BU_Specialty_Name__c'.
2) But now, the requirment is that, For the other environment(Prod),  'BU_Specialty_Name__c' has few more values "A","B","C","D", "E" & "R". 
    Here also same condition should be given that is, If user selects any value along with "R", an error should occur.
   And we cannot overwrite Validation rule depending upon environment always.

  So,Is there any alternative to throw an error When user selects any value along with "R", instead of calling all the values as I did above?
 The idea should work for all environments independant on other multiselect picklist values.

Any kind of suggestion is accepted. Thanks in advance!
Hi All,

        I have created a salesforce app and connected it to Mobile IOS using Connected App, Http POST & Http GET.  As we know in salesforce, on clicking Home Tab, one can see 'Feed' & 'Create New' options. Similarly I want to implement the same for Mobile side also. That is, From my mobile app, whenever I click on Home Tab, I can able to see 'Feed' and 'Create New'(for a particular object). Please help how to proceed for this requirement.

Any kind of suggestion is acceptable.
Thanks in advance.
Hi, 
    I have two objects 'A' & 'B' and a VF page. A field from object 'A' is a lookup in object 'B'. On selecting a lookup field of 'A', the values corresponding to that field have to be auto populated in my VF page. But it was not happening. 
Can anyone please explain why?

Note: VF page is of object 'B'. Iam using Lightning Experience.

Thanks in advance.
Hi everyone,
       Can anyone please explain how to remove or hide unused tabs from navigation menu using Lighting Experience.

Thanks in advance.
Hi All,

There is a Contact record. Iam the user following that particular contact. Now, When I create a call record related to the contact, few of the call fields should be displayed on the chatter feed of the contact.

Is there any idea how to implement this?

Any kind of suggestion is accepted.

Thanks in advance,
Grace
 
1) There is a multiselect picklist field 'BU_Specialty_Name__c' with values "A","B","C" & "R". The condition is that, If user selects any value along with "R", an error should occur saying that 'R should be selected alone'. For this I have implemented a Validation rule as below: 
IF(OR(AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"A")),
      AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"B")),
      AND(INCLUDES(BU_Specialty_Name__c,"R"),INCLUDES( BU_Specialty_Name__c,"C"))
      ),
  true, false)
It is working fine for the environment(Sandbox) which has "A","B","C"&"R" values for 'BU_Specialty_Name__c'.
2) But now, the requirment is that, For the other environment(Prod),  'BU_Specialty_Name__c' has few more values "A","B","C","D", "E" & "R". 
    Here also same condition should be given that is, If user selects any value along with "R", an error should occur.
   And we cannot overwrite Validation rule depending upon environment always.

  So,Is there any alternative to throw an error When user selects any value along with "R", instead of calling all the values as I did above?
 The idea should work for all environments independant on other multiselect picklist values.

Any kind of suggestion is accepted. Thanks in advance!