• Jawad Rehman01
  • NEWBIE
  • 10 Points
  • Member since 2016
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
    Hi Friends,
    
    Hope all would be fine. I have questions regarding appexchange, can you help me to answers it.
    
    1. When we upload application on appExchnage then after installing application by user, app license will be automatically installed?
    
    2. If we have application on appExchange, then for some users can we make it free?
    
    3. We must need develpoer org to relase our app to AppExchnage app?
    
    4. If we upload new version of app to App exchange, it would be automatically installed on all users orgs who are using our app?
Hi,

I want to access the company name and smallphotourl fields from user object in with sharing class and i am not able to access these fields. I have granted access to user by using with sharing button but still not able to access the users. 

I need help that is there any way to access the users in with sharing class so that i access the desired fields from user object.
 
I have problem in using  google API. When i have single value on graph, values on y-axis of garph are reparting. Can any body help me how to solve the issue.
Following is the graph view
User-added image

Graph Code is as follow;
function go()
              {
              	changeDataView();
              	hideMessage();
                var view = document.getElementById("thepage:pb:theForm:dataview");
                var obj = document.getElementById("thepage:pb:theForm:object");
                var startDate = document.getElementById("thepage:pb:theForm:startdate");
                var endDate = document.getElementById("thepage:pb:theForm:enddate");
                var group = document.getElementById("thepage:pb:theForm:group_list");
                var member= document.getElementById("thepage:pb:theForm:member_list");
                var member_data = "";
                if(member)
                {
                	member_data = member.value
                }
                var time_data= document.getElementById("thepage:pb:theForm:time");
                var time = '';
                if(time_data)
                {
                	time = time_data.value;
                }
                var str_start_date = startDate.value;
                var str_start_date_split = str_start_date.split("/");
                str_start_date =str_start_date_split[2]+'-'+str_start_date_split[1]+'-'+str_start_date_split[0];
                var str_end_date = endDate.value;
                var str_end_date_split = str_end_date.split("/");
                str_end_date =str_end_date_split[2]+'-'+str_end_date_split[1]+'-'+str_end_date_split[0];
                var start = new Date(str_start_date);
                var end = new Date(str_end_date);
                var diff = new Date(end - start);
                var days = diff/1000/60/60/24;
                
                if(days<30 && time=="month")
                {
                    alert('Please select days more then 30 for month.');
                    return ;
                }
                if(days<7 && time =="week")
                {
                    alert('Please select days more then 7 for week.');
                    return;
                }            
                 google.charts.setOnLoadCallback(initCharts);
                
        	function initCharts() {        
       			
       			
       				AnalyticsController.getChartDataForAssignmentCountGraphs(view.value,obj.value, startDate.value, endDate.value, group.value,member_data, time,

                 function(result, event){ 
                 	if (typeof result  === 'undefined' || result == null) {
                                 alert('No data found');
                                 return ;
                            }
                            else if(result.length==0)
                            {
                                alert('No data found');
                                return;
                            }
                     var chartresult = result;

                     var data = new google.visualization.DataTable();
                     AnalyticsController.getMembers(view.value,obj.value, startDate.value, endDate.value, group.value, member_data, time,
                                                            function(xresult, event){
                             
                             if (typeof xresult  === 'undefined' || xresult == null) {
                                 return ;
                            }
                            else if(xresult.length==0)
                            {
                                return;
                            }
                            console.log(xresult);
                             data.addColumn('string', 'Assignment Date');
                             
                             for(var i =0; i<xresult.length;i++)
                             {
                                 data.addColumn('number', xresult[i]);
                                 console.log('member');
                                 console.log(xresult[i]);
                             }
                             
    
                         for(var i =0; i<chartresult.length;i++){
    
                            var r = chartresult[i];
                            var arr = [];
                            
                            arr.push(r.closedate);
                            
                            for(var j =0 ; j < result[i].memberscount.length ; j++)
                            {
                                arr.push(chartresult[i].memberscount[j].count);
                            }
                            console.log('count');
                            console.log(arr);
                            data.addRow(arr);
    
                          }
                         var strin = '';
                         var sub = '';
                         if(view.value == 'AssignmentCountPerGroupView')
    					 {
                         strin = 'Assignment Count: Per Assignment Group';
                         sub ='Shows Lead/Cases assignment count per time(hour,day,week,month) for multiple Assignment Groups.';
                         }
                         else if( view.value == 'AssignmentCountPerMemberView')
   						 {
   						 strin = 'Assignment Count: Per Assignment Group Member';
   						 sub ='Shows Leads/Cases assignment count per time(hour,day week,month) for multiple Assignment Group Members.';
   						 }
   						 else if(view.value == 'AveragePerMember')
   						 {
   						 strin = 'Average: assigned per member';
   						 sub ='Shows a grid listing each member and the total assigned number within the date range and the average per time(hour, day, week, month).';
   						 }
                          var options = {
                            chart: {
                              title: strin,
                               subtitle: sub                              
                             },
                            height: 500,
                           
                            axes: {
                              x: {
                                0: {side: 'top'}
                              }
                            }
                          };

                    var chart = new google.charts.Line(document.getElementById('chartBlock2'));

                      chart.draw(data, options);
                     }); 

              }, {escape:true});
       			
       			}
          }

 
