• Samuel JohnsonCBE
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 16
    Replies
Requirment is to clone the opportunity with all of the related record information,  contact roles, activity history, ect..  Is this possible and if so how.  This will also need to be used in Lightning
I am tyring to build a process that will count the number of opportunities in a particular stage and based upon results will determine with picklist value on the account page will have.  Example
Opportunity Status is set to Status 1.  update Opportunity 2 to a higher status, it would change the account picklist value.  If that same opportunity were to be lost it would then lower the account field.  Then if the 1st opportunity also loses it would then change the account picklist field again.  Basisally which ever has the highest opportunity status between creating opportunity, higher statuses or lost would determine with value it is.  

Any thoughts. 
I have a formula that I am using in a visualforce page.  I was able to finally able to get it to only show the date instead of the date time even though I was using just a date field.  Now I need to add 30 days to it.  here is my formula
{!  TEXT ( Month ( DATEVALUE (account.Archieved_Date__c ))) &"/"&  TEXT( DAY(DATEVALUE( account.Archieved_Date__c+30  ))) &"/"& TEXT(YEAR(DATEVALUE( account.Archieved_Date__c)))  }

I also tried it like this...
{!  (TEXT ( Month ( DATEVALUE (account.Archieved_Date__c ))) &"/"&  TEXT( DAY(DATEVALUE( account.Archieved_Date__c  ))) &"/"& TEXT(YEAR(DATEVALUE( account.Archieved_Date__c)))  + 30) }
I have created a visualforce page with two charts on the same page.  What I would like to do is be able to use the "var options" on each chart.  The representation options would be different for each.  I would like to have a different green area. for each.   I have also included my code here as well to try to figure this out.  

User-added image
 var data = google.visualization.arrayToDataTable([
          ['Label', 'Value'],
          ['Open Rate', {!campaign.Avg_Open_Rate__c}],
          ['Click Rate', {!campaign.Avg_Click_Rate__c}],
         
     
        
        ]);

        var options = {
          
          width: 400, height: 300,
          greenFrom: -6, greenTo: 6,
          min: -50,
          max: 50,
          majorTicks: [-40, -30, -20, -10, 0, 10, 20, 30, 40]
        };

        var chart = new google.visualization.Gauge(document.getElementById('chart_div'));

        chart.draw(data, options);

        setInterval(function() {
          data.setValue({!campaign.Avg_Open_Rate__c});
          chart.draw(data, options);
        }, 13000);
     
