• Developement
  • NEWBIE
  • 39 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 40
    Questions
  • 45
    Replies
I passed today below exams

1) Salesforce Data Architecture and management designer
2) Salesforce Certified Sharing and Visibility Designer 
3) Platform Developer 1

Let me know if you need dumps for study . Please send me an email at wellwisher.zenith@gmail.com
Hi,
We have field called "Duration". An email should go out to Owner if Duration is less or equal to 60. We want only one email should go out each owner with hyperlink to records.

Example: if Kevin has 8 records where duration is 60 and James has 12 records where duration is 50. Then Kevin and James should get one email each with links to their records in an email.

Could you please help here.

Thanks so much.
Hi,

I want when oppy stage is closed won. user should get pop up. i create this page. But the popup is not coming. even when i preview the page , nothing shows up.
<apex:page standardController="opportunity" rendered="{!opportunity.stagename="Closed Won"}">
  <script type="text/javascript">
  {
  window.alert("i did it");
  }
  </script>
  
</apex:page>

please help to resolve this.
Hey,

I created this visualforce page. Page works fine.
Issue : Some fields are required on the page layout. It shows as Red mark. but when i hit save it doesn't show me the error on the field like below:

User-added image

I want when i hit save it should show error like above on the fields that are required on the page layout. Here is the VF page:
 
<apex:page standardController="Opp" extensions="oppsController">
    <apex:sectionHeader title="Opp Edit" subtitle="{!Opp.OppNumber}"/>
    <apex:form id="frmId">
   

        <apex:pageBlock id="pb" title="Opp Edit" mode="edit">
  <apex:messages ></apex:messages>
            <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}" rerender="theForm"/>
 
            <apex:commandButton value="Cancel" action="{!Cancel}" rerender="theForm"/>
 
         </apex:pageBlockButtons> 


            <apex:pageBlockSection id="pb1" title="Opp" columns="2">
                <apex:inputField value="{!Opportunity.Account_name__c}" required="True"/>
                <apex:inputField value="{!Opportunity.Active_Status__c}" required="True"/>
                <apex:inputField value="{!Opportunity.OppNumber}" required="True"/>
                 <apex:inputField value="{!Opportunity.RecordTypeId}" required="True"/>
                
            </apex:pageBlockSection>


            <apex:pageBlockSection id="pb2" title="Details" columns="2">
              <apex:messages ></apex:messages>
                <apex:inputField value="{!Opportunity.Opp_Country__c}" required="true"/>
                <apex:inputField value="{!Opportunity.Region__c}" required="True"/>
                <apex:inputField value="{!Opportunity.Sub_Region__c}" required="True"/>
            </apex:pageBlockSection>
         
        </apex:pageBlock>
    </apex:form>
</apex:page>

Does anyone know how to fix it?

Thanks.
 
Hi,

We have Visual force Page for Accounts. We have also created a history related list on it. 
<apex:pageBlock title=" History" id="Account_History">
      <apex:pageBlockTable value="{!acchistlist}" var="accounthistory" rows="1000">
         <apex:column value="{!accounthistory.createddate}"/>
         <apex:column value="{!accounthistory.createdby.name}"/>
         <apex:column value="{!accountHistory.field}"/>
         <apex:column value="{!accounthistory.oldvalue}"/>
         <apex:column value="{!accounthistory.newvalue}"/>
      </apex:pageBlockTable>

This is the query
SELECT CreatedById,CreatedDate,CreatedBy.name,Field,NewValue,OldValue FROM AccountHistory

but when I update Account owner, I get 2 rows--> 1 with user id and other with user name
User-added image

How can I get rid of 2nd row i.e. I dont want to see ID row on the history.

Thanks so much for help!


 
Hi All,

I have checkbox field on oppy product that is a formula field. I have created  a section for it in VF component. I want checbox "ONG" is checked on any one product . it should show

ONGS : Yes

But currently as per my belwo code, if oppy has 2 products and on product it is checked and on other it is not then it shows

ONGS: Yes
ONGS: No

I want if i have atleast 1prouct where ONG is checke, it should yes/. How to fix the below code.
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%">
                        <tr bgcolor="e1e1e1">
                                 <td colspan="2" valign="top" class="emailcopy"><strong>ONG</strong><strong></strong></td>
                        </tr>
                                       
                        
                        <apex:repeat value="{!objOpp.OpportunityLineItems}" var="c" >
       
                        
                         <tr>
                                 <td width="37%" valign="top" class="emailcopy">ONGS</td>
                                 <td width="63%" align="left" valign="top" class="emailcopy">{!IF(!c.ONG__c=True,'Yes','No')}</td>
                            </tr>
    </apex:repeat>
                    
                             
