• Newbie_edm
  • NEWBIE
  • 50 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 12
    Replies
Dear Friends,

I got a requirement to

1) have button in salesforce record,
2) onclick it should connect to SharePoint folder,
3) search file,
4) if it finds the file, get that file path,
5) create notes on that record with the file path details.

It would be great help if you could send me some sample code(Javascript/Apex) which i can use as model to achive this task.

thanks lot for your help
 
Hello Friends,

I have a requirement to get child records and display in VF page and update all records when they click save button, could you please send me the link or sample code if there is one?

VF page
checkbox   Field1   Field2   Field3 Field4
  -                      -       -           -          -
  -                      -        -          -          -
                 Save Button

If they click save button all selected checkbox records should be updated via Apex controller or Javascript function.

I am able to get the records to VF page but I couldnt get the selected record ID and pass it to controller

Any help on this really appreciate.

thanks
Hello Friends,

I am volunteering non profit organization, they have thier site in workpress, they would like to have form in Workpress and get volunteer request details in web to lead hrml form and create account in Lead object. I have generated Web to Lead form and it is working on our computer, but when we add the code to wordpress it is not working. 

It would be great help if you could guide me on this.

thanks
Dear Friends,

i got an requirement, I have teacher and student lookup relationships objects. Teacher object will have student related list, student related list will show student name and their total fees paid. I need to have custom field in Teacher object which will show total fees of all students uunder him.
i would like to use batch apex to update the total fees in Teached object based on student related list fees.

it would be great help if you could direct me to get the proper sample code.

Teacher Obect 
                  Fee total ( Sum ( all students fees under this teacher))


 Thanks in advance 
 
Hello,

I would like to have validation rule which allow to modify the record if condition A and B or satisfied, if not it should through validation error message. how can we do that?

example
AND( 
AND($Profile.Id <> 'X',(Text(statusField) ='In Progress')),  /* if both conditions are satisfied then it should allow the record to modify */
AND(Hours__c < Field-hours),                                           
OR($Profile.Id <> 'Y', ISCHANGED(statusField), 
OR($Profile.Id <> 'YY', ISCHANGED(statusField)), 
OR($Profile.Id <> 'XX', ISPICKVAL(statusField,'Approved')) /* if both conditions are satisfied then it should allow the record to modify */ 

))
Hello,

I am getting following error message when i try to login using ADFS/Single sign on salesforce page. could you please provide some guidance on this

"We can't log you in. Check for an invalid assertion in the SAML Assertion Validator (available in Single Sign-On Settings) or check the login history for failed logins."

thanks
Hello,

I have "Log a Call", "New Task" and "Email" are in lightning activity tab, I would like to keep this for all object without changing the order, currently one object is having New Tast, Email , Log a Call and other objects are different, is it possible to keep the same order for all the object?

thanks
In Accounts, I can't log a call. I would like to have Log a Call, New Task and Email for all objects if applicable, is it possible?

 
Hello Guys,

I am new to documentation. I got asked to document the existing class, batch jobs, triggers for migration perpose. could you guys give some idea where to start and how we can identify the class and related objects? it would be great help if you guys could provide some guidance on this.

thanks
Hello,

I have Lightning page, I would like to have Lookup component which pulles details from Account Object. Please let me know how i can do this.

thanks,
Hi Guys,

I would like to add record to object B using trigger, this trigger should only add record to B if record A fieldnumber is null/blank, how can we do that?

If(account.fieldnumber == null/blank/empty)

thanks
Hi Guys,

My code works in sandbox and production with litter data but not loading calendar when record count goes more than 3000. any thoughts?


my apex code

public class ColoredCalendar {

