• sfdc fresher
  • NEWBIE
  • 16 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 40
    Questions
  • 25
    Replies
hi everyone,

why we need to mention without sharing keyword, eventhough by default it is without sharing
hi everyone,

As part of some requirement, i created 2 lookup fileds on contact.And I want to use those fileds in process builder.I see only one lookup and unable to find another.
what might be the reson and how to solve this. could anyone help me 
i want to print the account names in 3 columns(3 differnt types of accounts) , i need to add the heading to those columns like Accoun1..Account 2 and Account 3, and need to disply the in columns. kindly help me how to achieve this. 

controller logic:
public class DisplayRecordsDatewise {

        List<Account> act1;
        List<Account> act2;
        List<Account> act3;
    public List<Account> getAccounts1()
    {
        act1=[select id,name from Account where createdDate!=Yesterday limit 10];
        return act1;
     }
     public List<Account> getAccounts2()
    {
        act2=[select id,name from Account where createdDate!=Last_WEEK limit 10];
        return act2;
     }
     public List<Account> getAccounts3()
    {
        act3=[select id,name from Account where createdDate=LAST_N_DAYS:120];
        RETURN act3;
     }
    
}
vf logic:
<apex:page controller="DisplayRecordsDatewise">
    <apex:form >
    <apex:pageblock >
        
        <apex:pageBlockSection columns="3">
           
             <apex:dataList value="{!Accounts1}" var="a">
                <apex:outputText value="{!a.name}" />
            </apex:dataList>
            <apex:dataList value="{!Accounts2}" var="a">
               <apex:outputText value="{!a.name}" />
            </apex:dataList>
           <apex:dataList value="{!Accounts3}" var="a">
                <apex:outputText value="{!a.name}" />
            </apex:dataList>
         </apex:pageBlockSection>
      </apex:pageBlock>
   </apex:form>
</apex:page>
how to control the access of records to just above its hirerachy (not to all users above its role)
When ever I try to change the object acces in a profile, am getting below error. i see some objects dont have dependency but still not able to make any changes.

Error: Invalid Data. 
Review all error messages below to correct your data.
• Permission Create Work Parts depends on permission(s): Read Cases
• Permission Delete Work Parts depends on permission(s): Read Cases
• Permission Edit Work Parts depends on permission(s): Read Cases
• Permission Read Work Parts depends on permission(s): Read Cases
i set owd as Private for Account, using the role hirearchy want to see the records of below user. but unable to see it. could anyone help me
i AM getting below error
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Int4_DuplicateEmailCheck caused an unexpected exception, contact your administrator: Int4_DuplicateEmailCheck: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Int4_DuplicateEmailCheck: line 16, column 1


Code is below.



trigger DuplicateEmailCheck on Contact (before insert,before update) {

    Set<Id> cid=new Set<ID>();
    for(Contact c:Trigger.new)
    {
        if(c.Email!=NUll)
        {
           cid.add(c.id); 
        } 
    }
    Map<ID,Contact> mcp=new Map<Id,Contact>([select id,Email from Contact where Id in :cid]);
   
   for(Contact c:Trigger.new)
   {
       if(c.Email!=null && ((mcp.get(c.Id)).Email)A==c.Email)
       {
           c.addError('Email Cant be duplicated');
        }
   }
}
hi team, 
Could you please provide the logic for below :
Need to throw an error while creating a contact when the account has its phone filed blank.
(provide the trigger logic)
hi everyone,

I want to update DOB filed of contact which has data type DATE/TIME by using batch. I have written below code. but am getting below error. could anyone please suggest me.
ERROR: Expecting colon,but found dt1
Could anyone please suggest the query for this and below is my code


global class Sample_Contactupdate_Batch implements Database.batchable<SObject> {
    public Datetime CreatedDate {set;get;}
    global database.QueryLocator start(Database.BatchableContext jobid)
    {
       
         date dt1=date.today();
        date dt2=date.valueOf(CreatedDate);
        String query='select id,name, DOB__c from Contact where dt2<=dt1';
          return  database.getQueryLocator(query);
        // we can query upto 50 million records
    }
    global void execute(Database.BatchableContext jobid,list<Contact> scope)
    {
        List<Contact> ctc=new List<Contact>();
        //Contact c=new Contact();
        for(Contact c:scope)
        {
           c.DOB__c = CreatedDate+13;
           ctc.add(c);
        }
        update ctc;
    }
    global void finish(database.BatchableContext jobid)
    {
        
    }

}
Hi ,

Could anyone please explain me to set the filed level security to mandatory fileds of an object.

 
hi everyone,

I see from doc that "even though one filed is requried on pagelayout, if we set the filed level security as Read only..then we cant edit that filed ....."..

