• KNK
  • NEWBIE
  • 50 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 66
    Questions
  • 45
    Replies
Hi Team,

I want to know if we can extract the data with current date(Extract_20140307). Also I  want to  know instead of oveerride the existing file, I want to extract the data into new file every time.

Thanks,
 Naresh
  • March 09, 2014
  • Like
  • 1

Hi Team,

in the below one how to get space instead of (,)

<apex:outputText value="{0, number, ###,#00}">

 

can any one help me

  • May 17, 2013
  • Like
  • 0

Hi Team,

 

i want to write a control to retreive 3 user record which need to display in vf page . suppose these are the names say Vinay, Kumar and Ganesh. How can retrieve these users to vf page.

 

any guidance will be appreciated here.

  • May 16, 2013
  • Like
  • 0

Hi Team

 

<apex:outputPanel rendered="{!target.datalist[0].Progress < 100}">

<apex:chart data="{!target.datalist}" height="100" width="100%" renderTo="target-container-{!chartNum}" >

<apex:axis type="Category" position="left" fields="calendar" >
<apex:chartLabel />
</apex:axis>

<apex:axis type="Numeric" position="bottom" fields="actual,Intermediate,target" steps="3" grid="true" minimum="0" >
<apex:chartLabel />
</apex:axis>
<apex:barSeries orientation="horizontal" axis="left" highlight="false"
xField="target" yField="measure" colorSet="#DDDDEE">
<apex:chartTips height="40" width="120" labelField="intermediateLabel" />
</apex:barSeries>
***************************************************

<apex:barSeries orientation="horizontal" axis="left" highlight="false"
xField="Intermediate" yField="measure">
<apex:chartTips height="40" width="120" labelField="targetLabel" />
</apex:barSeries>

**************************************************
<apex:barSeries orientation="horizontal" axis="left" highlight="false" colorSet="{!IF(target.datalist[0].Progress < 50,'#E51400','#F09609')}"
xField="actual" yField="measure" >
<apex:chartTips height="40" width="120" labelField="actualLabel" />
</apex:barSeries>

</apex:chart>

<div id="target-container-{!chartNum}"></div>
<p id="performance-percentage-area" class="performance-percentage">{!target.datalist[0].Progress} % completed</p>
</apex:outputPanel>

 

 

I want the highlited one as a line.  just one line at the point value.

 

can any one help me here....

 

  

 

  • May 16, 2013
  • Like
  • 0

How to create a link in the report(vf Page)  that will navigate to the detail page of that record..

 

I have a filed called target in ABC Object.

 

this target value is populated in barseries chart with Vf pages .

 

Once I click on that target it should go to the target value of the ABC Object.

 

can any one help me here.

  • May 14, 2013
  • Like
  • 0

Hi Team,

 

I want to show  a line  at that particular value in Bar chart .

 

                                <apex:barSeries orientation="horizontal" axis="left" highlight="false"                                                
                                xField="Intermediate" yField="measure" >
                                    <apex:chartTips height="40" width="120" labelField="targetLabel" />

 

 

suppose with the above code whenever ever i have given 800 to the intermediate. The line is to get at the value of 800.

 

 

please help me here

  • May 14, 2013
  • Like
  • 0

Hi Team,

 

Could you please help me with below warpper class.

 