</table>

 
Hi,

How to run a schedule job instantly? 

I am using the below but it doesn't work and i get an error:

Line: 1, Column: 17
Argument must be an object that implements Database.Batchable

Id batchJobId = Database.executeBatch(new SendEmailsales(), 200);
Hi All,

I am using a VF template for email alerts. One of the field on the template is rich tex area. So far the template works fine. But sometimes if the Rich text area has data in the table format that mess up the VF template. VF template adjust as per the data size and formatting is messed up. How can I fix it?

I don't want table column to get adjust as per the data. 
Thanks
Hi,

I have 2 objects Action and Work. I have created a trigger on Action Object and copying few fields to work object. I have created a new lookup realtionship on Work object with Action obejct called "Track". I want when a new record is created on Action object the field "Track" on Work is updated with the action record. 
Action and work has a field called "number" that has same value.  

Logic should be: whenevr action.number=work.number
update Track (track is a lookup field on work and that loks up Ation record)

but how to incorporate this in this trigger?

trigger act_Trig on Action__c (after update,before insert, before update) {
 Map<String,Action__c > recordsctg = new Map<String,Action__c >();
 List<work> workToUpdate = new List<work>();
 
 
 
 
    if (Trigger.isAfter){
    
           for(Action__c ctgRecord : trigger.new){
           
           Action__c oldctg=trigger.oldmap.get(ctgrecord.Id); 
           if(ctgRecord.Status__c != oldctg.Status__c ||ctgRecord.Priority__c != oldctg.priority__c||
           ctgRecord.Expected_Completion_Date__c!=oldctg.Expected_Completion_Date__c ||
           ctgRecord.Master_work__c != oldctg.Master_work__c)    
              recordsctg.put(ctgRecord.BR_ID__c,ctgRecord);
       }
       if(!recordsctg.isEmpty()){
          workToUpdate = [select Status__c,work__c,priority__c, Master_work__c  from work where work__c IN: recordsctg.keyset()];
          for(work works: workToUpdate){
              works.status__c = recordsctg.get(works.work__c).Status__c;
              works.priority__c = recordsctg.get(works.work__c).priority__c;
              works.User__c = recordsctg.get(works.work__c).User__c;
              works.Master_work__c = recordsctg.get(works.work__c).Master_work__c;
              
              
          }
          if(workToUpdate.size() > 0){
             update workToUpdate;   
          }
      }
   }
   if(Trigger.isBefore){
       for (Action__c ctgRecord : trigger.new){
           if(ctgRecord.status__c == null ){
               ctgRecord.status__c = 'New';
           }
           if(ctgRecord.status__c == 'Reviewed' && ctgRecord.Reviewed_Date__c  == null){
              ctgRecord.Reviewed_Date__c = datetime.now();   
           }else if(ctgRecord.status__c == 'Approved' && ctgRecord.Approved_Date__c == null){
              ctgRecord.Approved_Date__c = datetime.now();
           }else if(ctgRecord.Rev__c != null && ctgRecord.status__c == 'New'){
              ctgRecord.status__c = 'In Review';    
           }
       }
       }
}
Hi,
I have created a 2 custom object with Master detail relationship. What I would like to do is:
WHen I create a record onParent object and save it.So after save it shoudl open a Child record page.

example: I have 2 objects Product and order. whenI ad product name and save , right fater save it should opena  Order page.

How can i do this?

Please help.

thanks,
Shruti
Hi,
How to select multiple values using lookup field in an object? I know this is possible through Apex and Visual but I am new to Coding.

Can somebody share the code with me?

Thanks.

Hi,

Hello,

I have this Trigger that update the checkbox to true if an Opp has an attachment. and update the checkbox to false if I delete the attachment. This Trigger work fine.

 

But if Opp has 3 attachment and if I delete the one attachment it update the checkbox to false. How should I modify this trigger so it should update the checkbox to false only if there is no attachment

 

trigger Att_Aft_Trig on Attachment (after insert, after update,after delete)
{
if(trigger.isInsert || trigger.isUpdate){
List<Opportunity> co = [select id, Attachement__c from Opportunity where id =: Trigger.New[0].ParentId];
if(co.size()>0)
{
co[0].Attachement__c = true;
update co;
}
}
if(trigger.isDelete){
List<Opportunity> co1 = [select id, Attachement__c from Opportunity where id =: Trigger.old[0].ParentId];
if(co1.size()>0)
{
co1[0].Attachement__c = false;
update co1;
}

}
}

Hello,

