• ramlakhan
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 16
    Replies
I have an idea that the certification is an additonal level of security measure on top of basic authentication or oAuth.But I heard of certificate can be used directly to establish secure connection without even using basic authentication or oAuth.Is there any truth in it? The context is soap based integration where a soap based system wants to fetch data from salesforce.
Hello,

I am writing a trigger on attachment  where I need to check whether the value of a   field of the  custom object  is  contained in  the email subject line of the email  added as an attachment to the custom object .

Here I  tried converting the attachment blob to string ,but unfortunately its throwing UTF 8 error.I used other methods of EncodingUtil ,but it couldn't help much .

My intention is to decode the email content as a  string without any alteration,then comparing.

Say, field value='Hello'

and the email subject ='RE:Hello'

I want  attachment email blob to  convert into  'RE:Hello'.


(Inbound email handler is outta  context as here email message is added as an attachment  to custom object).

Thanks to all you wonderful guys here !
 
Hi Guys,
Following going through the salesforce docs,I came across the below code snipet. On change event calls java script function rerenderStates ,which is nonewhere defined on the page ,is that created by default? Also Param has blank value ,how's country passed to param?The code is working fine.Throgh param country  value selected is passed to country variable in controller and accordingly the dependent picklist show the values.
<apex:page controller="CountryStatePicker">
   <apex:form >
      <apex:actionFunction name="rerenderStates" rerender="statesSelectList" >
          <apex:param name="firstParam" assignTo="{!country}" value="" />
      </apex:actionFunction>

   <table>
      <tr>
        <th>Country</th>
          <td>
             <apex:selectList id="country" styleclass="std" size="1" 
                value="{!country}" onChange="rerenderStates(this.value)">
                    <apex:selectOptions value="{!countriesSelectList}"/>
             </apex:selectList>
          </td>
      </tr>
      <tr id="state_input">
        <th>State/Province</th>
          <td>
            <apex:selectList id="statesSelectList" styleclass="std" size="1" 
                 value="{!state}">
                   <apex:selectOptions value="{!statesSelectList}"/>
            </apex:selectList>
          </td>
      </tr>
   </table>
   </apex:form>
</apex:page>