public List<Measure__c> ActualList {get; set;} 

     public List<Measure__c> getActuals() {

        String accountId = ApexPages.currentPage().getParameters().get('id');

 List<string> ExistingProds  = new List<string>
 try{
 LIst<CustomForecast__c> MPExisting = [SELECT Product__c FROM CustomForecast__c Where Account__c = :accountId]
 for (CustomForecast__c mp : MPExisting {
                    Existingprods.add(mp.Product__c);
                }
   }


    
        List<Measure__c> ActualInvoice = [select Id, Name,Cross_Reference__c,Calendar__c,Value__c From Measure__c
        Where Cross_Reference__r.Customer_Company__c = :accountId AND Product__c = ExistingProds];
        return ActualInvoice;
       
    }

I want put the actual Inovoice Values with product into Map.

 

How can i do this. can any one help me here.

Like this I dont no whether this correct format or not   Map<String,List<Measure__c>> MeaMap = new Map Map<String,List<Measure__c>>();

  • May 02, 2013
  • Like
  • 0

Hi team,

 

I am new to Sales Force Apex. Can any one help me with wrapper class.

 

i have Vf page in Account Tab.I want to retrieve Existing values to this Vf Page from Object Called DSP.

 

These are the fields in DSP

 

product__c

crossreferrence__c

calendar__c

 

cross reference gives reference to Account

Product__c gives referce to product Object

 

Now I want to retrieve the records of prodcts which are assoicated to that account.

 

Could you please provide me any refernce for the same.

  • April 25, 2013
  • Like
  • 0

Hi Team,

 

I am trying to create a formula filed based on another picklist field value, but it is not populating the value in formula filed.

 

Please find below for the formula and help me here..

 

IF( ISPICKVAL(Product_Mix_GP__c,'<50.00') ,2,
(IF( ISPICKVAL(Product_Mix_GP__c,'50.00-100.00') ,6,
(IF( ISPICKVAL(Product_Mix_GP__c,'100.00-150.00') ,9,
(IF( ISPICKVAL(SYN_Turnover_seeds_CP__c,'150.00-200.00') ,12,
(IF( ISPICKVAL(SYN_Turnover_seeds_CP__c,'>200.00') ,15,0)))))))))

  • March 19, 2013
  • Like
  • 0

Hi Team, I am this error

 

 Compile Error: sObject type 'Communication_Option_New__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. at line for below code. Please help me here.

 

if (!communicationOption.isEmpty()) {
            for (Contact c : [SELECT Name, Phone, AccountId, Account.Name FROM Contact WHERE Id NOT IN :existingIds AND Id IN :contactIds AND Id IN (SELECT Contact__c FROM Communication_Option_New__c WHERE Communication_Mode__c IN :communicationOption AND Communication_Option__c='Opt In')]) {
                contactList.add(new ContactWrapper(c));
            }
        }
        else {
            for (Contact c : [SELECT Name, Phone, AccountId, Account.Name FROM Contact WHERE Id NOT IN :existingIds AND Id IN :contactIds]) {
                contactList.add(new ContactWrapper(c));
            }

  • March 14, 2013
  • Like
  • 0

Hi Team,

 

Can we create any formula field to donot delete the the campaign if status is completed.

  • March 08, 2013
  • Like
  • 0

Hi Team,

 

Could you please me with below one.

while creating new camaping status should not be completed or aborted.

  • March 07, 2013
  • Like
  • 0

Hi Team,

 

I am new to Salesforce. I have a field Commercial Unit in Territory and in Campaign.

 

I want to display in territories listed in “Territories” page should be belonging the Commercial Units in that campaign

 

public with sharing class AddCampaignTerritories {

    public List<TerritoryWrapper> territories{get; set;}
    //public List<String> fieldsToDisplay{get; set;}
    Campaign c;
    
    //variables for page size and offset
    public Integer pageSize{get; set;}
    public Integer offset{get; set;}
    
    //variables for checking if there is next page/previous page or not
    public Boolean hasPrev{get; set;}
    public Boolean hasNext{get; set;}

    public AddCampaignTerritories(ApexPages.StandardController controller) {
        //Get the campaign record passed
        c = (Campaign) controller.getRecord();
        //initialize territories list
        territories = new List<TerritoryWrapper>();
        
        //initialize pagesize and offset
        pageSize = 25;
        offset = 0;
        
        //default hasPrev and hasNext to false
        hasPrev = false;
        hasNext = false;
        
        //If campaign id is not null, get the list of territories that can be added to the campaign
        if (c.Id != null) {
            refreshList();
        }
        else {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.ERROR, 'Please open this page from Campaign detail page'));
        }
        
    }
    
    public void refreshList() {
        try {
            territories.clear();
            List<Territory__c> terrList = new List<Territory__c>();
            
            //Get the ids of territories that are already added to the campaign to exclude them from the list displayed
            List<String> existingIds = new List<String>();
            try {
                List<Campaign_Territory__c> ctExisting = [SELECT Territory__c FROM Campaign_Territory__c WHERE Campaign__c=:c.Id];
                for (Campaign_Territory__c ct : ctExisting) {
                    existingIds.add(ct.Territory__c);
                }
            }
            catch(System.QueryException e){ApexPages.addMessages(e);}
            
            //Get the list of available territories that can be added
            terrList = [SELECT Name, CU_Manager__c, Area_Sales_Manager__c, Territory_Sales_Manager__c FROM Territory__c WHERE Id NOT IN :existingIds LIMIT :(pageSize+1) OFFSET :offset];
            
            if (terrList.size() > pageSize) { hasNext = true; terrList.remove(pageSize); }
            else hasNext = false;
            if (offset == 0) hasPrev = false;
            else hasPrev = true;
            
            for (Territory__c t : terrList){
                territories.add(new TerritoryWrapper(t));
            }
        }
        catch(System.QueryException e) {
            ApexPages.addMessages(e);
        }
    }
    
    public void previous() {
        if (hasPrev) { offset -= pageSize; refreshList(); }
    }
    
    public void next() {
        if (hasNext) { offset += pageSize; refreshList(); }
    }
    
    public PageReference save() {
        List<Campaign_Territory__c> ctList = new List<Campaign_Territory__c>();
        
        for (TerritoryWrapper tw : territories) {
            if (tw.isSelected) {
                ctList.add(new Campaign_Territory__c(Campaign__c = c.Id, Territory__c = tw.t.Id));
            }
        }
        try {
            if (!ctList.isEmpty()) {
                insert ctList;
            }
            ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO, 'Territories have been successfully added'));
            return new ApexPages.StandardController(c).view();
        }
        catch(System.DMLException e) {
            ApexPages.addMessages(e);
        }    
        return null;
    }

    class TerritoryWrapper {
        public Territory__c t {get; set;}
        public Boolean isSelected{get; set;}
        
        public TerritoryWrapper(Territory__c t) {
            this.t = t;
            isSelected = false;
        }
    }
}

  • March 07, 2013
  • Like
  • 0

