• Mr.Mittal_2617
  • NEWBIE
  • 40 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 5
    Replies

Hi All,

I am trying to write an email template available for use using two object PRoduct and Purchase Orderline item. where product is master of purchase order lin item and email template hsould look like this 
User-added image
Please Help !!!
#Apex #Visualforce
#EmailTemplate

Hello,

I want to add a ui filter to my google chart in visualforce page.
That is made with opportunity object.

My code are:-----
controller for visualforce page:

public with sharing class OppsforCandleStick {
    public string chartData{get;set;}
    public void getOpptysData(){
       chartData = '';
        date filterdate= system.today()-90;
        string stagname;
        list<Opportunity> Opptys = [SELECT id, amount, StageName, closedate from Opportunity];
        map<date,dataWrapper> wrappermap = new map<date,dataWrapper>();
        for(opportunity opp : Opptys){
            dataWrapper w = wrappermap.get(opp.closedate);
            if(w == null){
                w = new dataWrapper();
                w.Dte = opp.closedate;
                w.open = opp.amount;
                w.close = opp.amount;
                w.high = opp.amount;
                w.low = opp.amount;
                w.stname = opp.StageName;
            }else{
                w.open =  wrappermap.containskey(opp.closedate - 1 ) ? wrappermap.get(opp.closedate - 1)?.close : 0;
                w.close = w.close == null ? opp.amount: w.close + opp.amount;
                w.high = opp.amount > w.high ? opp.amount : w.high;
                w.low = opp.amount < w.low ? opp.amount : w.low;
            }    
            wrappermap.put(opp.closedate,w);
        }
        system.debug(wrappermap);
        chartData = JSON.serialize(wrappermap.values());
        
    }
    public class dataWrapper{
        public decimal open{get;set;}
        public decimal high{get;set;}
        public decimal low{get;set;}
        public date Dte{get;set;}
        public decimal close{get;set;}
        public string stname{get;set;}
    }
}
Visualforce Page:
<apex:page controller="OppsforCandleStick" action="{!getOpptysData}">
    <html>
        <head>
            <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
            <script type="text/javascript">
                google.charts.load('current', {'packages':['corechart']});
            google.charts.setOnLoadCallback(drawChart);
            
            function drawChart() {
                var data = '{!chartData}';
                var plotData = JSON.parse(data);
                var plotting = new Array();
                plotData.forEach((data)=>{
                    plotting.push([data.Dte,data.open,data.close,data.high,data.low]);
                })
                    var chartData = google.visualization.arrayToDataTable(plotting,true);
                    console.log(chartData);
                    console.log(plotting);
                    
                      var options = {
          legend: 'none',
          bar: { groupWidth: '100%' }, // Remove space between bars.
          candlestick: {
            fallingColor: { strokeWidth: 0, fill: '#a52714' }, // red
            risingColor: { strokeWidth: 0, fill: '#0f9d58' }   // green
          }
        };
                                 
                                 var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div'));
                
                chart.draw(chartData, options);
            }
            </script>
        </head>
        <body>
            <div id="chart_div" style="width: 900px; height: 500px;"></div>
        </body>
    </html>
</apex:page>

PLEASE HELP ME WRITE UI FILTER WITH STAGENAME AS FILTER OPTIONS
Please help!!!
I need to create a visualforce page with candlestick chart with opportunity object with stagename and created date as parameters. 
PLEASE HELP !!!

Thanks in advance

Please help!!!
I need to create a visualforce page with candlestick chart with opportunity object with stagename and created date as parameters. 
PLEASE HELP !!!

Thanks in advance

Hello!!

I have this certain problem with dashboards in tableau CRM actually i have a field named month in a obejct which is picklist type value starting with October, november december and so on,  but when i using it, it is sorted alphabatically in tableau crm but i dont want it, please help me with this problem i have attached ss for reference this is the tableau displaying of months alphabaticallyand this is picklist value i want to display this way

I have written the code of my trigger helper class :

public class CustomerEmployeeHandler {
    List<Customer_Employee_Master__c> CE = new List<Customer_Employee_Master__c>();
    public void beforeInsert(List<AccountTeamMember> newatm)
    {
        for(AccountTeamMember atm: newatm)
        {
            ID getid = atm.AccountId;
            Customer_Employee_Master__c cm = new Customer_Employee_Master__c();
            cm.Account__c = getid;
            cm.Username__c = atm.UserId;
            cm.Start_Date__c = date.today();
            CE.add(cm);
        }
        Insert CE;
    }
    public void beforeDelete(List<AccountTeamMember> newatm)
    {
        
        for(AccountTeamMember atm: newatm)
        {
            ID getid = atm.UserId;
            ID acc = atm.AccountId;
            List<Customer_Employee_Master__c> cmd = [SELECT ID from Customer_Employee_Master__c where Username__c =: getid and Account__c =: acc];
            system.debug(cmd);
            for(Customer_Employee_Master__c c: cmd)
            {
                c.End_Date__c = date.today();
                CE.add(c);
            }
        }
        if(!CE.isEmpty()){
            Update CE;    
        }
        
    }
    
}


my Trigger code is :

trigger CustomerEmployeeTrigger on AccountTeamMember (before insert, after update, before delete) {
    CustomerEmployeeHandler CEH= new CustomerEmployeeHandler();
    if (Trigger.isInsert)
    {
        CEH.beforeInsert(Trigger.new);
    }
    if(Trigger.IsDelete)
    {
        CEH.beforeDelete(Trigger.old);
    }
}


Please help me with Test Class for the same 
When Account team member(contact) is deleted, the same date will be captured as End date in new custom object in End date field. While adding the team member default End date can be set and this end date will be updated when Account team member(contact) will be deleted(Business to suggest the default end date)

 
Controller to be develop to create new object record when Account team(contact) member added, also fetch the details :
a. Account Name
b. User Name(Account team member name)
c. Employee Code
d. User Role/Profile
e. Account SH Code
f.  Start Date
g. End Date
h. AOP Target
i. AOP Achievement
j. BU Name
Hi,

I have to write a trigger that when new contact is being created to populate the account domain field value in to contact domain field

Domain is a field created on account and contact field.

Please help.
I want to create aura component in developer org to add account and contacts with components
How to create Components where account and contacts can be added with components?


Please help!! I am unable to understand.
How to know which object is Master in master-detailed relationships?

Hi All,

I am trying to write an email template available for use using two object PRoduct and Purchase Orderline item. where product is master of purchase order lin item and email template hsould look like this 
User-added image
Please Help !!!
#Apex #Visualforce
#EmailTemplate

Controller to be develop to create new object record when Account team(contact) member added, also fetch the details :
a. Account Name
b. User Name(Account team member name)
c. Employee Code
d. User Role/Profile
e. Account SH Code
f.  Start Date
g. End Date
h. AOP Target
i. AOP Achievement
j. BU Name
I want to create aura component in developer org to add account and contacts with components
How to create Components where account and contacts can be added with components?


Please help!! I am unable to understand.
How to know which object is Master in master-detailed relationships?