but am unable to set to particular filed as Readonly becoz its required filed..(object>fileds>particular filed>set the filed level security...i couldnt see any edit option there...i see just save and cancel buttons are avaible).
Could any one please suggest me how can i achieve this.

Thanks
 
What is the use of refreshing the sandbox? and what we do directly in production without using sandbox..
and the objects and records we create are in sandbox ? can we do them in production directly?
Hi everyone,

could anyone give me the simple and clear explanation of meta data along with examples in salesforce. I would be greatful if you give the explantion instead of sharing the links ...
what is the use of this and any impacts/any precautions we should take care when we do some developement.

Thanks
hi everyone,
could anyone please explain me how to perform actions like(insert,update etc) when the vf page is loaded.



Thanks
hi everyone,
can we use rollup fileds and formulae fileds in validation rules? do we face any while using them in validation rules 
hi folks,

I just want to navigate to account edit page/print/delete page of the partilcualr record of account of vf page.could anyone please provid me the code.

<apex:column headervalue="Action"> 
<apex:commandLink action="/{!Account.id}">Edit</apex:commandLink>
<apex:commandLink action="/{!Account.id}">print</apex:commandLink>
<apex:commandLink action="/{!Account.id}">delete</apex:commandLink>
</apex:column
hi folks, 
could any one please explain me :
when we write the code in the constructor, once we create the object automatically consturctor called.
But what is the use if we use that class in Visualforce page as controller, we dont create any object there right?
 what if we write the code in constructor. Could anyone please explain me.
I see below code ,what happens when we write this.
 public     AccountAndContacts()
    {
        accs=new Account();
        cts=new list<Contact>();
        add();
    }

Thanks...
hi everyone,
 I have wrtten below code and i want to use this in vf page. inorder to call the list account records, what must the value that I have to use in Pageblock table value. Could anyone explain me please ???.
public class Pagination_Example_Account {
    public Apexpages.StandardSetController controler {set;get;}
    public Integer size {set;get;}
    
    public Pagination_Example_Account()
    {
        List<Account> acc=[select Id,name from Account];
        
        controler= new Apexpages.StandardSetController(acc);
        controler.setPageSize(5);
    }
    public List<Account> act()
    {
        List<Account> ac=(List<Account>)controler.getRecords();
        return ac;
    }

}
vf code::
<apex:page controller="Pagination_Example_Account">
    <apex:form>
        <apex:pageBlock>
        <apex:pageBlockTable value="{!accounts}" var="a">
            <apex:column value="{!a.name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
<apex:page>
    
User-added image
what is stanadrad set controller and how to use it?
Could anyone give me example with scenario( could you try to give the explanation apart from tagging the links/ document of salesforce).

 
hi everyone,

As part of some requirement, i created 2 lookup fileds on contact.And I want to use those fileds in process builder.I see only one lookup and unable to find another.
what might be the reson and how to solve this. could anyone help me 
We have been using Salesforce for about 3 years and at this point some of our Accounts have an unmanagable number of related Opportunities. I would like to create a related list that supressed Opportunities with the StageName of Close Won or Closed Lost. I understand the functionality of filtering a related list does not exist out of the box, but I think there is a way to accomplish this by embedding a Visual Force page. Item of note: all of our users use the Lightning Experience.

Any thoughts on where to start or if someone has handle this before I would welcome your insights.
i set owd as Private for Account, using the role hirearchy want to see the records of below user. but unable to see it. could anyone help me
hi team, 
Could you please provide the logic for below :
Need to throw an error while creating a contact when the account has its phone filed blank.
(provide the trigger logic)
Hi

My scenario is :
Billing Document:Parent
Billing Item:Child
I need a detion trigger to delete Billing Item with Unit Price=0/Blank and Subsegment=Undefined.

Note:Billing document can also be created from SAP.So if any Billing Item with above mentioed criteria is there it should also get deleted
Thanks!!
 
List<CaseMilestone> lp_setmstones = new List<CaseMilestone>();

	Set<Id> mstoneIDs = new Set<Id> ();
	LIST<CaseMilestone> setmstones;
    for (CaseMilestoneSetting__c CMileS : CMileSs){
        mstoneIDs.add(CMileS.MilestoneID__c);      
    }
	// Find all CaseMilestones matching our criteria in our caselist
	if(system.test.isRunningTest()) {
		setmstones = Database.query('Select ID,MilestoneTypeID,CompletionDate FROM CaseMilestone WHERE CaseID IN:caselist AND MilestoneTypeID IN :mstoneIDs AND CompletionDate=NULL');
	}  
	else {
		setmstones = Database.query('Select ID,MilestoneTypeID,CompletionDate FROM CaseMilestone WHERE '+
                                                        CMileS.CaseCriteria__c+
                                                        'AND CaseID IN:caselist AND MilestoneTypeID IN :mstoneIDs AND CompletionDate=NULL');
	}
	
	// Update the CompletionDate for each CaseMilesone
	for (CaseMilestone updatemstone : setmstones){
		updatemstone.CompletionDate= Datetime.now();
	}
	// Execute the update for all the Milestones in this set
	lp_setmstones.addAll(setmstones);