Hi Team,

 

I am new to Salesforce. I have a field Commercial Unit in Territory and in Campaign.

 

I want to display in territories listed in “Territories” page should be belonging the Commercial Units in that campaign

 

public with sharing class AddCampaignTerritories {

    public List<TerritoryWrapper> territories{get; set;}
    //public List<String> fieldsToDisplay{get; set;}
    Campaign c;
    
    //variables for page size and offset
    public Integer pageSize{get; set;}
    public Integer offset{get; set;}
    
    //variables for checking if there is next page/previous page or not
    public Boolean hasPrev{get; set;}
    public Boolean hasNext{get; set;}

    public AddCampaignTerritories(ApexPages.StandardController controller) {
        //Get the campaign record passed
        c = (Campaign) controller.getRecord();
        //initialize territories list
        territories = new List<TerritoryWrapper>();
        
        //initialize pagesize and offset
        pageSize = 25;
        offset = 0;
        
        //default hasPrev and hasNext to false
        hasPrev = false;
        hasNext = false;
        
        //If campaign id is not null, get the list of territories that can be added to the campaign
        if (c.Id != null) {
            refreshList();
        }
        else {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.ERROR, 'Please open this page from Campaign detail page'));
        }
        
    }
    
    public void refreshList() {
        try {
            territories.clear();
            List<Territory__c> terrList = new List<Territory__c>();
            
            //Get the ids of territories that are already added to the campaign to exclude them from the list displayed
            List<String> existingIds = new List<String>();
            try {
                List<Campaign_Territory__c> ctExisting = [SELECT Territory__c FROM Campaign_Territory__c WHERE Campaign__c=:c.Id];
                for (Campaign_Territory__c ct : ctExisting) {
                    existingIds.add(ct.Territory__c);
                }
            }
            catch(System.QueryException e){ApexPages.addMessages(e);}
            
            //Get the list of available territories that can be added
            terrList = [SELECT Name, CU_Manager__c, Area_Sales_Manager__c, Territory_Sales_Manager__c FROM Territory__c WHERE Id NOT IN :existingIds LIMIT :(pageSize+1) OFFSET :offset];
            
            if (terrList.size() > pageSize) { hasNext = true; terrList.remove(pageSize); }
            else hasNext = false;
            if (offset == 0) hasPrev = false;
            else hasPrev = true;
            
            for (Territory__c t : terrList){
                territories.add(new TerritoryWrapper(t));
            }
        }
        catch(System.QueryException e) {
            ApexPages.addMessages(e);
        }
    }
    
    public void previous() {
        if (hasPrev) { offset -= pageSize; refreshList(); }
    }
    
    public void next() {
        if (hasNext) { offset += pageSize; refreshList(); }
    }
    
    public PageReference save() {
        List<Campaign_Territory__c> ctList = new List<Campaign_Territory__c>();
        
        for (TerritoryWrapper tw : territories) {
            if (tw.isSelected) {
                ctList.add(new Campaign_Territory__c(Campaign__c = c.Id, Territory__c = tw.t.Id));
            }
        }
        try {
            if (!ctList.isEmpty()) {
                insert ctList;
            }
            ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO, 'Territories have been successfully added'));
            return new ApexPages.StandardController(c).view();
        }
        catch(System.DMLException e) {
            ApexPages.addMessages(e);
        }    
        return null;
    }

    class TerritoryWrapper {
        public Territory__c t {get; set;}
        public Boolean isSelected{get; set;}
        
        public TerritoryWrapper(Territory__c t) {
            this.t = t;
            isSelected = false;
        }
    }
}

  • March 06, 2013
  • Like
  • 0

Hi Team,

 

Could you please any one help me with below code.

 