Hi developers,

I am creating chart using google charting API. The chart is working on load of the page but when i use the api with button click, the chart is not rendering. I have debug the code and found that google api is calling the function but problem in remoting function on click of button

Visualforce Code
<apex:page controller="GoogleChartsController" sidebar="false"> 
    <!-- Google API inclusion -->
    <apex:includeScript id="a" value="https://www.google.com/jsapi" />
     
    <apex:sectionHeader title="Google Charts + Javascript Remoting" subtitle="Demoing - Opportunities by Exepected Revenue"/>
    <apex:form >
         <apex:pageBlock >
        <apex:pageBlockSection >
             <apex:commandButton value="Go" onclick="testfunction();"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
   
    <!-- Google Charts will be drawn in this DIV -->
    <div id="chartBlock" />
     
    <script type="text/javascript">
    
        function testfunction()
        {
             // Load the Visualization API and the piechart package.
        google.load('visualization', '1.0', {'packages':['corechart']});
       
        // Set a callback to run when the Google Visualization API is loaded.
        google.setOnLoadCallback(initCharts);
   
        function initCharts() {         
          // Following the usual Remoting syntax
          // [<namespace>.]<controller>.<method>([params...,] <callbackFunction>(result, event) {...}
          // controller : GoogleChartsController
          // method : loadOpps
          ortoo_qra.GoogleChartsController.loadOpps( 
                 function(result, event){  
                     // load Column chart
                     var visualization = new google.visualization.ColumnChart(document.getElementById('chartBlock'));
                     // Prepare table model for chart with columns
                     var data = new google.visualization.DataTable();
                     data.addColumn('string', 'Opportunity');
                     data.addColumn('number', 'Expected Revenue');
                     data.addColumn('number', 'Amount');    
                     // add rows from the remoting results
                     for(var i =0; i<result.length;i++){
                        var r = result[i];
                        data.addRow([r.Name, r.ExpectedRevenue, r.Amount]); 
                      }
                    // all done, lets draw the chart with some options to make it look nice.
                    visualization.draw(data, {legend : {position: 'top', textStyle: {color: 'blue', fontSize: 10}}, width:window.innerWidth,vAxis:{textStyle:{fontSize: 10}},hAxis:{textStyle:{fontSize: 10},showTextEvery:1,slantedText:false}});
              }, {escape:true});
          } 
        }
       
    </script>
</apex:page>

Controller 
global with sharing class GoogleChartsController {
     
    /**
      Loads most recent 10 Opportunities
    */
    @RemoteAction   
    global static Opportunity[] loadOpps() {
        return [select Id, Name, ExpectedRevenue, Amount from Opportunity order by CreatedDate DESC limit 10];
    }   
 
}

 
I need to create chart using visualforce. I want to create the following graph;

User-added image 

I used the beloe example in the link to obtained the graph but problem is that titles and fields are dynamics as the date ranges
are between two dates. i.e. From:1/2/2016 To: 28/03/2016. The titles will be dynamic of dates found in SOQL query.
http://salesforce.stackexchange.com/questions/38557/bar-graph-with-multiple-data-points

In below examples the fields are data1,data2,and data2 and also the titles are fixed which are 'Acme', 'Berlitz', 'Concorde' but my case the titles will be date range and count will be the no of leads crated on specific date on basis of owner.
Is it true that limit excpetion will abort all my schedculed jobs. Or i have wrong in my code something.
    Hi Friends,
    
    Hope all would be fine. I have questions regarding appexchange, can you help me to answers it.
    
    1. When we upload application on appExchnage then after installing application by user, app license will be automatically installed?
    
    2. If we have application on appExchange, then for some users can we make it free?
    
    3. We must need develpoer org to relase our app to AppExchnage app?
    
    4. If we upload new version of app to App exchange, it would be automatically installed on all users orgs who are using our app?
Hi,

I want to access the company name and smallphotourl fields from user object in with sharing class and i am not able to access these fields. I have granted access to user by using with sharing button but still not able to access the users. 

I need help that is there any way to access the users in with sharing class so that i access the desired fields from user object.
 
<form action="action_page.php">
  First name:<br>
  <input type="text" value="Mickey"><br>
  Last name:<br>
  <input type="text" name="lastname" value="Mouse"><br><br>
  <input type="submit" value="Submit">
</form>
I have a website with an HTML form with 2 fields on a website (example: www.abc.com/test.htm), how do i submit this data to a contact object in salesforce. It should not throw error if the record already exists in contact(salesforce).

What is the standard way to do it?

 
I need to create chart using visualforce. I want to create the following graph;

User-added image 

I used the beloe example in the link to obtained the graph but problem is that titles and fields are dynamics as the date ranges
are between two dates. i.e. From:1/2/2016 To: 28/03/2016. The titles will be dynamic of dates found in SOQL query.
http://salesforce.stackexchange.com/questions/38557/bar-graph-with-multiple-data-points

In below examples the fields are data1,data2,and data2 and also the titles are fixed which are 'Acme', 'Berlitz', 'Concorde' but my case the titles will be date range and count will be the no of leads crated on specific date on basis of owner.
Is it true that limit excpetion will abort all my schedculed jobs. Or i have wrong in my code something.