 public string myProperty {get; set;}
 public string myview {get; set;}
 public string theValue {get; set;}
public static List<String> values {get; set;}
public String positions {get; set;}
public  String selectedLocation{get; set;}
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 ColoredCalendar () {
        //Default showing my events to on
        includeMyEvents = true;
       
    }


       

 
 
        
        public List<SelectOption> getItems() {
        
         
         string ownerid=ApexPages.currentPage().getParameters().get('ownerid');
          events = new list<calEvent>();
             user loginuser =[select id,TimeZoneSidKey  from user where id=:ownerid];

            List<SelectOption> options = new List<SelectOption>();

                        Set<String> locationName = new Set<String>();
                        
                         

                    for (Event e : [SELECT Location FROM Event where ownerid=:ownerid limit 9999])
                            {
                              if(e.location!=null){
                              locationName.add(e.location); // contains distict accounts
                              }
                            }
 
            options.add(new selectOption('', '- None -'));
            
            for (String s : locationName)
             {
                
                options.add(new selectOption(s, s));
             }
         
            return options;

        }
          


    public PageReference pageLoad() {
    
                        if(myProperty == null){
                    myview ='month';
                    }
                   if(myProperty == 'agendaWeek'){
                    myview ='agendaWeek';
                    }
                   if(myProperty == 'agendaDay'){
                    myview ='agendaDay';
                    }               
                    if(myProperty == 'month'){
                    myview ='month';
                    }
                    
                    System.Debug('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!The myview value is : ' + myview);
                   System.Debug('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!The myProperty value is : ' + myProperty);
    
        string ownerid=ApexPages.currentPage().getParameters().get('ownerid');
        events = new list<calEvent>();
             user loginuser =[select id,TimeZoneSidKey  from user where id=:ownerid];
          //Get my Events if we hrave selected the correct option
        
          String query ='select Id, Subject, isAllDayEvent, StartDateTime, EndDateTime, Location from Event where id!=NULL';
          if(ownerid!=null)
          {
             query+= ' AND ownerid=:ownerid';
             
          }
          
         if(selectedLocation !=null )
          {
             query+= ' AND Location=:selectedLocation';
             
          }
          
          List<SObject>  resultSet = Database.query(query);
          
          
          
            for(SObject evnt: resultSet){
                 

                DateTime startDT = (datetime)evnt.get('StartDateTime');
                DateTime endDT = (datetime)evnt.get('EndDateTime');
                calEvent myEvent = new calEvent();

                myEvent.title = (String)evnt.get('Subject');
                myEvent.allDay = (boolean)evnt.get('isAllDayEvent');
                myEvent.location = (String)evnt.get('Location');
                myEvent.startString = convertdatetime(startDT,loginuser.TimeZoneSidKey  ).format();
                myEvent.endString = convertdatetime(endDT ,loginuser.TimeZoneSidKey  ).format();
                 String[] parts1 =  myEvent.startString.split(' ');
                   String[] parts2 =  myEvent.endString .split(' ');
                   myEvent.starttime=parts1 [1];
                   myEvent.endtime =parts2[1];
                   
    //system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@' + myEvent.location.indexOf('[B]'));
        //        String str = myEvent.location;
       //         if(myEvent.location.indexOf('[B]')!=-1)
       //         {
       
     //   myEvent.className = 'classB';
     //   system.debug('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' +str);
        system.debug('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%' +myEvent.location);
      //          }
    
    
                    
                

  
                   
           //  if(Location_substr.containsOnly('A]'))
             //   {
            //          myEvent.className = 'classA';
                      
             //  }
            //  
            

              if(myEvent.location!=null){
            
                  if(myEvent.location.indexOf('[A]')!=-1)
                  {
                        myEvent.className = 'classA';
                  }
                  if(myEvent.location.indexOf('[B]')!=-1)
                  {
                        myEvent.className = 'classB';
                  }
                  if(myEvent.location.indexOf('[C]')!=-1)
                  {
                        myEvent.className = 'classC';
                  }
                  if(myEvent.location.indexOf('[D]')!=-1)
                  {
                        myEvent.className = 'classD';
                  }
                  if(myEvent.location.indexOf('[E]')!=-1)
                  {
                        myEvent.className = 'classE';
                  }
                  if(myEvent.location.indexOf('[F]')!=-1)
                  {
                        myEvent.className = 'classF';
                  }
                 if(myEvent.location.indexOf('[G]')!=-1)
                  {
                        myEvent.className = 'classG';
                  }
                  
                  if(myEvent.location.indexOf('[H]')!=-1)
                  {
                        myEvent.className = 'classH';
                  }
                  if(myEvent.location.indexOf('[I]')!=-1)
                  {
                        myEvent.className = 'classI';
                  }
                  if(myEvent.location.indexOf('[J]')!=-1)
                  {
                        myEvent.className = 'classJ';
                  }    

                                      
              }else
              {
                     myEvent.className = 'classK';
              
              }
               events.add(myEvent);
      
          
                 
            }
            
    // System.Debug('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!The value is theValue : ' + theValue);
               //   System.debug('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$4VARIABLE MYPROPERTY------' + myProperty);


        return null;
    }