I am getting attempt derernce a null object  at this part

 

public PageReference addProducts() {
        List<Case_Product__c> cpsToBeInserted = new List<Case_Product__c>();
        
        for (LabelWrapper clw : labels) {
            if (clw.isSelected) {
                system.debug('Naresh');
                cpsToBeInserted.add(new Case_Product__c(Case__c = caseId, Product_Shipper__c = clw.cl.Id));
            }
        }
   

 

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

 


public with sharing class AddCaseProducts {

    public List<LabelWrapper> labels{get; set;}
    public List<SelectOption> productFamilies{get; set;}
    public String productFamily{get; set;}
    Id caseId;
    
    public AddCaseProducts(ApexPages.StandardController controller) {
        caseId = ApexPages.currentPage().getParameters().get('caseId');
        productFamilies= new List<SelectOption>();
        productFamily= '';
        
        for (PicklistEntry pe : Schema.SObjectType.Product_Shipper__c.Fields.Family__c.getpicklistValues()) {
            productFamilies.add(new SelectOption(pe.getValue(), pe.getLabel()));
        }
    }
    
    public void initialize() {
        if (caseId != null) {
            labels = new List<LabelWrapper>();
            //String campaignType = [select RecordType.Name from Campaign where Id=:campaignId].RecordType.Name;
            List<Id> existingCPs = new List<Id>();
            
            for (Case_Product__c cp : [SELECT Product_Shipper__c FROM Case_Product__c WHERE Case__c = :caseId])
                existingCPs.add(cp.Product_Shipper__c);
            String query = 'SELECT Id, Name, Family__c,AGI_Code__c,Pack_Size__c,Price__c FROM Product_Shipper__c WHERE Id NOT IN :existingCPs';
            if (productFamily!= null && productFamily!= '') {
                query += ' AND Family__c INCLUDES (:productFamily)';
                
                system.debug('Naresh');
            }
            List<Product_Shipper__c> prodList = Database.query(query);
            for (Product_Shipper__c l : prodList)
                labels.add(new LabelWrapper(l));
            if (labels.isEmpty()) {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO, 'There are no products to display'));
            }
        }
        else {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.FATAL, 'Please open this page from Case detail page'));
        }
    }
    
    public PageReference addProducts() {
        List<Case_Product__c> cpsToBeInserted = new List<Case_Product__c>();
        
        for (LabelWrapper clw : labels) {
            if (clw.isSelected) {
                system.debug('Naresh');
                cpsToBeInserted.add(new Case_Product__c(Case__c = caseId, Product_Shipper__c = clw.cl.Id));
            }
        }
        
        if (!cpsToBeInserted.isEmpty()) {
            try {
                insert cpsToBeInserted;
                
                return new ApexPages.StandardController(new Case(Id = caseId)).view();
            }
            catch(System.DMLException e) {
                ApexPages.addMessages(e);
            }
        }
        else {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.FATAL, 'Please select atleast a product to insert or click cancel to go back'));
        }
        return null;
    }
    
    public PageReference cancel() {
        if (caseId != null) {
            return new ApexPages.StandardController(new Case(Id = caseId)).view();
        }
        return new PageReference('/home/home.jsp');
    }
    
    class LabelWrapper {
        public boolean isSelected{get; set;}
        public Product_Shipper__c cl {get; set;}
        
        public LabelWrapper(Product_Shipper__c cl) {
            this.cl = cl;
        }
    }

}

  • March 03, 2013
  • Like
  • 0

Hi Team,

 

I have a requirement if Lawn and Garden field is true then the below select option needs to display.

 

 

Please help me, it is throwing variable doesnt exist.

 

private transient List<SelectOption> cacheProductFamilies = null;
    global List<SelectOption> productFamilies
    { 
        get {
            if (cacheProductFamilies==null){
                cacheProductFamilies = newSelectList(false);
                cacheProductFamilies.add(new SelectOption('CP','CP'));
                cacheProductFamilies.add(new SelectOption('Seeds','Seeds'));

  if (Account__r.Lawn_and_Garden_Agent__c==true){
                cacheProductFamilies.add(new SelectOption('Lawn and Garden','Lawn and Garden'));

}
            }
            return cacheProductFamilies;           
        }
    }
   
    global boolean readyForSearch {
        get {
            return selectedProductFamily!=null;
        }
    }

 

 

 

 

  • February 11, 2013
  • Like
  • 0

Hi Team,

 

