• Karthikeyan Chandran
  • NEWBIE
  • 175 Points
  • Member since 2013
  • Salesforce.com Consultant
  • Global Tech & Resources, Inc.


  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 44
    Replies
Hi Team,

Can we save the emails to email message object under an Opportunity as like case? when we send the emails via "Send an email" option it's saving under the activity history instead of email message related list.

Thanks,
Karthikeyan
Hi Team,

I have a trigger in user object.

I want to add and remove the users from the public groups based on the user record update(Profile).

EX: If the user profile is "STD", i need to add the users to the public group 'std'
If the user profile is "PVT", i need to add the users to the public group 'pvt'
If the user profile is "ADM", i need to add the users to the public group 'adm'
.
.
.
.
.
.
.
etc
Can anyone help me on this ASAP?

Thanks,

 
Hi Team,

I want to fix this by adding an alert message on my VF page when the upload file size is not more than 25MB. it should show the alert wherever the uploaded file is more than 25MB.

Here my vf page,
 
<apex:page sidebar="false" showheader="false" Controller="CaseController" id="Support">
<apex:form id="Page">
<apex:pageMessages />
  <html>
    <head>
        <title>My - Help</title>
        <link rel="stylesheet" href="{!URLFOR($Resource.SC_CSS,'css/index.css')}" />
        <link rel="stylesheet" href="{!URLFOR($Resource.SC_CSS,'css/grid.css')}" />
        <link rel="shortcut icon" href="{!URLFOR($Resource.SC_CSS,'css/favicon.ico')}" type="image/x-icon" />
        <link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" />
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/> 
    </head>   
    <body>
        <section class="help-desk__navigation">
            <div class="container">
                <div class="table">
                    <div class="logo">
                        <img src="{!URLFOR($Resource.SC_CSS,'css/images/my-logo-black.png')}" />
                    </div>
                    <div class="cta">
                        <a class="btn">1-845-456-7888</a>
                    </div>
                </div>
            </div>
        </section>
        <section class="help-desk__header">
            <div class="container">
                <h1>Requests</h1>
            </div>
        </section>
        <section class="help-desk__sub-header">
            <div class="container">
                <ul class="help-desk__breadcrumbs">
                    <li><a href="//help.mysite.com" target="_blank">My Support Center</a></li>
                    <li>Submit a Request</li>
                </ul>
            </div>
        </section>
        <section class="help-desk__content">
            <div class="container">
                <div class="row">
                    <div class="col-md-5">
                        <h3>Submit a request</h3>
                        <div>&nbsp;</div>
                        <div class="form-field">
                            <label>Your email address<span class="required">*</span></label>                            
                            <apex:inputField id="Email" required="true" value="{!c.Email}"/>                            
                        </div>
                        <div class="form-field">
                            <label>Subject<span  class="required">*</span></label>                            
                            <apex:inputText id="Subject" required="true" value="{!strSubject }" maxlength="250" size="25" />
                        </div>
                        <div class="form-field">
                            <p>Please enter the details of your request. A member of our support staff will respond as soon as possible.</p>
                        </div>
                        <div class="form-field">
                            <label>Description<span class="required">*</span></label>                            
                            <apex:inputTextarea id="Description" required="true" value="{!strDescription}"/>
                        </div>
                       <!--<div class="form-field">
                            <label>Attachments</label>
                            <div class="upload-box text-center ripple">
                               <input type="file"  value="{!attachment.body}"  filename="{!attachment.name}" />
                                <span><img src="{!URLFOR($Resource.SC_CSS,'css/images/paperclip.png')}"  /></span>
                                <span><a>Add file</a> or drop files here</span>
                            </div>
                        </div>-->
                        <div class="form-field">
                            <label>Attachments</label>
                            <div>                                
                                <apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file"/>
                            </div>
                        </div>
                        <div class="form-field text-right">
                           <a class="btn" onclick="jsCallSavefn()" >Submit</a>                         
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section class="help-desk__footer">
            <div class="container">
                <div class="row">
                    <div class="col-md-5">
                        <div class="logo">
                            <img src="{!URLFOR($Resource.SC_CSS,'css/images/my-logo-black.png')}"   />
                        </div>
                        <p>Mysite is the all-in-one solution for local business owners &ndash; equipping them with an HTML5, mobile-responsive website and an ever-expanding product suite that gives them the power to tell their story and reinvent their digital presence.</p>
                        <p>&copy; 2017 Mysite. All rights reserved.</p>
                    </div>
                    <div class="col-md-7">
                        <div class="row">
                            <div class="col-md-6">
                                <h3>Company</h3>
                                <ul class="bordered-list">
                                    <li><a href="//www.mysite.com/" target="_blank">What is Mysite?</a></li>
                                    <li><a href="//blog.mysite.com/" target="_blank">Blog</a></li>
                                </ul>
                            </div>
                            <div class="col-md-6">
                                <h3>Community</h3>
                                <ul class="bordered-list">
                                    <li><a href="https://www.facebook.com/MysiteTeam" target="_blank">Facebook</a></li>
                                    <li><a href="https://twitter.com/mysiteteam" target="_blank">Twitter</a></li>
                                    <li><a href="https://www.youtube.com/user/mysiteteam" target="_blank">Youtube</a></li>
                                    <li><a href="https://www.instagram.com/mysiteteam/" target="_blank">Instagram</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </body>