I have this Trigger that update the checkbox to true if an Opp has an attachment. This Trigger work fine.

 

trigger Att_Aft_Trig on Attachment (after insert, after update) 
 {
                        List<Opportunity> co = [select id, Attachement__c from Opportunity where id =: Trigger.New[0].ParentId];
                        if(co.size()>0)
                        {
                                    co[0].Attachement__c = true;
                                    update co;
                        }                                                                   
            
}

 

 

But I want to know if I remove the Attachment the checkbox should be unchecked?How should I do this in this trigger?

 

Thanks,

Shruti

Hello,

I want to create a Dashboard filters with these fields:

1) Account Name has 2000 Records

2) Region has 50 Records

3) Type has 20 records

4) value has10 reocrds

 

I want user to select filter values from picklist or they enter it manually. How can I pass these filters fields and they display on dashboard? Can anyone help me to write a visual force page for it.

 

 

Thanks,

Shruti

Hello,

We have situation where people are changing Case Record Type from one to another. I know we can track this by turning on the history tracking. But we want a way to see it as a field on the Case.

 

So I need to capture the old value of Record type in Old Value field

 

Record Type. 1) Regular 2) Strategic

Text field: Old Value

 

Can anyone help me to write an trigger?

 

 

Thanks a lot!

 

Shruti

Hello,

Can anyone help to write a logic to merge duplicate records of Custom Object?

 

Thanks,

Shruti

Hi,

This Trigger copies some field data from IDea to my custom object. But now when I modify the exisitng record in Idea it creates a new entry instead of updating the 

existing record in my custom object. 

 

Please help.

 

trigger insertfielddata on Idea(after insert,after update) {

    Set<String> ideaTitle= new Set<String>();
    Set<String> setIdea = new Set<String>();
    List<Idea> listIdea = new List<Idea>();
    Map<String, Commerical_Task_Group__c> mapCtg = new Map<String, Commerical_Task_Group__c>();
    List<Commerical_Task_Group__c> listCtg = new List<Commerical_Task_Group__c>();
    List<Commerical_Task_Group__c> listUpdtCtg = new List<Commerical_Task_Group__c>();
    
    if (Trigger.isInsert){
        for (Idea Ideas : Trigger.new)
        {
           if(Ideas.ap__c == true){
              Commerical_Task_Group__c ctg = new  Commerical_Task_Group__c(Name = Ideas.title,Source__c=Ideas.Source__c,BR_ID__c=Ideas.Idea__c);
              listCtg.add(ctg);
           }
        }
        insert listCtg;
    }
    if (Trigger.isUpdate){
        for (Idea Ideas : Trigger.new)
        {
            
             if( Ideas.ap__c == true){
              listIdea .add(Ideas );
              setIdea.add(Ideas.Title);
                              
             }                       
        }
        listCtg  = [select Name, Source__c ,BR_ID__c from Commerical_Task_Group__c where  name in :setIdea];
        for( Commerical_Task_Group__c ctgtmp : listCtg ){
            mapCtg.put(ctgtmp.name,ctgtmp);
        }
        for( Idea ideatmp : listIdea  ){
            if( mapCtg.get(ideatmp.Title) != null ){
                 Commerical_Task_Group__c uptCTG = mapCtg.get(ideatmp.Title);
                 
                 uptCTG.Source__c = ideatmp.Source__c;   
                 uptCTG.BR_ID__c = ideatmp.Idea__c;               
                 listUpdtCtg.add(uptCTG);
            }else{
                 Commerical_Task_Group__c ctg = new  Commerical_Task_Group__c(Name = ideatmp.title,Source__c=Ideatmp.Source__c,BR_ID__c=Ideatmp.Idea__c);
                 listUpdtCtg.add(ctg);
            }
        }
        upsert listUpdtCtg;
     
    }
     
}

 

 

Hi,

I am copying on1 fields from Idea to RMP custom object. Below is ma trigger, am getting ReviewerID instead of Reviewer name.

 

Field: Reviewer (lookup field from User on Idea). 

 

for( Idea ideatmp : listIdea ){
if( mapCtg.get(ideatmp.Title) != null ){
RMP__c uptCTG = mapCtg.get(ideatmp.Title);
uptCTG.Reviewer__c= ideatmp.Reviewer__c;

listUpdtCtg.add(uptCTG);
}else{


RMP__c ctg = new RMP__c(Reviewer__c =Ideatmp.Reviewer__c );


listUpdtCtg.add(ctg);
}
}
upsert listUpdtCtg;

}

}

 

How to get the name ?

 

 

thanks,

Shruti

Hello,