  /*  public PageReference toggleMyEvents() {
        if(includeMyEvents){
            includeMyEvents = false;
        }
        else{
            includeMyEvents = true;
        }
        pageload();
        
        return null;
    } */
    
    
    public datetime convertdatetime(datetime getdatetime, string ownerZoneKey)
    {
        TimeZone OwnerTimZone= TimeZone.getTimeZone(ownerZoneKey);
        integer owner_Offest= OwnerTimZone.getOffset(getdatetime);

       TimeZone LoginuserTimeZone= UserInfo.getTimeZone();
        integer Loginuser= LoginuserTimeZone.getOffset(getdatetime);
           integer diff = owner_Offest-Loginuser;
       return     getdatetime.addMinutes(diff /(1000 * 60));

    }

    //Class to hold calendar event data
    public class calEvent{
        public String title {get;set;}
        public Boolean allDay {get;set;}
        public String location {get;set;}
        public String startString {get;set;}
        public String endString {get;set;}
        public String url {get;set;}
        public String className {get;set;}
        public string starttime{get;set;}
        public string endtime {get;set;}
        public string countries {get;set;}
        public string color {get;set;}
        public string theValue {get; set;}
       
    }
}

VF page code.

<apex:page showHeader="false" controller="V_CalendarController1" action="{!pageLoad}" readOnly="true">
    <link href="{!URLFOR($Resource.fullcalendar,'fullcalendar/fullcalendar.css')}" rel="stylesheet" />
    <link href="{!URLFOR($Resource.fullcalendar,'fullcalendar/fullcalendar.print.css')}" 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="{!URLFOR($Resource.fullcalendar,'fullcalendar/fullcalendar.min.js')}"></script>
    
       
 <apex:outputPanel id="calPanel">
   
    <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 Month,today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'

                    
                }, 
                


                
                editable: false,
                
                minTime: '06:00:00',
                maxTime: '22:00:00',
                slotEventOverlap: false,
 
     
                events:
                [
                    //At run time, this APEX Repeat will reneder the array elements for the events array
                              
                               
                    <apex:repeat value="{!events}" var="e" id="scannersDiv">
                      
                        {
                            title: "{!e.starttime} - {!e.endtime} | {!e.title} | {!e.location}",
                            start: '{!e.startString}',
                            end: '{!e.endString}',
                            url: '{!e.url}',
                            allDay: {!e.allDay},
                            className: '{!e.className}'

                       

                        },
                       
                    </apex:repeat> 
                   
   
                ]
                
                
                
                

       });
            

        
      

      
        });
               
   //auto scrolls down to current day
            var d = new Date();
            var day = d.getDate();
            $('html, body').animate({
            scrollTop: $('.fc-day-number:contains("'+day+'")').offset().top
            }, 1000);
            
 
      