I am trying to build an excel type look and feel onto a new custom object.  What I would like it to look like during an edit on the edit page is...
User-added image
but then when I click save I would like it to look like this...
User-added image
Is this possible.  If so how would I set this up.  
Is it possible to build an app for mobile that will pull on the calendar just like the today menu option.  I don't want to see the recent records or a dashboard.  I would also like to build an app that pull tomorrow calendar.  
I am trying to create a table in visualforce using a formula and it is giving me this error.  Incorrect parameter type for operator '/'. Expected Number, received Object.  Here is the formula that I am trying to use 
<td align="Center"><apex:outputText value="{!Financial__c.January_Seats_Actual__c / Financial__c.January_Seats_Forecast__c}"/></td>
I am wondering is there a way to create a table in a visualforce page and when you click it changes all of the values in the cell to a read only kind of what you find in any regular object layout, but then be able to click edit and it revert back to being able to edit the cells.  If so how would the code structure look for those.  Would i need to have the fields build on the object or could I just have some input field there to save the value.  Any thoughts
I have built a visual force page and using a chart.  I would like to have the chart display even is there is no values in all of the rows.  I had tried to ad a formula field thinking that may fix the issue but it didn't.  Any so if March is blank that it will still show the chart with Jan and Feb. and so on.  

    data.addRows([
      ['Jan', {!If(NOT(ISBLANK (Market_Share__c.January__c)), Market_Share__c.January__c,null)} ],
      ['Feb', {!If(NOT(ISBLANK (Market_Share__c.February__c)), Market_Share__c.February__c, null)} ],
      ['Mar', {!If(NOT(ISBLANK (Market_Share__c.March__c)), Market_Share__c.March__c ,null)}  ],
      ['Apr', {!If(NOT(ISBLANK (Market_Share__c.April__c)), Market_Share__c.April__c ,null)} ],
      ['May', {!If(NOT(ISBLANK (Market_Share__c.May__c)), Market_Share__c.May__c ,null)} ],
      ['Jun', {!If(NOT(ISBLANK (Market_Share__c.June__c)), Market_Share__c.June__c ,null)} ],
      ['Jul', {!If(NOT(ISBLANK (Market_Share__c.July__c)), Market_Share__c.July__c ,null)} ],
      ['Aug', {!If(NOT(ISBLANK (Market_Share__c.August__c)), Market_Share__c.August__c ,null)} ],
      ['Sep', {!If(NOT(ISBLANK (Market_Share__c.September__c)), Market_Share__c.September__c ,null)} ],
      ['Oct', {!If(NOT(ISBLANK (Market_Share__c.October__c)), Market_Share__c.October__c ,null)} ],
      ['Nov', {!If(NOT(ISBLANK (Market_Share__c.November__c)), Market_Share__c.November__c ,null)} ],
      ['Dec', {!If(NOT(ISBLANK (Market_Share__c.December__c)), Market_Share__c.December__c ,null)} ],
Is there a way to use the standard save button and have my visualforce fields change to be a read type format just like other fields on other objects.  Also I would like to know if I can format the cells just like I have on my excel sheet.  Here is what my visual force page looks like, and the excell sheet.  I would like it to like the same if possible and have the capability to save the field values and not be able to edit them untill hit edit button.
 User-added image
User-added image
I am trying to create a visualforce matrix chart that looks some thing like this..

User-added image

I would like to have it set that the columns and row headers are set, but want to have the other field editable. I will then create reports that look like this as well. Where is says PSI maybe have that editable as well. Do you have any suggestions on how to build this? 
I have built a simple tab structure for the opportunity page.  I am using a custom field, it is not showing the name of the field before the picklist value.  Also I was wondering is there a way to have the save button act just like the standard save button that just shows that field not the box where I can add text of pick some thing. 

<apex:page standardController="Opportunity" sidebar="false" showHeader="false">
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="OpportunityTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
      <apex:tab label="Onboarding"> 
          <apex:form >
               <center><apex:commandButton action="{!Save}" value="Save"/></center><br></br> <br></br>
                    <apex:inputField value="{!opportunity.Growth_Enhancement_Track__c}"/>
          </apex:form>
     </apex:tab>
          <apex:tab label="Analysis">
     </apex:tab>
           <apex:tab label="Follow-up">
      </apex:tab>
  </apex:tabPanel>
</apex:page>

This is what it looks like also after I hit save.

User-added image
This is what I would like it to look like after I hit save. Fields are just an example

User-added image
 
I am trying to add a gauge onto the account page.  I am trying to pull only the field Variance by Percentage into the gauge.  It allowed me to save the code but nothing is showing up when I add it to the page layout.  Any suggestions.

<apex:page standardcontroller="Account" sidebar="false" showHeader="false">
<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["gauge"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {

        var data = google.visualization.arrayToDataTable([
          ['Label', 'Value'],
          ['', SELECT Id, Variance_by_Percentage__c FROM Account],
         
        ]);

        var options = {
          width: 400, height: 120,
          greenFrom: -5, redTo: 5,
          Min: -20,
          Max: 20,
          majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20]
        };

        var chart = new google.visualization.Gauge(document.getElementById('chart_div'));

        chart.draw(data, options);

        setInterval(function() {
          data.setValue(0, 1, 40 + Math.round(60 * Math.random()));
          chart.draw(data, options);
        }, 13000);
        setInterval(function() {
          data.setValue(1, 1, 40 + Math.round(60 * Math.random()));
          chart.draw(data, options);
        }, 5000);
        setInterval(function() {
          data.setValue(2, 1, 60 + Math.round(20 * Math.random()));
          chart.draw(data, options);
        }, 26000);
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 400px; height: 120px;"></div>
  </body>
</html>
</apex:page>

 
Im trying to put a gauge onto the account page.  Im using the field "variance_by_percentage__c" which I put into the ['label', 'value'].  is this the right place to put it.  I am getting the error: Unknown property 'Account.Variance-by_Percentage__c' referenced in Variance_Gauge which is the name of the page im trying to create.  I want to show the gauge for the account im in.  os that is why i am also using ?id on line #2.  Any sugguestions

<apex:page>
?id=

<apex:sectionHeader title="FRS GROUP DASHBOARD"/>
<font size="20" color="darkblue" > <center> <b> FRS </b> </center> </font>
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Label', 'Value'],
['Variance', value = "{!Account.Variance_by_Percentage__c}"],

]);




var options = {
width: 400, height: 120,
greenFrom: -5, greenTo: 5,
majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20]
Min: -20,
Max: 20,
};