</html>
<apex:actionFunction action="{!Save}" name="jsCallSavefn">  
</apex:actionFunction>
</apex:form>
</apex:page>

Controller,
 
public with sharing class CaseController {

    public Contact c { get; set; }
    
    public CaseController(){
       c = new Contact();
    }
    
    public Attachment attachment {
    get {
      if (attachment == null)
        attachment = new Attachment();
      return attachment;
    }
    set;
    }
     
    public string strSubject {get;set;}     
    public string strDescription {get;set;}     

    public PageReference save()
    {   
        String Body  = strDescription;

        String Subject = strSubject;
        List<String> toAddresses  = new List<String>();
        toAddresses.add('mysitesupportcase@z-279vlo46d4dn63rs8liuxfyuv0t1fjox5sgnsyr0nc6ccct0n0.m-4etgeaq.cs20.apex.sandbox.salesforce.com');
        toAddresses.add('ckarthikeyanbtechit@gmail.com');
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setSubject(Subject);
        mail.setReplyTo(c.Email);
        mail.setSenderDisplayName(c.Email);
        mail.setToAddresses(toAddresses);
        mail.setHtmlBody(body);
        if(attachment.body != null)
        {
            Blob b = attachment.body;
            Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
            efa.setFileName(attachment.name);
            efa.setBody(b); 
            mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});     
        }       
        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        
        PageReference newocp = new PageReference('/apex/SampleRedirectPage');
        newocp.setRedirect(true);
        return newocp;
        return null;
    }
    
     
   
}

Can anyone fix this ASAP?

Thanks,
Hi Team,

I need to update a custom field in case object whenever the case owner changed from a user to queue.

Can anyone help me to fix this with a trigger ASAP?

Thanks,
Karthikeyan
Hi Team,

I want to get opportunities that are related to case as a related list using VF page.

Can anyone help to fix this?

Thanks & Regards,
Karthikeyan Chandran
Hi Team,

Can anyone help me to fix this issue to Batch Class for Contacts not related to Case ASAP?

Thanks & Regards,
Karthikeyan Chandran
Hi Team,

here my code,
 
Integer SpecRepCount                      = Integer.valueOf(Label.Constant_PQCapMaxCount);
        SpecRepList           = [SELECT Id, Name,Shift__c, Email__c, Next_Pickup_Counter__c,QC_Rep__c from Spec_Build__c WHERE Available__c = true AND Next_Pickup_Counter__c < :SpecRepCount ORDER BY Next_Pickup_Counter__c ASC LIMIT 1];
        if(!SpecRepList.isEmpty()) 
        {
            cas.Spec_Build_Rep__c                 = SpecRepList[0].Email__c;
            SpecRepList[0].Next_Pickup_Counter__c = SpecRepList[0].Next_Pickup_Counter__c + 1;
            specBuildRepName = SpecRepList[0].Name;
            
           
            //Arrange Map
            Spec_Build__c specBuild = new Spec_Build__c();
            specBuild.id            = SpecRepList[0].id;
            specBuild.Next_Pickup_Counter__c = SpecRepList[0].Next_Pickup_Counter__c;
            
            //Map
            mapNextCounter = new Map<Id,Spec_Build__c> ();
            mapNextCounter.put(specBuild.id,specBuild);
            
            //SpecRepList.add(specBuild);
            //update specBuild;
            //SpecRepList.add(SpecRepList[0]);
        } 
        else 
        {                    
            cas.Spec_Build_Rep__c             = Label.SpecBuild_Manager_Email;
            //specBuildRepName = Label.SpecBuild_Manager_Email;                                  
        }