Thanks in advance!
Hi ,
Whats's the difference between:
List<Account> a=[Select id,name from account];
&
List<Account> a=new List<Account>([ Select id,name from account]);
Thanks in advance.
I am quite confused about  use cases of standard list and set controllers.I see std set cntrl has much  more flexibility and additional methods(hasnext()..etc) which makes pagination and many more things quite simple.These both controllers seem to have almost same functionality .Yeah ,I see std set controller is standalone (doesn't require std cntrl ).Can anybody please let me know some use cases which can  draw the hard difference  line between the  two explaining where to use std set and where to use std List cntrls.  Any useful comment is highly appreciated! Thanks in advance!
I want to remove a report and dashboard folder sharing access for users  of particaular profile.I don't see any way do that in salesforce and analytics doesn't seem to be too flexible in salesforce.Could anybody suggest how to restrict access to a report folder for users of particular profile. 
Any good  suggestion is appreciable. Thanks.
 
Hi Friends,

Scenario: Object A has two contact look up fields.I want  to update the first look up field from  a look up field available on the second look up field.I have accomplished this via a trigger.But I came across something which totally blew away my mind.

I want to populate MasterContactrecord__c field of object A from a look up field Master_Contact_Record__c available on the another lookup on object A -  Opportunity_Contact__c.



Trigger 1: runs successfully and accomplishes the requirement
******************
trigger populate1 on A (before insert,before update) {

Set<Id> set_OpportunityContactIDs = new Set<Id>();

For(A ocr : trigger.new)

if(ocr.Opportunity_Contact__c!=null)
{
set_OpportunityContactIDs.add(ocr.Opportunity_Contact__c);
}

Map<Id,Contact> map_MasterContactRecord = new Map<Id,Contact>
    (   [   SELECT  Master_Contact_Record__c
            FROM    Contact
            WHERE   Id IN :set_OpportunityContactIDs
        ]
    );
    
    
for ( A ocr1: trigger.new )
    {
        if(ocr1.Opportunity_Contact__c!=null)
        ocr1.MasterContactrecord__c = map_MasterContactRecord.get( ocr1.Opportunity_Contact__c ).Master_Contact_Record__c;
    }
}
********************
Trigger 2:Saves succesfully but doesn't work.Why?if I used the same relationship  I used here in quey editor,it returns the exact record I want.
trigger populate on A (before insert,before update) {

For(A ocr : trigger.new)
{
if(ocr.Opportunity_Contact__r.Master_Contact_Record__c!=null)
{
ocr.MasterContactrecord__c=ocr.Opportunity_Contact__r.Master_Contact_Record__c;
//ocr.MasterContactrecord__c=ocr.Opportunity_Contact__r.Master_Contact_Record__r.Id; This seem correct but doesn't return anything in quey editor.
}

}



Is there something I am missing.Pointing to any mistake is highly appreciable!!
This code is giving an error in tabindex.This tabindex is not available in component library.The code snipet is from visualforce guide.Could you please tell if there is any versionong issue or anything?
<apex:page standardController="Account">
    <apex:form>
    <apex:pageBlock title="Edit Account: {!Account.Name}">
        <apex:pageBlockSection title="Account Details" columns="1">
            <apex:inputField value="{!Account.Name}" tabIndex="4"/>
            <apex:inputField value="{!Account.Website}" tabIndex="3"/>
            <apex:inputField value="{!Account.Industry}" tabIndex="2"/>
            <apex:inputField value="{!Account.AnnualRevenue}" tabIndex="1"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Thanks in advance.
  whoid field on event :
  In an event record there are multiple contacts in name(whoid) field.
  but when I am querying it, I am just getting one contact Id.
  Do you know any way to get all contacts in whoid?
  Thanks in advance for any help.  
Scenario: We have a custom object  A and its child MemebrofA. MemebrofA has lookup field to user object,named Amember   .I want to have a  list view which will show all A records for which corresponding MemebrofA has   Amember as logged in user.This view is similar to any other list view .I tried with standard functionality but its not possible.
Thanks in advance.
I tried indexof and charat too.But its not working.I  want to pass this query to Database.querylocator obejct of batch class.Thanks in advance!
How can we rename a standerd related list on a  particular page layout?This is auto created activity(task) related list on opportunity.

Ways to do this:
renaming via relationship field: this is not applicable as changes will appear across entire org.
translation using translation  workbench :this can be helpful.but i see this is not available in this case. (task are created due to workflow on opportunity and apper under activity history or Open activity related list.these two realted list are standerd one and not avilable  in workbench ).
visulaforce section: is this possible or best solution if we want just to rename related list?
javascript component: no idea ,how to do tht?
Thanks in advance.
Hi All,
An apex job is running properly in production but  not in sandboxes.Also its not showing up in the monitor section.Can this be due to sandbox refresh?Or what can be any other reason?Scheduler and other apex class are as same as production. Thanks in advance.
Ive been writing a class that looks updates a tick box on a custom object. Ive written a test class for it but the the life of me I cannot figure out how to get my test class working.

So this is my Apex Class
global class KPMRefresh implements Schedulable{
  global void execute(SchedulableContext sc){
    List<Metric_Controller__c> lstofMC = [SELECT Id, Refresh_Metrics__c, Which_Month_Boolean__c, Active__c 
                                          FROM Metric_Controller__c 
                                          WHERE Which_Month_Boolean__c = true AND Active__c = true 
                                          LIMIT 200];

    List<Metric_Controller__c> lstofupdatedMC = new list<Metric_Controller__c>();
    if(!lstofMC.isEmpty()){
      for(Metric_Controller__c Id : lstofMC){
        lstofupdatedMC.add(id);
              Id.Refresh_Metrics__c = true;    
        }
             
      UPDATE lstofupdatedMC;
    }

  }
}
This is my test class.
@isTest
private class KPMRefreshTest {
  @testSetup
    static void setup(){
        List<Metric_Controller__c> lstofMC = new List<Metric_Controller__c>();
        for(Integer i = 1; i <= 200; i++){
            Metric_Controller__c Id = new Metric_Controller__c(Refresh_Metrics__c = false);
          lstofMC.add(id);
      }
        Insert lstofMC;   
    }
    
    static testmethod void testKPMRefreshScheduledJob(){
        String sch = '0 5 12 * * ?';
        Test.startTest();
        String jobId = System.schedule('ScheduledApexText', sch, new KPMRefresh());
        
        List<Metric_Controller__c> lstofMC = [SELECT Id, Refresh_Metrics__c FROM Metric_Controller__c WHERE Which_Month_Boolean__c = true AND Active__c = true LIMIT 200];
        
        system.assertEquals(200, lstofMC.size());
        Test.stopTest();   
    }   
}

Ive spent a few hours looking at this and cannot see what im missing. 
 
Hello,

I am writing a trigger on attachment  where I need to check whether the value of a   field of the  custom object  is  contained in  the email subject line of the email  added as an attachment to the custom object .

Here I  tried converting the attachment blob to string ,but unfortunately its throwing UTF 8 error.I used other methods of EncodingUtil ,but it couldn't help much .

My intention is to decode the email content as a  string without any alteration,then comparing.

Say, field value='Hello'

and the email subject ='RE:Hello'

I want  attachment email blob to  convert into  'RE:Hello'.


(Inbound email handler is outta  context as here email message is added as an attachment  to custom object).

Thanks to all you wonderful guys here !
 
Hi Guys,
Following going through the salesforce docs,I came across the below code snipet. On change event calls java script function rerenderStates ,which is nonewhere defined on the page ,is that created by default? Also Param has blank value ,how's country passed to param?The code is working fine.Throgh param country  value selected is passed to country variable in controller and accordingly the dependent picklist show the values.
<apex:page controller="CountryStatePicker">
   <apex:form >
      <apex:actionFunction name="rerenderStates" rerender="statesSelectList" >
          <apex:param name="firstParam" assignTo="{!country}" value="" />
      </apex:actionFunction>

   <table>
      <tr>
        <th>Country</th>
          <td>
             <apex:selectList id="country" styleclass="std" size="1" 
                value="{!country}" onChange="rerenderStates(this.value)">
                    <apex:selectOptions value="{!countriesSelectList}"/>
             </apex:selectList>
          </td>
      </tr>
      <tr id="state_input">
        <th>State/Province</th>
          <td>
            <apex:selectList id="statesSelectList" styleclass="std" size="1" 
                 value="{!state}">
                   <apex:selectOptions value="{!statesSelectList}"/>
            </apex:selectList>
          </td>
      </tr>
   </table>
   </apex:form>
</apex:page>


Thanks in advance!
I have to create a soql query on accounts object, to get the records with same account name.
Hi Friends,

Scenario: Object A has two contact look up fields.I want  to update the first look up field from  a look up field available on the second look up field.I have accomplished this via a trigger.But I came across something which totally blew away my mind.

I want to populate MasterContactrecord__c field of object A from a look up field Master_Contact_Record__c available on the another lookup on object A -  Opportunity_Contact__c.



Trigger 1: runs successfully and accomplishes the requirement
******************
trigger populate1 on A (before insert,before update) {

Set<Id> set_OpportunityContactIDs = new Set<Id>();

For(A ocr : trigger.new)

if(ocr.Opportunity_Contact__c!=null)
{
set_OpportunityContactIDs.add(ocr.Opportunity_Contact__c);
}

Map<Id,Contact> map_MasterContactRecord = new Map<Id,Contact>
    (   [   SELECT  Master_Contact_Record__c
            FROM    Contact
            WHERE   Id IN :set_OpportunityContactIDs
        ]
    );
    
    
for ( A ocr1: trigger.new )
    {
        if(ocr1.Opportunity_Contact__c!=null)
        ocr1.MasterContactrecord__c = map_MasterContactRecord.get( ocr1.Opportunity_Contact__c ).Master_Contact_Record__c;
    }
}
********************
Trigger 2:Saves succesfully but doesn't work.Why?if I used the same relationship  I used here in quey editor,it returns the exact record I want.
trigger populate on A (before insert,before update) {

For(A ocr : trigger.new)
{
if(ocr.Opportunity_Contact__r.Master_Contact_Record__c!=null)
{
ocr.MasterContactrecord__c=ocr.Opportunity_Contact__r.Master_Contact_Record__c;
//ocr.MasterContactrecord__c=ocr.Opportunity_Contact__r.Master_Contact_Record__r.Id; This seem correct but doesn't return anything in quey editor.
}

}



Is there something I am missing.Pointing to any mistake is highly appreciable!!
I tried indexof and charat too.But its not working.I  want to pass this query to Database.querylocator obejct of batch class.Thanks in advance!
How can we rename a standerd related list on a  particular page layout?This is auto created activity(task) related list on opportunity.

Ways to do this:
renaming via relationship field: this is not applicable as changes will appear across entire org.
translation using translation  workbench :this can be helpful.but i see this is not available in this case. (task are created due to workflow on opportunity and apper under activity history or Open activity related list.these two realted list are standerd one and not avilable  in workbench ).
visulaforce section: is this possible or best solution if we want just to rename related list?
javascript component: no idea ,how to do tht?
Thanks in advance.
Hi All,
An apex job is running properly in production but  not in sandboxes.Also its not showing up in the monitor section.Can this be due to sandbox refresh?Or what can be any other reason?Scheduler and other apex class are as same as production. Thanks in advance.
Hi 
i have created this simple trigger but i don't know how to do a test class.
please help me, it looks simple trigger and i suppose that is a simple test class.

trigger Block_Unblock_RejectionsTriger on QA_Order_Control__c (before insert,before update) {


for (QA_Order_Control__c objqaoc : Trigger.new)

{
if  (objqaoc.Reject_team__c!=null  )

   {
    objqaoc.Was_Created__c= true;
   
     }
   else {
    objqaoc.Was_Created__c= false;
         }
}


Can Body help me What are the static variables in salesforce..? give me some examples..