var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);

</script>
</head>
<body>
<div id='chart_div' ></div>

<div id='visualization' style="width: 1500px; height: 700px "></div>
</body>
</html>

</apex:page>
I would like to put a gauge chart from google charts onto the account page.  I am using a field called "Variance_by_Percentage__c".  I know that I would have toe create a visualforce page.  I would like to have the min: -20, max: 20,  greenFrom: -5, greenTo: 5 and majorTicks: [-20, -15, -15, -15, 0, 5, 10, 15, 20] as my options.  Any suggestions for codes.  This is what I would like it to look
User-added image
I am trying to create a google chart image into a visualforce page and have it pull information from a field on the account page.  Here is my script.  I am using a field called "Variance_by_Percentage__c" I am trying to use an in image of
User-added image

<apex:page standardController="Account">
  <head>
  <script type='text/javascript' src='https://www.google.com/jsapi' />
  <script src="/soap/ajax/19.0/connection.js" type="text/javascript" />
 
  <script type="text/javascript">
 
 
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);
 
    function drawChart() {
        // Create a new data table with two columns: the label and the value
       var data = google.visualization.arrayToDataTable([
              ['Title', 'Value'],
              ['', 0]

          ]);
             var options = {
              width: 600,
              height: 320,
            greenFrom: -5,
             greenTo: 5,
              min: -20,
              max: 20,
              majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20],
          };
 
        // We need the sessionId to be able to query data
        sforce.connection.sessionId = '{!$Api.Session_ID}';
        // Query data using SOQL.
        var result = sforce.connection.query("SELECT Id, Variance_by_Percentage__c FROM Account");
        // Iterate over the result
        var it = new sforce.QueryResultIterator(result);
        while(it.hasNext()) {
            var record = it.next();
            // Add the data to the table
            data.addRow([record.productFamily, {v:parseFloat(record.sales), f: formatCurrencyLabel(record.sales)}]);
        }
        var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
        chart.draw(data, options);

          setInterval(function () {
              data.setValue(0, 1, 40 + Math.round(60 * Math.random()));
              chart.draw(data, options);
          }, 13000);
          setInterval(function () {
              data.setValue(1, 1, 40 + Math.round(60 * Math.random()));
              chart.draw(data, options);
          }, 5000);
          setInterval(function () {
              data.setValue(2, 1, 60 + Math.round(20 * Math.random()));
              chart.draw(data, options);
          }, 26000);

    };
 
  </script>
  </head>
  <div id="chart_div" />
