• yogendra Aragula 8
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 7
    Replies
HI ,

I want to use multiple objects on the same batch apex. I trying to Automate post-refreshment activities using sandboxpostcopy interface. The code is working fine to two activities, expect masking contact email id's  

global class TestSOSLBatch implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
        String query = 'SELECT Id,NotificationToEmail__c FROM SupportRequest_Routing_Rules__c';
        return Database.getQueryLocator(query);
       return Database.getQueryLocator([SELECT Email FROM Contact WHERE Email != '']);
    }
    global void execute(Database.BatchableContext BC, list<SupportRequest_Routing_Rules__c> reference){
        List<SupportRequest_Routing_Rules__c> asdf = new List<SupportRequest_Routing_Rules__c>();
        for(SupportRequest_Routing_Rules__c abc : reference){
            if(abc.NotificationToEmail__c != null){
                List<String> emailList = new List<String>();
                 system.debug('Log'+abc.NotificationToEmail__c);
                for(String s :abc.NotificationToEmail__c.split(';'))
                {
                    emailList.add(s);
                    system.debug(emailList);
                }
                list<string> templist = new list<string>();
                for(string s : emailList)
                {
                 templist.addall(s.split(','));   
                 system.debug(templist);                        
                    
                }
                string st ='';
                for( string s:templist )
                {
                    
                    
                    system.debug(st);
                    st = st + s + '.RMBOX' + ',';
                    system.debug(st);
                }
                    
                    
                abc.NotificationToEmail__c = st;
                asdf.add(abc);
            }
        }
        if(!asdf.isEmpty()){
            Update asdf;
        }
        for(CronTrigger ct : [SELECT id FROM CronTrigger where State = 'WAITING']){
            System.abortJob(ct.Id);
        }
        
        List<contact> scope = new list<contact>();
                 for(Contact c : scope)
         {
             c.Email = c.Email + '.Rambox';            
         }
         update scope;

    }
    global void finish(Database.BatchableContext BC) {
    }
HI ,

I need to deploy profile alone with Administrative Permissions. I able to deploy all the components within profile ( Ex: Apexclass , Pages , Fileds O Object permissions except Administrative Permissions).

Thank you. 
 
Hi,

I want to get values from work bench REST API Explorer Limits to a custom object fields. My main requirement is to create dashboards and refresh based on the values in the fields from REST API Explorer Limits. Right now i am entering the REST API Explorer Limits components values manually to the fields. But i want the values to be automatically import into the custom object. This is the end point url  '/services/data/v37.0/limits' . From the below screen, i want to import Max and remaining values for each component to custom object. I am new to REST API and can you please give me a basic idea to get the values from work bench REST Explorer Limits automatically and import to my object.
User-added image
After changing the pick list value ( A to B ) and clicking on update button the changes are not updating to the corresponding record Immediately. When i am again changing the pick list second time ( C to E ) the previous value is getting updated in the record (Ex: B ). Not sure what is wrong it the code. I know i am missing so thing in my update method..

Page :
 
<apex:page standardController="Client_Visit_Report__c" extensions="MatrixPageContoller" sidebar="true" showHeader="false">
<apex:sectionHeader title="Matrix of TP Attende" subtitle="Matrix Of Relationship"/>
<style type="text/css">
    .tpName{
        font-weight: bolder;
        font-family: monospace;
        font-size: large;
        color : Blue;
        Backgroud:color : Green;
    }
</style>

    
<apex:form >
<apex:pageMessages escape="false"/>

    
    <apex:pageBlock >
      
    <apex:pageBlockSection columns="1" title="Detailed Infromation" collapsible="false">
    <apex:variable var="i" value="{!0}"/>
    <apex:repeat value="{!tpCliMap}" var="key" id="display" >
    <apex:variable var="i" value="{!i+1}"/>
   
        <apex:outputText value="TP Attendee {!i} ({!key})" styleClass="tpName"/>
        <apex:outputPanel id="YourPanel"> 
        <apex:pageBlockTable value="{!tpCliMap[key]}" var="a" columns="5" title="Client Details"  id="display">
            <apex:column value="{!a.Client__c}" headerValue="Client Name" style="width:30%" id="tabledetail"/>
            
             <apex:column headerValue="Relationship Type" >
                 <apex:inputField value="{!a.Relationship_Type__c}">                     
                 </apex:inputField>
             </apex:column>
             <apex:column headerValue="Relationship Grade" >             
                     <apex:inputField value="{!a.Relationship_Grade__c}">                                          
                 </apex:inputField>

             </apex:column>
            <apex:column headerValue="Action" style="width:5%">
                <apex:commandButton value="UPDATE" action="{!updateClientRelShip}" reRender="YourPanel">
                    <apex:param assignTo="{!relShipId}" value="{!a.Id}" name="Yogi"/>
                     <apex:param assignTo="{!relShipType}" value="{!a.Relationship_Type__c}" name="Type"/>
                        <apex:param assignTo="{!relShipGrade}" value="{!a.Relationship_Grade__c}" name="Grade"/>
                </apex:commandButton>
            </apex:column>
            <apex:column value="{!a.Previous_Grade__c}" headerValue="Previous Grade" style="width:40%"/>
            <apex:column value="{!a.Relationship_Grade_2__c}" headerValue="Current Grade" style="width:40%"/>
             <apex:column headerValue="Grade Status" value="{!a.Grade_Index__c}" style="width:5%">
                
            </apex:column>
       </apex:pageBlockTable>
       </apex:outputPanel>
       </apex:repeat>
    </apex:pageBlockSection>
    