</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;}
       .classA {background:#8A6CE4;border-color:#eac2c8;text-color:#FFFFFF;}
       .classB {background:#6BD459; border-color:#56BF44; text-color:#FFFFFF;}
       .classC {background:#54B3E2; border-color:#42A1D0; text-color:#FFFFFF;}
       .classD {background:#54B3E2; border-color:#42A1D0; text-color:#FFFFFF;}
       .classE {background:#E8D14E; border-color:#DAC134; text-color:#FFFFFF;}
       .classF {background:#d1d6ef; border-color:#c2c8ea; text-color:#000000;}
       .classG {background:#c8eac2; border-color:#bbe5b3; text-color:#000000;}
       .classH {background:#efd1d6; border-color:#eac2c8; text-color:#000000;}
       .classI {background:#d1e5ef; border-color:#b3d4e5; text-color:#000000;}
       .classJ {background:#eae4c2; border-color:#e5ddb3; text-color:#000000;}

        .fc-event-inner {width:98%;}
        .fc-event-time {display:none;}
 
    
        
        
    </style> 

<apex:form >
<table align="center">
            <tr>  
            <td> <b> Select Location </b></td>  
            <td> <apex:selectList value="{!selectedLocation}"  size="1" id="test">
            <apex:actionSupport event="onchange"  action="{!pageLoad}"/>
                       <apex:selectOptions Value="{!items}">
                               
                             
                 
                              </apex:selectOptions>
                          </apex:selectList>  </td>

            </tr>

</table>

</apex:form>
   
        <!-- my code End -->  
            <div id="cal-legend">
                <ul>

                   <!-- <li style="{!IF(includeMyEvents,'','display:none')}"><span class="event-personal"></span>My Events</li-->
                </ul>
                <div style="clear:both;"><!--fix floats--></div>
            </div>
            <div style="clear:both;"><!--fix floats--></div>
            <div style="border:0px solid red;padding:10px;">
            <div id="calendar"></div>
            </div> 
 </apex:outputPanel> 
         
</apex:page>
Guys,

I need to deploy code from Sandbox to prod, This is the first time I am going to do this, wondering why we need test class to deploy Apex code in production, can you guys give me some sample test class code?
Thanks

 
Guys,

I am trying to pass Javascript Variable value to apex method, it always returns null in apex method when i try to see the value using system.debug,  I did try the following solution from net but still not working, any thoughts?

thanks,

--------------------------------------------------------------------------------------------------------------------------------------------

public class myController {
  public string myProperty {get; set;}
 

  public void myTest() {
    System.debug('VARIABLE MYPROPERTY------' + myProperty);

  }

}
 
And on the visualforce you can pass javascript variable as -
 
Using InputHidden
<apex:inputHidden value="{!myProperty}" id="inptHdn"/>
 
<script>
  function passVariable() {
    String str = 'my test value';
    document.getElementById('<ID OF INPUT HIDDEN>').value = str;
  }
</script>
 
Using action function
 
<apex:actionFunction name="myFun" action="{!myTest}">
  <apex:param name="a" value="" assignTo="{!myProperty}"/>
</apex:actionFunction>
 
and you can call this action function from javascript method as
 
<script>
  function passVariable() {
    String str = 'my test value';
    myFun(str);
  }
</script>

-----------------------------------------------------------------------------------
Hi Guys,

I need you guys help!. I have javascript variable value X, I need to pass this value to apex controller method. how can we do that....
Dear Friends,

I have jquery fullcalendar plugin attched to my VF page, I have select list in the top which has locations, when user select location then it calls apex method and displays the event related to location. I have a problem here, when they change the location, it reloads the page and the calendar view goes back to week view to month view. Can you guys suggest me the way we can update the calendar events without loading the entire page..

Full Calendat ref link : http://fullcalendar.io/

Thanks,
 
Hi guys,

I need you guys help here, I have string which contains [A], I need to call class only if that main string has that [A] format it should not call class if it finds just A in that main string. How can we achieve this in Apex code?

Thanks.
Visualforce Page fullcalendar events color not working for weeks and day display
Hello,

I have visualforce page has fullcalendar, developed using following page, "http://www.codebycody.com/2013/06/create-calendar-view-in-salesforcecom.html"/ "fullcalendar.io" sites

I am able to color the events and its working for month view, I used  the following function to color the events. Its working for month.
$('div.event-personal:contains("A")').css({ 'background': '#efd1d6', 'border-color': '#eac2c8', 'text-color': '#FFFFFF' /*Red*/ });

When i change to display to week or day the color goes to default coloring. It would be great help if you guys could guide me on this.

thanks.
Hello,

I have visualforce page has fullcalendar, developed using following page, "http://www.codebycody.com/2013/06/create-calendar-view-in-salesforcecom.html"

I am able to color the events and its working for month view, I used  the following function to color the events. Its working for month.
$('div.event-personal:contains("A")').css({ 'background': '#efd1d6', 'border-color': '#eac2c8', 'text-color': '#FFFFFF' /*Red*/ });

When i change to display to week or day the color goes to default coloring. It would be great help if you guys could guide me on this.

thanks.
 
Hi Guys,

I am new to Salesforce, just stated learning, i am planning to start developing Recruiting APP, is there any workbook available on salesforce? where i specifies the requirements to build app with examples?

thanks
Dear Friends,

I got a requirement to

1) have button in salesforce record,
2) onclick it should connect to SharePoint folder,
3) search file,
4) if it finds the file, get that file path,
5) create notes on that record with the file path details.

It would be great help if you could send me some sample code(Javascript/Apex) which i can use as model to achive this task.

thanks lot for your help
 
Hello Friends,

I am volunteering non profit organization, they have thier site in workpress, they would like to have form in Workpress and get volunteer request details in web to lead hrml form and create account in Lead object. I have generated Web to Lead form and it is working on our computer, but when we add the code to wordpress it is not working. 

It would be great help if you could guide me on this.

thanks
Dear Friends,

i got an requirement, I have teacher and student lookup relationships objects. Teacher object will have student related list, student related list will show student name and their total fees paid. I need to have custom field in Teacher object which will show total fees of all students uunder him.
i would like to use batch apex to update the total fees in Teached object based on student related list fees.

it would be great help if you could direct me to get the proper sample code.

Teacher Obect 
                  Fee total ( Sum ( all students fees under this teacher))


 Thanks in advance 
 
Hello,

I am getting following error message when i try to login using ADFS/Single sign on salesforce page. could you please provide some guidance on this

"We can't log you in. Check for an invalid assertion in the SAML Assertion Validator (available in Single Sign-On Settings) or check the login history for failed logins."

thanks
Hello,

I have "Log a Call", "New Task" and "Email" are in lightning activity tab, I would like to keep this for all object without changing the order, currently one object is having New Tast, Email , Log a Call and other objects are different, is it possible to keep the same order for all the object?

thanks
Guys,

I need to deploy code from Sandbox to prod, This is the first time I am going to do this, wondering why we need test class to deploy Apex code in production, can you guys give me some sample test class code?
Thanks

 
Guys,

I am trying to pass Javascript Variable value to apex method, it always returns null in apex method when i try to see the value using system.debug,  I did try the following solution from net but still not working, any thoughts?

thanks,

--------------------------------------------------------------------------------------------------------------------------------------------

public class myController {
  public string myProperty {get; set;}
 

  public void myTest() {
    System.debug('VARIABLE MYPROPERTY------' + myProperty);

  }

}
 
And on the visualforce you can pass javascript variable as -
 
Using InputHidden
<apex:inputHidden value="{!myProperty}" id="inptHdn"/>
 
<script>
  function passVariable() {
    String str = 'my test value';
    document.getElementById('<ID OF INPUT HIDDEN>').value = str;
  }
</script>
 
Using action function
 
<apex:actionFunction name="myFun" action="{!myTest}">
  <apex:param name="a" value="" assignTo="{!myProperty}"/>
</apex:actionFunction>
 
and you can call this action function from javascript method as
 
<script>
  function passVariable() {
    String str = 'my test value';
    myFun(str);
  }
</script>

-----------------------------------------------------------------------------------
Hi Guys,

I need you guys help!. I have javascript variable value X, I need to pass this value to apex controller method. how can we do that....
Dear Friends,

I have jquery fullcalendar plugin attched to my VF page, I have select list in the top which has locations, when user select location then it calls apex method and displays the event related to location. I have a problem here, when they change the location, it reloads the page and the calendar view goes back to week view to month view. Can you guys suggest me the way we can update the calendar events without loading the entire page..

Full Calendat ref link : http://fullcalendar.io/

Thanks,
 
Hi guys,

I need you guys help here, I have string which contains [A], I need to call class only if that main string has that [A] format it should not call class if it finds just A in that main string. How can we achieve this in Apex code?

Thanks.
Hi Guys,

I am new to Salesforce, just stated learning, i am planning to start developing Recruiting APP, is there any workbook available on salesforce? where i specifies the requirements to build app with examples?

thanks