private transient List<SelectOption> cacheProductFamilies = null;
    global List<SelectOption> productFamilies
    { 
        get {
            if (cacheProductFamilies==null){
                cacheProductFamilies = newSelectList(false);
                cacheProductFamilies.add(new SelectOption('CP','CP'));
                cacheProductFamilies.add(new SelectOption('Seeds','Seeds'));
                cacheProductFamilies.add(new SelectOption('Lawn and Garden','Lawn and Garden', getdisabled if(Account__r.Lawn_and_Garden_Agent__c="true")));
            }
            return cacheProductFamilies;           
        }
    }
   
    global boolean readyForSearch {
        get {
            return selectedProductFamily!=null;
        }
    }

 

I want to enable the Lawn and Garden option value, if a filed check box is set to true.

 

Could you please help me on this.

  • February 08, 2013
  • Like
  • 0

Hi Team,    

 

I have below code in Custom button    

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}

{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}

var recordTypeName = '{!Account.RecordType}';

var BPRecordId = '';

var theDate = new Date();

var currentYear = theDate.getFullYear(); 

if(recordTypeName == 'Channel'){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Distributor' limit 1");

BPRecordId = result.getArray("records")[0].Id;

}

else if(recordTypeName == 'Grower' ){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Grower' limit 1");

BPRecordId = result.getArray("records")[0].Id;

}

else if(recordTypeName == 'Lawn and Garden'){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Lawn and Garden' limit 1");

BPRecordId = result.getArray("records")[0].Id;

}

else if(recordTypeName == 'Influencer'){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Influencer' limit 1"); BPRecordId = result.getArray("records")[0].Id;

}

else{

alert('Invalid Operation. Please contact System Admin for details!!');

}

var BPDescription = sforce.connection.describeSObject("Business_Plan__c");

var BPUrlForNew = BPDescription.urlNew.split('com')[1];

var CFID = 'CF'+'00N90000004WQVZ'; // this ID is differnect with the production,please chage it after deployment

var AccountName = '{!Account.Name}';

var aid='{!Account.Id}';