</apex:pageBlock>
</apex:form>
<apex:tabPanel >
<apex:tab label="Client Attendees" name="Client Attendees" >
    <apex:relatedList subject="{!Client_Visit_Report__c}" list="Client_Attendees__r"/>
    </apex:tab>
    </apex:tabPanel>
            
</apex:page>
 
public with sharing class MatrixPageContoller {
public String currentRecordId {get;set;}
public List<Client_Visit_Report__c> cvrLst;
public List<Id> tpLst;
public List<Id> clientLst;
public List<Id> ClientRelation;
public List<Client_Relationships__c> cliRel;
public Map<string, List<Client_Relationships__c>> tpCliMap{get;set;}
public Client_Relationships__c crel{get;set;}
public string selectedvalue1{get;set;}
public string selectedvalue2{get;set;}
public list<Contact> ConList {get;set;}
public id relShipId {get;
                    set {
                        relShipId = value;
                                 
                        }
                    }
public string relShipType{get;
                            set {
                                relShipType= value;  
                                         
                                } 
                         }
public string relShipGrade{get;
                            set {
                                relShipGrade= value;
                                           
                                }
                         }
public String newGrade{get;

        set {
            newGrade = value;
            
        }
    }
//System.debug('============Id=============>>'+relShipId);
       // System.debug('=============Type============>>'+relShipType);
        //System.debug('=============Grade============>>'+relShipGrade);
        
    public MatrixPageContoller(ApexPages.StandardController controller) {
        relShipId = ApexPages.CurrentPage().getparameters().get('Yogi');
       relShipType = ApexPages.CurrentPage().getparameters().get('Type');
       relShipGrade = ApexPages.CurrentPage().getparameters().get('Grade');
       //this.myLead = (Client_Relationships__c)controller.getrecord();
        //selectedvalue2 = '(A) I can pick the phone up to this contact right now and discuss a contentious issue';
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        system.debug('PSM1 '+ currentRecordId);
        cvrLst = new List<Client_Visit_Report__c>([Select id,(Select Id, TP_Personnel__c From TP_Attendee__r), (Select Id, Contact_Name__c From Client_Attendees__r) From Client_Visit_Report__c where id =: currentRecordId]);
        
        system.debug('PSM2 '+ cvrLst);
        tpLst = new List<Id>();
        clientLst = new List<Id>();
        crel = new Client_Relationships__c();
        for(Client_Visit_Report__c cv: cvrLst){
            for(TP_Attendees__c tp: cv.TP_Attendee__r){
                tpLst.add(tp.TP_Personnel__c);
            }
            
            for(Client_Attendee__c ca: cv.Client_Attendees__r){
                clientLst.add(ca.Contact_Name__c);
            }
            
        }
        system.debug('PSM3 '+ clientLst.size()+ clientLst);
        system.debug('PSM4 '+ tpLst.size()+ tpLst);
        cliRel = new List<Client_Relationships__c>([select id,Grade_Index__c, TP_Employee__r.Name, Client__c, Relationship_Grade__c,Relationship_Grade_2__c,Previous_Grade__c, Relationship_Type__c from Client_Relationships__c where Client__c in:clientLst and TP_Employee__c in: tpLst]);
        system.debug('PSM5 '+ cliRel.size());
        tpCliMap = new Map<string, List<Client_Relationships__c>>();
        
        for(Client_Relationships__c cr: cliRel){
            If(!tpCliMap.containsKey(cr.TP_Employee__r.Name)){
                system.debug('Inside for if '+ cr);
                tpCliMap.put(cr.TP_Employee__r.Name, New List<Client_Relationships__c>());
            }
                system.debug('Inside for else '+ cr);
                tpCliMap.get(cr.TP_Employee__r.Name).add(cr);
           
        }
        
        system.debug('tpCliMap '+ tpCliMap.values());
        
    }
    
    
    public void updateClientRelShip() {
        relShipId = ApexPages.CurrentPage().getparameters().get('Yogi');
        relShipType = ApexPages.CurrentPage().getparameters().get('Type');
        relShipGrade = ApexPages.CurrentPage().getparameters().get('Grade');
        System.debug('============Id=============>>'+relShipId);
        System.debug('=============Type============>>'+relShipType );
        System.debug('=============Grade============>>'+relShipGrade );
        Client_Relationships__c clientRelationShip = new Client_Relationships__c (id = relShipId, Relationship_Type__c = relShipType ,Relationship_Grade__c = relShipGrade  );
         
        Id myId = clientRelationShip.id;
        system.assertEquals(Schema.Client_Relationships__c.SObjectType, myId.getSobjectType());
        update clientRelationShip;
        
       
    }
    
}

 
I am looking for roll summary Triggers for two Objects, But they dont have any relationship either ( Master or Look ), But they both are child for Account...