</apex:page>
I am looking to see if there is a way that I could build a custom address field onto the opportunity page that has the same look and feel as a standard address field on the accounts or contact page.  I was thinking that I may need to do something like this in visualforce. 
I have this trigger, this works when Im creating a new contact under the accounts.  What I was looking for is a trigger that does what this does when a new contact is created, but also updates the contact owner when the account owner changes manually.  Any thoughts of how to change the code.

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

    List<Id> accountIds = new List<Id>();
    Map<Id, Id> accountOwnerIdMap = new Map<Id, Id>();

    // all the accounts whose owner ids to look up
    for ( Contact c : Trigger.new ) {
        accountIds.add( c.accountId );
    }
    
    // look up each account owner id
    for ( Account acct : [ SELECT id, ownerId FROM account WHERE id IN :accountIds ] ) {
        accountOwnerIdMap.put( acct.id, acct.ownerId );
    }
    
    // change contact owner to its account owner
    for ( Contact c : Trigger.new ) {
        c.ownerId = accountOwnerIdMap.get( c.accountId );
    }
   
}
I am looking for some assistance with creating a trigger to put on the account page.  I have two checkboxes, what I would like this trigger to do is change the account owner to a public group if both of the boxes are checked.  This would work Before Insert and Before Update.  Any help would be very much appreciated. 
I am tyring to build a process that will count the number of opportunities in a particular stage and based upon results will determine with picklist value on the account page will have.  Example
Opportunity Status is set to Status 1.  update Opportunity 2 to a higher status, it would change the account picklist value.  If that same opportunity were to be lost it would then lower the account field.  Then if the 1st opportunity also loses it would then change the account picklist field again.  Basisally which ever has the highest opportunity status between creating opportunity, higher statuses or lost would determine with value it is.  

Any thoughts. 
I am tyring to build a process that will count the number of opportunities in a particular stage and based upon results will determine with picklist value on the account page will have.  Example
Opportunity Status is set to Status 1.  update Opportunity 2 to a higher status, it would change the account picklist value.  If that same opportunity were to be lost it would then lower the account field.  Then if the 1st opportunity also loses it would then change the account picklist field again.  Basisally which ever has the highest opportunity status between creating opportunity, higher statuses or lost would determine with value it is.  

Any thoughts. 
I am trying to build an excel type look and feel onto a new custom object.  What I would like it to look like during an edit on the edit page is...
User-added image
but then when I click save I would like it to look like this...
User-added image
Is this possible.  If so how would I set this up.  
Is there a way to use the standard save button and have my visualforce fields change to be a read type format just like other fields on other objects.  Also I would like to know if I can format the cells just like I have on my excel sheet.  Here is what my visual force page looks like, and the excell sheet.  I would like it to like the same if possible and have the capability to save the field values and not be able to edit them untill hit edit button.
 User-added image
User-added image
I have built a simple tab structure for the opportunity page.  I am using a custom field, it is not showing the name of the field before the picklist value.  Also I was wondering is there a way to have the save button act just like the standard save button that just shows that field not the box where I can add text of pick some thing. 

<apex:page standardController="Opportunity" sidebar="false" showHeader="false">
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="OpportunityTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
      <apex:tab label="Onboarding"> 
          <apex:form >
               <center><apex:commandButton action="{!Save}" value="Save"/></center><br></br> <br></br>
                    <apex:inputField value="{!opportunity.Growth_Enhancement_Track__c}"/>
          </apex:form>
     </apex:tab>
          <apex:tab label="Analysis">
     </apex:tab>
           <apex:tab label="Follow-up">
      </apex:tab>
  </apex:tabPanel>
</apex:page>

This is what it looks like also after I hit save.

User-added image
This is what I would like it to look like after I hit save. Fields are just an example

User-added image
 
Im trying to put a gauge onto the account page.  Im using the field "variance_by_percentage__c" which I put into the ['label', 'value'].  is this the right place to put it.  I am getting the error: Unknown property 'Account.Variance-by_Percentage__c' referenced in Variance_Gauge which is the name of the page im trying to create.  I want to show the gauge for the account im in.  os that is why i am also using ?id on line #2.  Any sugguestions

<apex:page>
?id=

<apex:sectionHeader title="FRS GROUP DASHBOARD"/>
<font size="20" color="darkblue" > <center> <b> FRS </b> </center> </font>
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Label', 'Value'],
['Variance', value = "{!Account.Variance_by_Percentage__c}"],

]);




var options = {
width: 400, height: 120,
greenFrom: -5, greenTo: 5,
majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20]
Min: -20,
Max: 20,
};





var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);

</script>
</head>
<body>
<div id='chart_div' ></div>

<div id='visualization' style="width: 1500px; height: 700px "></div>
</body>
</html>