I need to create a "Approve" button on my custom object "ERP" also when I click on Approve it should ask the confirmation that "Are you sure you want to Approve"?

 

Can anyone help me to create this.

 

Thanks a lot in advance.

 

Shruti

Hi,
I am trying to find a way where if an USer try to Post an Idea in Salesforce (Idea Object) before it posted , it should come to me (Admin) for the approval that whether this can be posted as in Idea or not? after I approve it should be visible to all Users.

FYI: I have tried the Approval Process but I cannnot create a Approval process on Ideas.

Please help how can I achieve this?

Hi,

I want when oppy stage is closed won. user should get pop up. i create this page. But the popup is not coming. even when i preview the page , nothing shows up.
<apex:page standardController="opportunity" rendered="{!opportunity.stagename="Closed Won"}">
  <script type="text/javascript">
  {
  window.alert("i did it");
  }
  </script>
  
</apex:page>

please help to resolve this.
Hey,

I created this visualforce page. Page works fine.
Issue : Some fields are required on the page layout. It shows as Red mark. but when i hit save it doesn't show me the error on the field like below:

User-added image

I want when i hit save it should show error like above on the fields that are required on the page layout. Here is the VF page:
 
<apex:page standardController="Opp" extensions="oppsController">
    <apex:sectionHeader title="Opp Edit" subtitle="{!Opp.OppNumber}"/>
    <apex:form id="frmId">
   

        <apex:pageBlock id="pb" title="Opp Edit" mode="edit">
  <apex:messages ></apex:messages>
            <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}" rerender="theForm"/>
 
            <apex:commandButton value="Cancel" action="{!Cancel}" rerender="theForm"/>
 
         </apex:pageBlockButtons> 


            <apex:pageBlockSection id="pb1" title="Opp" columns="2">
                <apex:inputField value="{!Opportunity.Account_name__c}" required="True"/>
                <apex:inputField value="{!Opportunity.Active_Status__c}" required="True"/>
                <apex:inputField value="{!Opportunity.OppNumber}" required="True"/>
                 <apex:inputField value="{!Opportunity.RecordTypeId}" required="True"/>
                
            </apex:pageBlockSection>


            <apex:pageBlockSection id="pb2" title="Details" columns="2">
              <apex:messages ></apex:messages>
                <apex:inputField value="{!Opportunity.Opp_Country__c}" required="true"/>
                <apex:inputField value="{!Opportunity.Region__c}" required="True"/>
                <apex:inputField value="{!Opportunity.Sub_Region__c}" required="True"/>
            </apex:pageBlockSection>
         
        </apex:pageBlock>
    </apex:form>
</apex:page>

Does anyone know how to fix it?

Thanks.
 
Hi,

We have Visual force Page for Accounts. We have also created a history related list on it. 
<apex:pageBlock title=" History" id="Account_History">
      <apex:pageBlockTable value="{!acchistlist}" var="accounthistory" rows="1000">
         <apex:column value="{!accounthistory.createddate}"/>
         <apex:column value="{!accounthistory.createdby.name}"/>
         <apex:column value="{!accountHistory.field}"/>
         <apex:column value="{!accounthistory.oldvalue}"/>
         <apex:column value="{!accounthistory.newvalue}"/>
      </apex:pageBlockTable>

This is the query
SELECT CreatedById,CreatedDate,CreatedBy.name,Field,NewValue,OldValue FROM AccountHistory

but when I update Account owner, I get 2 rows--> 1 with user id and other with user name
User-added image

How can I get rid of 2nd row i.e. I dont want to see ID row on the history.

Thanks so much for help!


 
Hi All,

I have checkbox field on oppy product that is a formula field. I have created  a section for it in VF component. I want checbox "ONG" is checked on any one product . it should show

ONGS : Yes

But currently as per my belwo code, if oppy has 2 products and on product it is checked and on other it is not then it shows

ONGS: Yes
ONGS: No

I want if i have atleast 1prouct where ONG is checke, it should yes/. How to fix the below code.
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%">
                        <tr bgcolor="e1e1e1">
                                 <td colspan="2" valign="top" class="emailcopy"><strong>ONG</strong><strong></strong></td>
                        </tr>
                                       
                        
                        <apex:repeat value="{!objOpp.OpportunityLineItems}" var="c" >
       
                        
                         <tr>
                                 <td width="37%" valign="top" class="emailcopy">ONGS</td>
                                 <td width="63%" align="left" valign="top" class="emailcopy">{!IF(!c.ONG__c=True,'Yes','No')}</td>
                            </tr>
    </apex:repeat>
                    
                             
</table>

 
Hi All,