result = sforce.connection.query("Select Id, Name  From Business_Plan__c where Name = \'" + currentYear + "\'  and Account__c = \'{!Account.Id}\' limit 1" ); records = result.getArray("records"); if(records.length > 0){ var prevId = records[0].Id; window.top.location=prevId; } else{  window.top.location=BPUrlForNew+'?'+CFID+'='+AccountName+'&'+CFID+'_lkid='

 

This is not working for lawn and Garden RecordType.

 It is showing following error : result.getArray(...)[0] is undefined. Kindly please help me.

  • February 07, 2013
  • Like
  • 0

Hi Team,

 

I have below code in Custom button

 

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
var recordTypeName = '{!Account.RecordType}';
var BPRecordId = '';
var theDate = new Date();
var currentYear = theDate.getFullYear();

if(recordTypeName == 'Channel'){
var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Distributor' limit 1");
BPRecordId = result.getArray("records")[0].Id;
}else if(recordTypeName == 'Grower' ){
var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Grower' limit 1");
BPRecordId = result.getArray("records")[0].Id;
}
else if(recordTypeName == 'Lawn and Garden'){
var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Lawn and Garden' limit 1");
BPRecordId = result.getArray("records")[0].Id;
}
else if(recordTypeName == 'Influencer'){
var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Influencer' limit 1");
BPRecordId = result.getArray("records")[0].Id;
}
else{
alert('Invalid Operation. Please contact System Admin for details!!');
}
var BPDescription = sforce.connection.describeSObject("Business_Plan__c");
var BPUrlForNew = BPDescription.urlNew.split('com')[1];
var CFID = 'CF'+'00N90000004WQVZ'; // this ID is differnect with the production,please chage it after deployment
var AccountName = '{!Account.Name}';
var aid='{!Account.Id}';
result = sforce.connection.query("Select Id, Name  From Business_Plan__c where Name = \'" + currentYear + "\'  and Account__c = \'{!Account.Id}\' limit 1" );
records = result.getArray("records");
if(records.length > 0){
var prevId = records[0].Id;
window.top.location=prevId;
}
else{
 window.top.location=BPUrlForNew+'?'+CFID+'='+AccountName+'&'+CFID+'_lkid='+aid+'&RecordType='+BPRecordId+'&Name='+currentYear;
}

 

 

This is working for All Recrod types Except Lawn and Garden, When I click on the button it is shwoing following error : "A problem with the OnClick JavaScript for this button or link was encountered:  result.getArray(...)[0] is undefined".

 

 

Kindly please advice me where i was wrong..

  • February 06, 2013
  • Like
  • 0

Hi Team,

 

I have two fields in One Object Product_Mix__c(Number) and Product_MIx_Score(Formula(number)).

 

I am writing formula in Product_Mix_Score__c

 

CASE(TEXT(Product_Mix__c),
'<50.00', 2,
'50.00-100.00', 6,
'100.00-150.00', 9,
'150.00-200.00', 12,
'>200.00', 15,0)

 

but when i am entering 60 value in Product_Mix__c, the valye  6 is not getting populate in Product_Mix_Score__c

 

Can any one help me here.

  • January 28, 2013
  • Like
  • 0
Hi Team,

I want to know if we can extract the data with current date(Extract_20140307). Also I  want to  know instead of oveerride the existing file, I want to extract the data into new file every time.

Thanks,
 Naresh
  • March 09, 2014
  • Like
  • 1

Hi Team

 

<apex:outputPanel rendered="{!target.datalist[0].Progress < 100}">

<apex:chart data="{!target.datalist}" height="100" width="100%" renderTo="target-container-{!chartNum}" >

<apex:axis type="Category" position="left" fields="calendar" >
<apex:chartLabel />
</apex:axis>

<apex:axis type="Numeric" position="bottom" fields="actual,Intermediate,target" steps="3" grid="true" minimum="0" >
<apex:chartLabel />
</apex:axis>
<apex:barSeries orientation="horizontal" axis="left" highlight="false"
xField="target" yField="measure" colorSet="#DDDDEE">
<apex:chartTips height="40" width="120" labelField="intermediateLabel" />
</apex:barSeries>
***************************************************

<apex:barSeries orientation="horizontal" axis="left" highlight="false"
xField="Intermediate" yField="measure">
<apex:chartTips height="40" width="120" labelField="targetLabel" />
</apex:barSeries>

**************************************************
<apex:barSeries orientation="horizontal" axis="left" highlight="false" colorSet="{!IF(target.datalist[0].Progress < 50,'#E51400','#F09609')}"
xField="actual" yField="measure" >
<apex:chartTips height="40" width="120" labelField="actualLabel" />
</apex:barSeries>

</apex:chart>

<div id="target-container-{!chartNum}"></div>
<p id="performance-percentage-area" class="performance-percentage">{!target.datalist[0].Progress} % completed</p>
</apex:outputPanel>

 

 

I want the highlited one as a line.  just one line at the point value.

 

can any one help me here....

 

  

 

  • May 16, 2013
  • Like
  • 0

Hi Team,

 

I am trying to create a formula filed based on another picklist field value, but it is not populating the value in formula filed.

 

Please find below for the formula and help me here..

 

IF( ISPICKVAL(Product_Mix_GP__c,'<50.00') ,2,
(IF( ISPICKVAL(Product_Mix_GP__c,'50.00-100.00') ,6,
(IF( ISPICKVAL(Product_Mix_GP__c,'100.00-150.00') ,9,
(IF( ISPICKVAL(SYN_Turnover_seeds_CP__c,'150.00-200.00') ,12,
(IF( ISPICKVAL(SYN_Turnover_seeds_CP__c,'>200.00') ,15,0)))))))))

  • March 19, 2013
  • Like
  • 0

Hi Team,

 

I have a requirement if Lawn and Garden field is true then the below select option needs to display.

 

 

Please help me, it is throwing variable doesnt exist.

 

private transient List<SelectOption> cacheProductFamilies = null;
    global List<SelectOption> productFamilies
    { 
        get {
            if (cacheProductFamilies==null){
                cacheProductFamilies = newSelectList(false);
                cacheProductFamilies.add(new SelectOption('CP','CP'));
                cacheProductFamilies.add(new SelectOption('Seeds','Seeds'));

  if (Account__r.Lawn_and_Garden_Agent__c==true){
                cacheProductFamilies.add(new SelectOption('Lawn and Garden','Lawn and Garden'));

}
            }
            return cacheProductFamilies;           
        }
    }
   
    global boolean readyForSearch {
        get {
            return selectedProductFamily!=null;
        }
    }

 

 

 

 

  • February 11, 2013
  • Like
  • 0

Hi Team,

 

private transient List<SelectOption> cacheProductFamilies = null;
    global List<SelectOption> productFamilies
    { 
        get {
            if (cacheProductFamilies==null){
                cacheProductFamilies = newSelectList(false);
                cacheProductFamilies.add(new SelectOption('CP','CP'));
                cacheProductFamilies.add(new SelectOption('Seeds','Seeds'));
                cacheProductFamilies.add(new SelectOption('Lawn and Garden','Lawn and Garden', getdisabled if(Account__r.Lawn_and_Garden_Agent__c="true")));
            }
            return cacheProductFamilies;           
        }
    }
   
    global boolean readyForSearch {
        get {
            return selectedProductFamily!=null;
        }
    }

 

I want to enable the Lawn and Garden option value, if a filed check box is set to true.

 

Could you please help me on this.

  • February 08, 2013
  • Like
  • 0

Hi Team,    

 

I have below code in Custom button    

{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}

{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}

var recordTypeName = '{!Account.RecordType}';

var BPRecordId = '';

var theDate = new Date();

var currentYear = theDate.getFullYear(); 

if(recordTypeName == 'Channel'){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Distributor' limit 1");

BPRecordId = result.getArray("records")[0].Id;

}

else if(recordTypeName == 'Grower' ){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Grower' limit 1");

BPRecordId = result.getArray("records")[0].Id;

}

else if(recordTypeName == 'Lawn and Garden'){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Lawn and Garden' limit 1");

BPRecordId = result.getArray("records")[0].Id;

}

else if(recordTypeName == 'Influencer'){

var result = sforce.connection.query("Select r.Id From RecordType r where r.SobjectType = 'Business_Plan__c' and r.DeveloperName = 'Influencer' limit 1"); BPRecordId = result.getArray("records")[0].Id;

}

else{

alert('Invalid Operation. Please contact System Admin for details!!');

}

var BPDescription = sforce.connection.describeSObject("Business_Plan__c");

var BPUrlForNew = BPDescription.urlNew.split('com')[1];

var CFID = 'CF'+'00N90000004WQVZ'; // this ID is differnect with the production,please chage it after deployment

var AccountName = '{!Account.Name}';

var aid='{!Account.Id}';

result = sforce.connection.query("Select Id, Name  From Business_Plan__c where Name = \'" + currentYear + "\'  and Account__c = \'{!Account.Id}\' limit 1" ); records = result.getArray("records"); if(records.length > 0){ var prevId = records[0].Id; window.top.location=prevId; } else{  window.top.location=BPUrlForNew+'?'+CFID+'='+AccountName+'&'+CFID+'_lkid='

 

This is not working for lawn and Garden RecordType.

 It is showing following error : result.getArray(...)[0] is undefined. Kindly please help me.

  • February 07, 2013
  • Like
  • 0

Hi Team,

 

 I am going update twi fields in Crop Record(Average CP and Average Seeds) which is from ABS (Average CP and Average Seeds).

 

In Crop Record ABS is Lookup field.

 

This is i have done so far but it is not working..

 

 

public with sharing class ABS_TriggerHandler {

    private boolean m_isExecuting = false;
    private integer BatchSize = 0;
 
    public ABS_TriggerHandler(boolean isExecuting, integer size){
        m_isExecuting = isExecuting;
        BatchSize = size;
    }
    
    public void OnBeforeInsert(list<ABS__c> newObjects)
      {
         Updatepotential (newObjects);
      }
    
    public void OnAfterInsert(list<ABS__c> newObjects)
      {
         Updatepotential (newObjects);
      }
private void Updatepotential (list <ABS__c> newCPs){
        Set<String> years = new Set<String>();
        set<Id> territories = new set<Id>();
        set<Id> crops = new set<Id>();
        map<String, set<Id>> absCropsToUpdateMap = new map<String, set<Id>>();


         for(ABS__c abs : newCPs)
            {
                        years.add(abs.Name);
                        territories.add(abs.Territory_Name__c);
                        crops.add(abs.Crop__c);
                        String key = abs.Name + abs.Territory_Name__c;
                        
                        if(!absCropsToUpdateMap .containsKey(key))
                        absCropsToUpdateMap .put(key, new set<Id>{abs.Crop__c});
                        else
                        absCropsToUpdateMap .get(key).add(abs.Crop__c);                        
            }

         if(absCropsToUpdateMap.size() > 0)
          {
            list<ABS__c> CPCropsToBeInserted = new list<ABS__c>();
            List<Crop_Record__c> cropRecords = new List<Crop_Record__c>();
             for (ABS__c cpp : [ Select Id, Name, Average_CP__c, Average_Seeds__c,
                                 Crop__r.Name, Crop__c, (SELECT Average_CP__c,Average_Seeds__c,Crop__c FROM Crop_Records__r) From ABS__c Where  Name = :years
                                 and Crop__r.Name = :crops])
               
                             
                                 for (Crop_Record__c cr : cpp.Crop_Records__r) {
                                     if (cpp.Crop__c == cr.Crop__c) {
                                         cr.Average_CP__c = cpp.Average_CP__c;
                                         cr.Average_Seeds__c = cpp.Average_Seeds__c;
                                         cropRecords.add(cr);
                                     }
                                 }
                                
                             
               if (!cropRecords.isEmpty()){
                   update cropRecords;
               }
           }  
       }
 
    
}

  • January 23, 2013
  • Like
  • 0

Hi Team,

 

I have a Object called A, In Object A  two Rollup Summary Fields are there Actual Total and Total.

 

Now have i created on formula filed Total Amount in Object.

 

I am trying to create a formula filed in Account to populate the Total Amount Value(Object__r.Total_Amount__c) , but it is not reflecting.

 

Account and Object has a Lookup Relation.

 

can any one help me here.

 

 

 

  • January 16, 2013
  • Like
  • 0

Hi Team,

 

I am creating below formula filed in Account. Account and Object1 has a lookup relationship, but even though actual values are there in object1 it is showing null value in account

 

 

IF ( ISPICKVAL( object1__r.Type__c , "Actual") ,  Object1__r.Total_Volume__c , null)
/IF( ISPICKVAL( object1__r.Type__c , "Actual") ,  Object1__r.Total_Volume__c , null)
+IF( ISPICKVAL( Object1__r.Type__c , " ") ,  object1.Total_Volume__c , null) *100

 

please help me here ..

  • January 15, 2013
  • Like
  • 0

Hi Team,

 

I have a Total Volume field in A object, through visual force page i am using this in B object(I dont have total volume field in B object).

 

Now i want create a formula field for Total volume (A+B).

 

Can any one help me here.

 

Thanks in advnace.

  • January 15, 2013
  • Like
  • 0
Hi Team,
I want to enable this button for only current year and next year, how can i acheive this.

<apex:commandButton disabled="{!Year < 2012 }" action="{!addProduct}" value="Add Product" />
  • December 05, 2012
  • Like
  • 0

Hi In Below VF page i am not getting background colour,

 

Could you please help me here..

 

<apex:page standardController="Business_Plan__c" extensions="Business_Plan" sidebar="true">
  <head><meta http-equiv="X-UA-Compatible" content="IE=edge" /></head>

   <apex:stylesheet value="{!URLFOR($Resource.DSP, 'css/vf-tab.css')}" />
   <apex:stylesheet value="{!URLFOR($Resource.DSP, 'css/dsp-tab-data.css')}" />
  
   <div class="bPageBlock brndScnBrd secondaryPalette">
   <div class="pbBody">
          <table class="list" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody>
            <tr class="headerRow" >
            <th scope="col" class="zen-deemphasize">Contact Name</th>
           
            <th scope="col" class="zen-deemphasize">Job Title</th>
            
            <th scope="col" class="zen-deemphasize">Email</th>
            <th scope="col" class="zen-deemphasize">Phone</th>
            </tr>
            <apex:repeat value="{!contactList}" var="ContactRL" id="foreaContact">
            <tr class="dataRow with-data" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
            <td class="ContactRL odd"><div><a href="/{!ContactRL.Id}" target="_top">{!ContactRL.Name}</a></div></td>
           
            <td class="Job Title even">{!ContactRL.Job_title__c}</td>
            <td class="ContactRL d odd">{!ContactRL.email}</td>
            <td class="ContactRL even">{!ContactRL.phone}</td>
            </tr>
            </apex:repeat>
            </tbody>
          </table>
    </div>
    </div>
    </apex:page>

 

 

 
  • November 29, 2012
  • Like
  • 0

Hi Team,

 

I am using below trigger to update price filed from Product Shipper to DsP Product. It is working fine for new records but if change the price in product shipper then the value is updating but total amount is not getting exactly. this price field is using in workflow to calcuate the total amount.

 

trigger UpdatePrice on DSP_Product__c (before insert, before update) {
        
        set<String> years = new set<String>();
        set<Id> accounts = new set<Id>();
        map<String, Id> prevYearKeyDspMap = new map<String, Id>();
for(DSP_Product__c dspr : trigger.new){
            accounts.add(dspr.Account__c);
            years.add(dspr.Name);
                    }

Map<ID, Product_Shipper__c> psMap =
        new Map<ID, Product_Shipper__c>(
            [SELECT Price__c, Pack_Size__c
            FROM Product_Shipper__c
            WHERE Active__c = true]);
for ( DSP_Product__c dspp : trigger.new ) {
        if (prevYearKeyDspMap.size()>0){
            Product_Shipper__c ps = psMap.get(dspp.Product_Shipper__c);
            if ( ps != null ) {
                dspp.Product_Price__c = ps.Price__c;
                dspp.Product_Size__c = ps.Pack_Size__c;
            }
        }
    }
}

  • November 27, 2012
  • Like
  • 0

Hi Team,

 

I Have a field called price in three objects A,B and C.

 

Now i want to get the price values of object A and B into C.

 

Could you please tell me how to create a trigger for it.

 

  • November 27, 2012
  • Like
  • 0