</apex:page>
I would like to put a gauge chart from google charts onto the account page.  I am using a field called "Variance_by_Percentage__c".  I know that I would have toe create a visualforce page.  I would like to have the min: -20, max: 20,  greenFrom: -5, greenTo: 5 and majorTicks: [-20, -15, -15, -15, 0, 5, 10, 15, 20] as my options.  Any suggestions for codes.  This is what I would like it to look
User-added image
I am trying to create a google chart image into a visualforce page and have it pull information from a field on the account page.  Here is my script.  I am using a field called "Variance_by_Percentage__c" I am trying to use an in image of
User-added image

<apex:page standardController="Account">
  <head>
  <script type='text/javascript' src='https://www.google.com/jsapi' />
  <script src="/soap/ajax/19.0/connection.js" type="text/javascript" />
 
  <script type="text/javascript">
 
 
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);
 
    function drawChart() {
        // Create a new data table with two columns: the label and the value
       var data = google.visualization.arrayToDataTable([
              ['Title', 'Value'],
              ['', 0]

          ]);
             var options = {
              width: 600,
              height: 320,
            greenFrom: -5,
             greenTo: 5,
              min: -20,
              max: 20,
              majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20],
          };
 
        // We need the sessionId to be able to query data
        sforce.connection.sessionId = '{!$Api.Session_ID}';
        // Query data using SOQL.
        var result = sforce.connection.query("SELECT Id, Variance_by_Percentage__c FROM Account");
        // Iterate over the result
        var it = new sforce.QueryResultIterator(result);
        while(it.hasNext()) {
            var record = it.next();
            // Add the data to the table
            data.addRow([record.productFamily, {v:parseFloat(record.sales), f: formatCurrencyLabel(record.sales)}]);
        }
        var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
        chart.draw(data, options);

          setInterval(function () {
              data.setValue(0, 1, 40 + Math.round(60 * Math.random()));
              chart.draw(data, options);
          }, 13000);
          setInterval(function () {
              data.setValue(1, 1, 40 + Math.round(60 * Math.random()));
              chart.draw(data, options);
          }, 5000);
          setInterval(function () {
              data.setValue(2, 1, 60 + Math.round(20 * Math.random()));
              chart.draw(data, options);
          }, 26000);

    };
 
  </script>
  </head>
  <div id="chart_div" />
</apex:page>
I have a scenario where I have 9 text fields that are being populated based on activity from our website. I am attempting to create a Workflow Rule that will update the corresponding date fields (ex. UTM Campaign, UTM Campaign Date) with the dates of WHEN the field was actually populated.  What I'm running into is when the WFR fires, it's populating ALL the date fields regardless of whether the field is actually populated. I know I can do this with multiple rules, but if possible I would like to accomplish this with a single WFR.  I first attempted this with a formula within the rule, but that didn't work so I moved over to criteria and that's not working either.  I'm usually fairly good with figuring out WFRs with a bit of research, but this one has me stumped.  Here's a screen shot of what I have currently:  

Google Analytics WFR

A little guidance would be greatly appreciated.  Thank you so much!

Diavonna 
I have this trigger, this works when Im creating a new contact under the accounts.  What I was looking for is a trigger that does what this does when a new contact is created, but also updates the contact owner when the account owner changes manually.  Any thoughts of how to change the code.

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

    List<Id> accountIds = new List<Id>();
    Map<Id, Id> accountOwnerIdMap = new Map<Id, Id>();

    // all the accounts whose owner ids to look up
    for ( Contact c : Trigger.new ) {
        accountIds.add( c.accountId );
    }
    
    // look up each account owner id
    for ( Account acct : [ SELECT id, ownerId FROM account WHERE id IN :accountIds ] ) {
        accountOwnerIdMap.put( acct.id, acct.ownerId );
    }
    
    // change contact owner to its account owner
    for ( Contact c : Trigger.new ) {
        c.ownerId = accountOwnerIdMap.get( c.accountId );
    }
   
}

I need to build a dashboard that shows (in traffic lights), where problems in the business lie.

 

For example, records have key data missing, so on each user record I would want to display using traffic lights whether that user is keeping their own records clean. I would then want this to roll up to each business unit, each country etc etc.

 

Can this be done using formulas, or do I need Apex because it is so complex?

 

Thanks