Object A__c :  Account, TextField__c  & NumberField__c
Object B__c :  Account, TextField1__c  & Totalsum__c

I want to Match TextField__c from (Object A) & TextField1__c ( Object B ) If vaule is same, then do the aggregate for  NumberField__c and display it on Totalsum__c from Object B

Please do needful...

 
Based on Picklist vaule, i want to display the pageblock .Only one picklist value is working properly. But when i am selecting the other vaules the repective page block is not working. Please lookinto the issue and kindly let me know your inputs. Only "ApexClass Permission" this pick list is working properly 

public class display { 
    public display(ApexPages.StandardController controller) {

    }
   
    //To store the picklist value which we have selected on VF page i.e (Ind, Aus, USA)
    public String country { get; set; }    
    
    //To display list of picklist values on VF page
    public List<selectOption> getPicklistvalues() {
        List<selectOption> options = new List<selectOption>();       
        options.add(new selectOption('None','None'));
        options.add(new selectOption('FLS','FLS'));
        options.add(new selectOption('Object Permission','Object Permission'));
        options.add(new selectOption('ApexClass Permission','ApexClass Permission'));
        options.add(new selectOption('Others','Others'));
        return options;
    }   

    //To make three pageblocksections invisible by default
    public Boolean indtf = false;
    public Boolean Ind1tf = false;
    public Boolean Ind2tf = false;
    public Boolean Ind3tf = false;
    public Boolean austf = false;
    public Boolean usatf = false;
       
    //To dynamically pass Boolean values to rendered attribute on pageblocksection
    public void setInd(Boolean a) {
        this.indtf = a;
    }
    public Boolean getInd() {
        return this.indtf;
    }    
    
    public void setAus(Boolean b) {
        this.austf = b;
    }
    public Boolean getAus() {
        return this.austf;
    }
    
    public void setInd1(Boolean b) {
        this.Ind1tf = b;
    }
    public Boolean getInd1() {
        return this.Ind1tf;
    }
    
    public void setUsa(Boolean b) {
        this.usatf = b;
    }
    public Boolean getUsa() {
        return this.usatf;
    }
   
    public void setInd2(Boolean b) {
        this.Ind2tf = b;
    }
    public Boolean getInd2() {
        return this.Ind2tf;
    }
     public void setInd3(Boolean c) {
        this.Ind3tf = c;
    }
    public Boolean getInd3() {
        return this.Ind3tf;
    }
 
    //Constructor, After loading the page to display india pageblocksection by default
    public display() {
        setInd(True);
        setInd1(True);
        setInd2(True);
        setInd3(True);
    }
    
    //After changing picklist value based on the selection to display either usa or aus pageblocksection
    //Through actionfunction or actionsupport this method will be called to VF page
    public PageReference selectcountry() {
        if(country == 'FLS') {
            setInd(True);
            setInd1(False);
            setInd2(False);
        }
        else {
            setInd(True);
            setInd1(False);
            setInd2(False);
        }
        return null;
    }
    
    public PageReference ApexClass() {
        if(country == 'ApexClass Permission') {
            setInd(False);
            setInd1(False);
            setInd2(False);
            setInd3(True);
        }
        else {
            setInd(False);
            setInd1(False);
            setInd2(False);
            setInd3(False);
        }
        return null;
    }
}


VF Page:

<apex:page standardController="Post_Deployment_Step__c" extensions="display">

    <apex:form >
    
    <apex:pageBlock >
    <apex:pageBlockSection title="Select the Type">
    <apex:outputLabel > <b>Input Data Type : </b> </apex:outputLabel>
      
      <!--<apex:actionFunction action="{!selectcountry}" name="fun"/>
      <apex:selectList size="1" value="{!country}" onchange="fun();">-->
      </apex:pageBlockSection>
      <apex:selectList size="1" value="{!country}">
      <apex:actionSupport event="onchange" action="{!selectcountry}" />
      <apex:actionSupport event="onchange" action="{!ApexClass}" />
        &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
      <br><apex:selectOptions value="{!picklistvalues}">
          </apex:selectOptions></br>
      </apex:selectList>
      </apex:pageBlock>
      <apex:pageBlock >
         <apex:pageBlockButtons id="btns" title="Save">
          <apex:commandButton value="Save" action="{!save}"/>
          <apex:commandButton value="Edit" action="{!edit}" id="btnEdit" /> 
          <apex:commandButton id="btnCancel" value="Cancel" action="{!cancel}"/> 
       </apex:pageBlockButtons>
      
       <!--renderd to display or hide the pageblocksection on any other element of VF page-->
       
       <apex:pageBlockSection title="Information" columns="2" collapsible="false">
          <apex:inputField value="{!Post_Deployment_Step__c.name}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.For_Master_Tracker__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Release2__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.For_Daily_Build__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Type__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Tracks__c}"/>
          
          <apex:inputField value="{!Post_Deployment_Step__c.Comments__c}"/>
          
       </apex:pageBlockSection>
       
       <apex:pageBlockSection title="Enter FLS Information" rendered="{!Ind}" columns="1" collapsible="false">
           <b>*Note All the Fields are Mandatory</b>
               
              <apex:inputField value="{!Post_Deployment_Step__c.Object_Name__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Object_Type__c}"/>
             
              <apex:inputField value="{!Post_Deployment_Step__c.Object_API_Name__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Filed_API_NAME__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Filed_Label__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Field_Type__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Profile_list_for_only_Visible_access_Ye__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Profile_list_for_Visible_Read_only_Ye__c}"/>
              <apex:inputField value="{!Post_Deployment_Step__c.Profile_list_for_No_Access_No_No__c}"/>
              
     </apex:pageBlockSection>
       
       <apex:pageBlockSection title="Enter Object Permission Information" rendered="{!Ind1}" columns="2" collapsible="false">
           <b>*Note All the Fields are Mandatory</b>
           
         
          <apex:inputField value="{!Post_Deployment_Step__c.Profile_Name__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Object_Name__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Object_Type__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Section__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Read_Yes_No__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Create_Yes_No__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Edit_Yes_No__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Delete_Yes_No__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.View_All_Yes_No__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Modify_All_Yes_No__c}"/>
          
          </apex:pageBlockSection>
          
          <apex:pageBlockSection title="Enter Apex Class Name" rendered="{!Ind3}" columns="1" collapsible="false">
           <b>*Note All the Fields are Mandatory</b>
           
         
          <apex:inputField value="{!Post_Deployment_Step__c.Apex_Class_Name__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Profiles_to_be_Added__c}"/>
          <apex:inputField value="{!Post_Deployment_Step__c.Profiles_to_be_Removed__c}"/>

          
          
          </apex:pageBlockSection>
       
       <apex:pageBlockSection title="Others" rendered="{!Ind2}">
           <b>Need to Display  Fields as per Input Files</b>
       </apex:pageBlockSection>
      
       
      </apex:pageBlock>
      


    </apex:form>
   
</apex:page>

 
I have a picklist on a standard visualforce page. Based on the piclist value i want to display different page block section on the bottom of the page. I.e i want to divide the page in two sections.
Hi All,

I am looking for a batch apex where i can add some string to the end of the email ID to make it inactive. ex: abc_123@gmai.com+007
some vaule at the end of the email ID. I have a free text where users enters multiple email addresses in this ( Format: salesforce@yahoo.com;sdfc@hotmail.com;developer_sdfc@aol.com). Now i have a batch apex which adds a dummy string at the end of the value in the that field. However i want to add a dummy string after every .com. So how should i find that .com from that field and add some sting to it using batchapex.

Thank you
Hi,

I want to get values from work bench REST API Explorer Limits to a custom object fields. My main requirement is to create dashboards and refresh based on the values in the fields from REST API Explorer Limits. Right now i am entering the REST API Explorer Limits components values manually to the fields. But i want the values to be automatically import into the custom object. This is the end point url  '/services/data/v37.0/limits' . From the below screen, i want to import Max and remaining values for each component to custom object. I am new to REST API and can you please give me a basic idea to get the values from work bench REST Explorer Limits automatically and import to my object.
User-added image
I have a picklist on a standard visualforce page. Based on the piclist value i want to display different page block section on the bottom of the page. I.e i want to divide the page in two sections.
Hi All,

I am looking for a batch apex where i can add some string to the end of the email ID to make it inactive. ex: abc_123@gmai.com+007
some vaule at the end of the email ID. I have a free text where users enters multiple email addresses in this ( Format: salesforce@yahoo.com;sdfc@hotmail.com;developer_sdfc@aol.com). Now i have a batch apex which adds a dummy string at the end of the value in the that field. However i want to add a dummy string after every .com. So how should i find that .com from that field and add some sting to it using batchapex.

Thank you