I am using a VF template for email alerts. One of the field on the template is rich tex area. So far the template works fine. But sometimes if the Rich text area has data in the table format that mess up the VF template. VF template adjust as per the data size and formatting is messed up. How can I fix it?

I don't want table column to get adjust as per the data. 
Thanks
Hi,
I have created a 2 custom object with Master detail relationship. What I would like to do is:
WHen I create a record onParent object and save it.So after save it shoudl open a Child record page.

example: I have 2 objects Product and order. whenI ad product name and save , right fater save it should opena  Order page.

How can i do this?

Please help.

thanks,
Shruti

Hello,

I have this Trigger that update the checkbox to true if an Opp has an attachment. This Trigger work fine.

 

trigger Att_Aft_Trig on Attachment (after insert, after update) 
 {
                        List<Opportunity> co = [select id, Attachement__c from Opportunity where id =: Trigger.New[0].ParentId];
                        if(co.size()>0)
                        {
                                    co[0].Attachement__c = true;
                                    update co;
                        }                                                                   
            
}

 

 

But I want to know if I remove the Attachment the checkbox should be unchecked?How should I do this in this trigger?

 

Thanks,

Shruti

Hi,

This Trigger copies some field data from IDea to my custom object. But now when I modify the exisitng record in Idea it creates a new entry instead of updating the 

existing record in my custom object. 

 

Please help.

 

trigger insertfielddata on Idea(after insert,after update) {

    Set<String> ideaTitle= new Set<String>();
    Set<String> setIdea = new Set<String>();
    List<Idea> listIdea = new List<Idea>();
    Map<String, Commerical_Task_Group__c> mapCtg = new Map<String, Commerical_Task_Group__c>();
    List<Commerical_Task_Group__c> listCtg = new List<Commerical_Task_Group__c>();
    List<Commerical_Task_Group__c> listUpdtCtg = new List<Commerical_Task_Group__c>();
    
    if (Trigger.isInsert){
        for (Idea Ideas : Trigger.new)
        {
           if(Ideas.ap__c == true){
              Commerical_Task_Group__c ctg = new  Commerical_Task_Group__c(Name = Ideas.title,Source__c=Ideas.Source__c,BR_ID__c=Ideas.Idea__c);
              listCtg.add(ctg);
           }
        }
        insert listCtg;
    }
    if (Trigger.isUpdate){
        for (Idea Ideas : Trigger.new)
        {
            
             if( Ideas.ap__c == true){
              listIdea .add(Ideas );
              setIdea.add(Ideas.Title);
                              
             }                       
        }
        listCtg  = [select Name, Source__c ,BR_ID__c from Commerical_Task_Group__c where  name in :setIdea];
        for( Commerical_Task_Group__c ctgtmp : listCtg ){
            mapCtg.put(ctgtmp.name,ctgtmp);
        }
        for( Idea ideatmp : listIdea  ){
            if( mapCtg.get(ideatmp.Title) != null ){
                 Commerical_Task_Group__c uptCTG = mapCtg.get(ideatmp.Title);
                 
                 uptCTG.Source__c = ideatmp.Source__c;   
                 uptCTG.BR_ID__c = ideatmp.Idea__c;               
                 listUpdtCtg.add(uptCTG);
            }else{
                 Commerical_Task_Group__c ctg = new  Commerical_Task_Group__c(Name = ideatmp.title,Source__c=Ideatmp.Source__c,BR_ID__c=Ideatmp.Idea__c);
                 listUpdtCtg.add(ctg);
            }
        }
        upsert listUpdtCtg;
     
    }
     
}

 

 

Hi,

I am copying on1 fields from Idea to RMP custom object. Below is ma trigger, am getting ReviewerID instead of Reviewer name.

 

Field: Reviewer (lookup field from User on Idea). 

 

for( Idea ideatmp : listIdea ){
if( mapCtg.get(ideatmp.Title) != null ){
RMP__c uptCTG = mapCtg.get(ideatmp.Title);
uptCTG.Reviewer__c= ideatmp.Reviewer__c;

listUpdtCtg.add(uptCTG);
}else{


RMP__c ctg = new RMP__c(Reviewer__c =Ideatmp.Reviewer__c );


listUpdtCtg.add(ctg);
}
}
upsert listUpdtCtg;

}

}

 

How to get the name ?

 

 

thanks,

Shruti

Hello,

I need to create a "Approve" button on my custom object "ERP" also when I click on Approve it should ask the confirmation that "Are you sure you want to Approve"?

 

Can anyone help me to create this.

 

Thanks a lot in advance.

 

Shruti