hi everyone,

I want to update DOB filed of contact which has data type DATE/TIME by using batch. I have written below code. but am getting below error. could anyone please suggest me.
ERROR: Expecting colon,but found dt1
Could anyone please suggest the query for this and below is my code


global class Sample_Contactupdate_Batch implements Database.batchable<SObject> {
    public Datetime CreatedDate {set;get;}
    global database.QueryLocator start(Database.BatchableContext jobid)
    {
       
         date dt1=date.today();
        date dt2=date.valueOf(CreatedDate);
        String query='select id,name, DOB__c from Contact where dt2<=dt1';
          return  database.getQueryLocator(query);
        // we can query upto 50 million records
    }
    global void execute(Database.BatchableContext jobid,list<Contact> scope)
    {
        List<Contact> ctc=new List<Contact>();
        //Contact c=new Contact();
        for(Contact c:scope)
        {
           c.DOB__c = CreatedDate+13;
           ctc.add(c);
        }
        update ctc;
    }
    global void finish(database.BatchableContext jobid)
    {
        
    }

}
hi everyone,

I see from doc that "even though one filed is requried on pagelayout, if we set the filed level security as Read only..then we cant edit that filed ....."..

but am unable to set to particular filed as Readonly becoz its required filed..(object>fileds>particular filed>set the filed level security...i couldnt see any edit option there...i see just save and cancel buttons are avaible).
Could any one please suggest me how can i achieve this.

Thanks
 
hi everyone,
can we use rollup fileds and formulae fileds in validation rules? do we face any while using them in validation rules 
Hi all,
in which triggers, we cant use DML Statments.could anyone please explain me


 
Hi all,

I have a requirement like: Whenever the Accounts are updated , related contacts should get the mail from Finsh method in Batch apex.

Could you please help me in this. 

thanks,
Padmavathi Ch
hi all,
I have written below code.I am getting success response but unable to see the eMAIL template in the contacts that are targetted. Could anyone please look into this?
public class MassEmailMessagingApex{
    

    public void SendEmail() {
   List<contact> lstcon=[Select id from contact limit 2];
   List<Id> lstids= new List<Id>();
   for(Contact c:lstcon) {
  lstids.add(c.id);
 }
 EmailTemplate et=[Select id from EmailTemplate where name = 'CourseName_Fee' limit 1];
 
 Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
 mail.setTargetObjectIds(lstids);
 mail.setSenderDisplayName('System Admin');
 mail.setTemplateId(et.id);
 Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
}
    }

Hi all,

 

I'm a Salesforce developer with 2 years of experience. Recently i've decided to give my certification. I have found that even after 2 years of experience i find many questions in dumps difficult to answer.

 

Is creating the Recruitment app essential to crack the exam?  I also found I need to memorise  a lot of numerical data related to salesforce Limits.

 

My friend suggested that going through all of the dumps available is enough to crack the exam. Is it enough if i go through all the available dumps and learn the ones i couldnt answer ?

 

Please let me know as i'm deciding to give the exam by next week.

 

Hi,

 

  I want to display the account and related contacts in the same visual force page. Actually i am achieved this like,

i am displayed the account names in first page block and am kept the command link for that account names if we click on that command link that will displayed the contacts related to that particular account in another pageblock. But, Now i want to display the account name first and all related contacts line by line. like that  i want to displat the contacts for all accounts. please any one help me how to solve this...

 

 

example

Maple Lawn Office III
8161 Maple Lawn Blvd
Fulton, MD 20759

Contact: Lydia Chandlee
G & R Management
840 First Street, NE
Washington, DC 20002

Phone: 301-807-0271
Fax: 202-898-0053
Email: 

Contract: No
Inspection Date: 4/6/2010
Inspection Type: Annual
5 Year Test: 2012
Reg/Serial #: HO1863
Service Company: Kone
Equipment Type: Passenger Hydraulic
Annual Price (per unit): $180
Semi-Annual Prince (per unit): $80

Maple Lawn Office III
8161 Maple Lawn Blvd
Fulton, MD 20759

Contact: Lydia Chandlee
G & R Management
840 First Street, NE
Washington, DC 20002

Phone: 301-807-0271
Fax: 202-898-0053
Email: 

Contract: Yes
Inspection Date: 4/6/2010
Inspection Type: Annual
5 Year Test: 2012
Reg/Serial #: HO1863
Service Company: Kone
Equipment Type: Passenger Hydraulic
Annual Price (per unit): $180
Semi-Annual Prince (per unit): $80

 

 

 

thanks,

yamini

  • March 29, 2011
  • Like
  • 0