We have to quey the least count from this object 'Spec_Build__c' and  the "Next_Pickup_Counter__c" should increase +1.

This is not working here.

Can any one help me to fix this?

Thanks

 
Hi,

I have a multiselect picklist called "Group__c" in User object, i need to display the picklist values as dropdown in a VF page.

How can i fix this?

Can you help me to fix this ASAP?

Thanks
 
Hi All,

I have a custom multi select picklist called "Groups__c" in user object. i want to display the users in custom VF page based on the selection from the picklist "Groups--c".

Can anyone help me to fix this ASAP?

Thanks,
Karthikeyan Chandran
Hi All,

I have below cutom VF page and controller in my sandbox.

VF page:
<apex:page controller="CalendarExample_Controller" action="{!pageLoad}">

    <link href="{!$Resource.fullCalendarCSS}" rel="stylesheet" />
    <link href="{!$Resource.fullCalendarPrintCSS}" rel="stylesheet" media="print" />
     
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    <script src="{!$Resource.fullCalendarMinJS}"></script>
     
    <script>
        //We need to wrap everything in a doc.ready function so that the code fires after the DOM is loaded
        $(document).ready(function() {  
            //Call the fullCallendar method. You can replace the '#calendar' with the ID of the dom element where you want the calendar to go.
            $('#calendar').fullCalendar({
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'agendaDay'
                },
                editable: false,
                events:
                [
                    //At run time, this APEX Repeat will reneder the array elements for the events array
                    <apex:repeat value="{!events}" var="e">
                        {
                            title: "{!e.title}",
                            start: '{!e.startString}',
                            end: '{!e.endString}',
                            url: '{!e.url}',
                            allDay: {!e.allDay},
                            className: '{!e.className}'
                        },
                    </apex:repeat>
                ]
            });
             
        });
    </script>
     
    <!--some styling. Modify this to fit your needs-->
    <style>
        #cal-options {float:left;}
        #cal-legend { float:right;}
        #cal-legend ul {margin:0;padding:0;list-style:none;}
        #cal-legend ul li {margin:0;padding:5px;float:left;}
        #cal-legend ul li span {display:block; height:16px; width:16px; margin-right:4px; float:left; border-radius:4px;}
        #calendar {margin-top:20px;}
        #calendar a:hover {color:#fff !important;}
         
        .fc-event-inner {padding:3px;}
        .event-birthday {background:#56458c;border-color:#56458c;}
        .event-campaign {background:#cc9933;border-color:#cc9933;}
        .event-personal {background:#1797c0;border-color:#1797c0;}
    </style>
     
    <apex:sectionHeader title="My Calendar Example"/>
    <apex:outputPanel id="calPanel">
        <apex:form >
            <div id="cal-options">
                <apex:commandButton value="{!IF(includeMyEvents,'Hide My Events','Show My Events')}" action="{!toggleMyEvents}"/>
            </div>
            <div id="cal-legend">
                <ul>
                                   
                    <!--<li><span class="event-birthday"></span>Contact's Birthdays</li>
                    <li><span class="event-campaign"></span>Campaigns</li>-->
                    
                    
                    <li style="{!IF(includeMyEvents,'','display:none')}"><span class="event-personal"></span>My Events</li>
                </ul>
                <apex:pageBlock id="OrderGroup" >
                 <apex:pageBlockSection title="User Group" collapsible="false">
                     <apex:selectList size="1">
                        <apex:selectOptions value="{!Groups}"></apex:selectOptions>
                      </apex:selectList>
                    
                     <!--<apex:outputText value="{!selectedGroup}" label="You have selected:"/>  -->
                </apex:pageBlockSection>
                </apex:pageBlock>
                  
                <div style="clear:both;"><!--fix floats--></div>
            </div>
            <div style="clear:both;"><!--fix floats--></div>
            <div id="calendar"></div>
        </apex:form>
    </apex:outputPanel>

</apex:page>

Controller:
 
public class CalendarExample_Controller {

   public Boolean includeMyEvents {get;set;}
   public list<calEvent> events {get;set;}

   //The calendar plugin is expecting dates is a certain format. We can use this string to get it formated correctly
   String dtFormat = 'EEE, d MMM yyyy HH:mm:ss z';

   //constructor
   public CalendarExample_Controller() {
      //Default showing my events to on
      includeMyEvents = true;
   }

   public PageReference pageLoad() {
      events = new list<calEvent>();
      //Get Contact's Birthdays
      for(Contact cont : [select Id, Birthdate, FirstName, LastName from Contact where Birthdate != null]){
         //here we need to replace the birth year with the current year so that it will show up on this years calendar
         DateTime startDT = datetime.newInstance(Date.Today().Year(),cont.Birthdate.Month(), cont.Birthdate.Day());
         calEvent bday = new calEvent();

         bday.title = cont.FirstName + ' ' + cont.LastName + '\'s Birthday!';
         bday.allDay = true;
         bday.startString = startDT.format(dtFormat);
         //Because this is an all day event that only spans one day, we can leave the send date null
         bday.endString = '';
         bday.url = '/' + cont.Id;
         bday.className = 'event-birthday';
         events.add(bday);
      }

      
      //Get my Events if we have selected the correct option
      if(includeMyEvents){
//for(Event evnt: [select Id, Subject, isAllDayEvent, StartDateTime, EndDateTime from Event where OwnerID = :UserInfo.getUserId()]){
for(Event evnt: [select Id, Subject, isAllDayEvent, StartDateTime, EndDateTime from Event where OwnerID = '005j000000ByiOc']){
            DateTime startDT = evnt.StartDateTime;
            DateTime endDT = evnt.EndDateTime;
            calEvent myEvent = new calEvent();

            myEvent.title = evnt.Subject;
            myEvent.allDay = evnt.isAllDayEvent;
            myEvent.startString = startDT.format(dtFormat);
            myEvent.endString = endDT.format(dtFormat);
            myEvent.url = '/' + evnt.Id;
            myEvent.className = 'event-personal';
            events.add(myEvent);
         }
      }
      return null;
   }

   public PageReference toggleMyEvents() {
      if(includeMyEvents){
         includeMyEvents = false;
      }
      else{
         includeMyEvents = true;
      }
      pageload();
      return null;
   }

   //Class to hold calendar event data
   public class calEvent{
      public String title {get;set;}
      public Boolean allDay {get;set;}
      public String startString {get;set;}
      public String endString {get;set;}
      public String url {get;set;}
      public String className {get;set;}
   }
   public List<SelectOption> getGroups(){
    List<SelectOption> publicgroup = new List<SelectOption>();    
    for(Group pg: [select id ,name from group]){
        if(pg.name!=null){
            publicgroup.add(new SelectOption(pg.name,pg.name));
        }
    }       
    return publicgroup ;
}
  
   }

Can anyone correct this code and fix to multi user calender view?

Thanks &Regards,
Karthikeyan Chandran
+91-9944676540
Hi Team,

I am new to developement, i need a script to query error records(Field - description) from an object(Object A) and store in a new object (Object B).

Object A Fields,

Name
Description(This field contains ERROR)
Details
Request Time

Obect B Fields.

B_Name
B_Description
B_Details
B_Request Time

Can anyone help me to fix tis ASAP?

Thanks & Regards
Karthi
Hi,

I am deploying a class(Birthday emailer) apex class from a sandbox to production, i getting the below error while i am deploying this apex class. i have deployed the same apex class (Birthday emailer) two months ago there was no error while i deployed.
 
Apex Test Failures 
 Class NameMethod NameError Message
 Milestone1_Test_ClonetestMilestoneCloneActiveOwnerSystem.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_USERNAME, Duplicate Username.<br>The username already exists in this or another Salesforce organization. Usernames must be unique across all Salesforce organizations. To resolve, use a different username (it doesn't need to match the user's email address). : [Username] 
Stack Trace: Class.Milestone1_Test_Utility.createSFUser: line 338, column 1 Class.Milestone1_Test_Clone.testMilestoneCloneActiveOwner: line 407, column 1
 Milestone1_Test_ClonetestMilestoneCloneInactiveOwnerSystem.DmlException: Update failed. First exception on row 0 with id 00537000001izzOAAQ; first error: UNKNOWN_EXCEPTION, You cannot edit this field: [IsActive] 
Stack Trace: Class.Milestone1_Test_Clone.testMilestoneCloneInactiveOwner: line 360, column 1
 Milestone1_Test_ClonetestProjectCloneInactiveOwnerSystem.DmlException: Update failed. First exception on row 0 with id 00537000001izzRAAQ; first error: UNKNOWN_EXCEPTION, You cannot edit this field: [IsActive] 
Stack Trace: Class.Milestone1_Test_Clone.testProjectCloneInactiveOwner: line 289, column 1
     


The test class "Milestone1_Test_Clone" is from installed package not created by us.  i don't know what is the root cause of this issue.

Can any one help me to fix this?

Thanks,

 
Hi,

Can anyone help me to resolve this deployment error?

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Contract Date value is required to save: [] 
Stack Trace: Class.GIB_UtilityTest.createSingleOpptywt100Prob: line 47, column 1 Class.GIB_OpportunityHandlerTest.UnitTest_2: line 32, column 1


Thanks,
Karthikeyan Chandran
Hi,

Here my senario, User 1, User 2.

Contract records are auto created under Opportunity when the stage is closed(I used process builder). The newly created Contract records are filled by the user (User 1), Whenever the user (User 1) update the contract records an Approval email is send to User 2, I have created a approval process that notify another user in my org(User 2) for Approve the Contarct record.

We need to prevent the "User 1" from Active(Standard Button) the Contract records(Non Approved Contract Records) until it's approved by the User 2.

Can this possible to do so? if yes, how. validation rule or a trigger, etc..

Thanks & Regards,
Karthikeyan Chandran
+91-9944676540
Hi,

Using trigger, I just want to auto create new contract records under the opportunity when ever the Opportunity record record type is set to (Record Type1 or Record Type2 or Record Type3) and Opportunity Stage = Closed Won. also the Contract Record owner will be same as the Opportunity Owner for the auto created record.

Thanks & Regards,
Karthikeyan Chandran
Hi,

Here, the related list button should visible only when i choose the values "REQ", "Solution Sale" in the picklist field 'Pre Opportunity Type' and the picklist Approval Status valus is "Approved".

So, I just used the below java script to create a list button and i got an error,

https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3C (https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3C

https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3H (https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3H)
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} 

if('{!Pre_Opportunity_Stage__c.Pre_Opportunity_Type__c}' == 'RFQ','{!Pre_Opportunity_Stage__c.Pre_Opportunity_Type__c}' == 'Solution Sale'){ 
window.open('https://cs50.salesforce.com/006/e?retURL=%{!Account.Id}&accid={!Account.Id}'); 
} 
else{ 
alert('You can not create new oppty'); 
}


In my URL:
https://cs50.salesforce.com/006/e?retURL=%&oppid=

The error message is:

Illegal Request
You have sent us an Illegal URL or an improperly formatted request. 

I don't know what i am missing here. i already post a question link - https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BYUMIA4# 

I need to fix it immediately ASAP.

Can you help me on this?

Thanks & Regards,
Karthikeyan Chandran
 
Hi,

How do i hide a related list standard button 'New Opportunity', when i choose picklist values?

User-added image

User-added image
Here, the related list button should visible only when i choose the values "REQ", "Solution Sale" in the picklist field 'Pre Opportunity Type' and the picklist Approval Status valus is "Approved".

Any possibilities(VF page, Trigger) other than assigning record type to different layout?

Thanks & Regards,
Karthikeyan Chandran
Hi All,

I have a picklist field "Closing Fee Values" with values Amount,Percentage. i just want to display the symbol in prefix($), suffix(%) in the value entered in the text field 'Closing Fee' (Numbers).

Ex: 
Closing Fee Values - Amount
Closing Fee - 100

After saving the record field 'Closing Fee' value should display '$100'

Can this possible?

Thanks & Regards,
Karthikeyan Chandran
Hi,

How do i update a field from one custom object to another standard object?

I have a field called "TF Amount" in a custom object "credit", i just want to update the "Amount" field in "Opportunity" with  "TF amount" field.

Can any one help me on this ASAP?
Hi Team,

I am updating a Opportunity record field from another filed from a custom object, when i update custom field from the custom object am getting FIELD_FILTER_VALIDATION_EXCEPTION error in custom object.

This is the error message that i am getting when i update the custom object record.

Error Message : 
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger PrimeBaseRate caused an unexpected exception, contact your administrator: PrimeBaseRate: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 1 with id 006g00000095GZsAAM; first error: FIELD_FILTER_VALIDATION_EXCEPTION, Value does not exist or does not match filter criteria.: [Existing_Lender__c]: Trigger.PrimeBaseRate: line 26, column 1

Here, the trigger we are using,
 
trigger PrimeBaseRate on Prime_Rate__c (after update, after insert) {

Static Double x;

for(Prime_Rate__c  pr : trigger.new){

x= pr.Prime_Base_Rate__c;

}
System.debug('the vaulue of field is '+x);

//created a new list for bulkifying
list<opportunity> op = new list <opportunity>();

//running for loop for entire table. 
for(opportunity op1 : [select id, Base_Rate__c from opportunity where isclosed=false]){

//changing the value of the field with the static variable. 
op1.Base_Rate__c=x;
op.add(op1);

} 
update op;
}

Can any one modify this code and help me?

Thanks & Regards,
Karthikeyan Chandran
+91-9944676540
 
Hello,

Exceeded maximum time allotted for call out (120000 ms)

I'm getting the Exceeded maximum time allotted for call out (120000 ms) error.

It seems salesforce doesn't allow more than 120 second for a single response.

I just send a 50 files (Resumes) to the resume parser in a single transaction and the resume parser take more than 120 seconds and we are getting the time exceed exceptions.

Is there is any way to resolve this.

Thanks & Regards,
Karthikeyan Chandran
I have created a custom object 'ABC' from the related list in 'Notes & Attachments' instead of getting downloaded 'MS Word' documents should open in a new page.


Hi Team,

Can we save the emails to email message object under an Opportunity as like case? when we send the emails via "Send an email" option it's saving under the activity history instead of email message related list.

Thanks,
Karthikeyan
Hi Team,

I have a trigger in user object.

I want to add and remove the users from the public groups based on the user record update(Profile).

EX: If the user profile is "STD", i need to add the users to the public group 'std'
If the user profile is "PVT", i need to add the users to the public group 'pvt'
If the user profile is "ADM", i need to add the users to the public group 'adm'
.
.
.
.
.
.
.
etc
Can anyone help me on this ASAP?

Thanks,

 
Hi Team,

I want to fix this by adding an alert message on my VF page when the upload file size is not more than 25MB. it should show the alert wherever the uploaded file is more than 25MB.

Here my vf page,
 
<apex:page sidebar="false" showheader="false" Controller="CaseController" id="Support">
<apex:form id="Page">
<apex:pageMessages />
  <html>
    <head>
        <title>My - Help</title>
        <link rel="stylesheet" href="{!URLFOR($Resource.SC_CSS,'css/index.css')}" />
        <link rel="stylesheet" href="{!URLFOR($Resource.SC_CSS,'css/grid.css')}" />
        <link rel="shortcut icon" href="{!URLFOR($Resource.SC_CSS,'css/favicon.ico')}" type="image/x-icon" />
        <link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet" />
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/> 
    </head>   
    <body>
        <section class="help-desk__navigation">
            <div class="container">
                <div class="table">
                    <div class="logo">
                        <img src="{!URLFOR($Resource.SC_CSS,'css/images/my-logo-black.png')}" />
                    </div>
                    <div class="cta">
                        <a class="btn">1-845-456-7888</a>
                    </div>
                </div>
            </div>
        </section>
        <section class="help-desk__header">
            <div class="container">
                <h1>Requests</h1>
            </div>
        </section>
        <section class="help-desk__sub-header">
            <div class="container">
                <ul class="help-desk__breadcrumbs">
                    <li><a href="//help.mysite.com" target="_blank">My Support Center</a></li>
                    <li>Submit a Request</li>
                </ul>
            </div>
        </section>
        <section class="help-desk__content">
            <div class="container">
                <div class="row">
                    <div class="col-md-5">
                        <h3>Submit a request</h3>
                        <div>&nbsp;</div>
                        <div class="form-field">
                            <label>Your email address<span class="required">*</span></label>                            
                            <apex:inputField id="Email" required="true" value="{!c.Email}"/>                            
                        </div>
                        <div class="form-field">
                            <label>Subject<span  class="required">*</span></label>                            
                            <apex:inputText id="Subject" required="true" value="{!strSubject }" maxlength="250" size="25" />
                        </div>
                        <div class="form-field">
                            <p>Please enter the details of your request. A member of our support staff will respond as soon as possible.</p>
                        </div>
                        <div class="form-field">
                            <label>Description<span class="required">*</span></label>                            
                            <apex:inputTextarea id="Description" required="true" value="{!strDescription}"/>
                        </div>
                       <!--<div class="form-field">
                            <label>Attachments</label>
                            <div class="upload-box text-center ripple">
                               <input type="file"  value="{!attachment.body}"  filename="{!attachment.name}" />
                                <span><img src="{!URLFOR($Resource.SC_CSS,'css/images/paperclip.png')}"  /></span>
                                <span><a>Add file</a> or drop files here</span>
                            </div>
                        </div>-->
                        <div class="form-field">
                            <label>Attachments</label>
                            <div>                                
                                <apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file"/>
                            </div>
                        </div>
                        <div class="form-field text-right">
                           <a class="btn" onclick="jsCallSavefn()" >Submit</a>                         
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section class="help-desk__footer">
            <div class="container">
                <div class="row">
                    <div class="col-md-5">
                        <div class="logo">
                            <img src="{!URLFOR($Resource.SC_CSS,'css/images/my-logo-black.png')}"   />
                        </div>
                        <p>Mysite is the all-in-one solution for local business owners &ndash; equipping them with an HTML5, mobile-responsive website and an ever-expanding product suite that gives them the power to tell their story and reinvent their digital presence.</p>
                        <p>&copy; 2017 Mysite. All rights reserved.</p>
                    </div>
                    <div class="col-md-7">
                        <div class="row">
                            <div class="col-md-6">
                                <h3>Company</h3>
                                <ul class="bordered-list">
                                    <li><a href="//www.mysite.com/" target="_blank">What is Mysite?</a></li>
                                    <li><a href="//blog.mysite.com/" target="_blank">Blog</a></li>
                                </ul>
                            </div>
                            <div class="col-md-6">
                                <h3>Community</h3>
                                <ul class="bordered-list">
                                    <li><a href="https://www.facebook.com/MysiteTeam" target="_blank">Facebook</a></li>
                                    <li><a href="https://twitter.com/mysiteteam" target="_blank">Twitter</a></li>
                                    <li><a href="https://www.youtube.com/user/mysiteteam" target="_blank">Youtube</a></li>
                                    <li><a href="https://www.instagram.com/mysiteteam/" target="_blank">Instagram</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </body>
</html>
<apex:actionFunction action="{!Save}" name="jsCallSavefn">  
</apex:actionFunction>
</apex:form>
</apex:page>

Controller,
 
public with sharing class CaseController {

    public Contact c { get; set; }
    
    public CaseController(){
       c = new Contact();
    }
    
    public Attachment attachment {
    get {
      if (attachment == null)
        attachment = new Attachment();
      return attachment;
    }
    set;
    }
     
    public string strSubject {get;set;}     
    public string strDescription {get;set;}     

    public PageReference save()
    {   
        String Body  = strDescription;

        String Subject = strSubject;
        List<String> toAddresses  = new List<String>();
        toAddresses.add('mysitesupportcase@z-279vlo46d4dn63rs8liuxfyuv0t1fjox5sgnsyr0nc6ccct0n0.m-4etgeaq.cs20.apex.sandbox.salesforce.com');
        toAddresses.add('ckarthikeyanbtechit@gmail.com');
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setSubject(Subject);
        mail.setReplyTo(c.Email);
        mail.setSenderDisplayName(c.Email);
        mail.setToAddresses(toAddresses);
        mail.setHtmlBody(body);
        if(attachment.body != null)
        {
            Blob b = attachment.body;
            Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
            efa.setFileName(attachment.name);
            efa.setBody(b); 
            mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});     
        }       
        
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
        
        PageReference newocp = new PageReference('/apex/SampleRedirectPage');
        newocp.setRedirect(true);
        return newocp;
        return null;
    }
    
     
   
}

Can anyone fix this ASAP?

Thanks,
Hi Team,

I need to update a custom field in case object whenever the case owner changed from a user to queue.

Can anyone help me to fix this with a trigger ASAP?

Thanks,
Karthikeyan
Hi Team,

I want to get opportunities that are related to case as a related list using VF page.

Can anyone help to fix this?

Thanks & Regards,
Karthikeyan Chandran
Hi Team,

Can anyone help me to fix this issue to Batch Class for Contacts not related to Case ASAP?

Thanks & Regards,
Karthikeyan Chandran
Hi,

I am deploying a class(Birthday emailer) apex class from a sandbox to production, i getting the below error while i am deploying this apex class. i have deployed the same apex class (Birthday emailer) two months ago there was no error while i deployed.
 
Apex Test Failures 
 Class NameMethod NameError Message
 Milestone1_Test_ClonetestMilestoneCloneActiveOwnerSystem.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_USERNAME, Duplicate Username.<br>The username already exists in this or another Salesforce organization. Usernames must be unique across all Salesforce organizations. To resolve, use a different username (it doesn't need to match the user's email address). : [Username] 
Stack Trace: Class.Milestone1_Test_Utility.createSFUser: line 338, column 1 Class.Milestone1_Test_Clone.testMilestoneCloneActiveOwner: line 407, column 1
 Milestone1_Test_ClonetestMilestoneCloneInactiveOwnerSystem.DmlException: Update failed. First exception on row 0 with id 00537000001izzOAAQ; first error: UNKNOWN_EXCEPTION, You cannot edit this field: [IsActive] 
Stack Trace: Class.Milestone1_Test_Clone.testMilestoneCloneInactiveOwner: line 360, column 1
 Milestone1_Test_ClonetestProjectCloneInactiveOwnerSystem.DmlException: Update failed. First exception on row 0 with id 00537000001izzRAAQ; first error: UNKNOWN_EXCEPTION, You cannot edit this field: [IsActive] 
Stack Trace: Class.Milestone1_Test_Clone.testProjectCloneInactiveOwner: line 289, column 1
     


The test class "Milestone1_Test_Clone" is from installed package not created by us.  i don't know what is the root cause of this issue.

Can any one help me to fix this?

Thanks,

 
Hi,

Using trigger, I just want to auto create new contract records under the opportunity when ever the Opportunity record record type is set to (Record Type1 or Record Type2 or Record Type3) and Opportunity Stage = Closed Won. also the Contract Record owner will be same as the Opportunity Owner for the auto created record.

Thanks & Regards,
Karthikeyan Chandran
Hi,

Here, the related list button should visible only when i choose the values "REQ", "Solution Sale" in the picklist field 'Pre Opportunity Type' and the picklist Approval Status valus is "Approved".

So, I just used the below java script to create a list button and i got an error,

https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3C (https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3C

https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3H (https://developer.salesforce.com/forums/servlet/rtaImage?eid=906F0000000BYUM&feoid=Body&refid=0EMF0000000RD3H)
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} 

if('{!Pre_Opportunity_Stage__c.Pre_Opportunity_Type__c}' == 'RFQ','{!Pre_Opportunity_Stage__c.Pre_Opportunity_Type__c}' == 'Solution Sale'){ 
window.open('https://cs50.salesforce.com/006/e?retURL=%{!Account.Id}&accid={!Account.Id}'); 
} 
else{ 
alert('You can not create new oppty'); 
}


In my URL:
https://cs50.salesforce.com/006/e?retURL=%&oppid=

The error message is:

Illegal Request
You have sent us an Illegal URL or an improperly formatted request. 

I don't know what i am missing here. i already post a question link - https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BYUMIA4# 

I need to fix it immediately ASAP.

Can you help me on this?

Thanks & Regards,
Karthikeyan Chandran