• Bharathimohan
  • SMARTIE
  • 622 Points
  • Member since 2012
  • Technical Architect


  • Chatter
    Feed
  • 22
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 139
    Replies
Hi Team,

I have question about running report. In my org, I'm an admin. I created a report which want to show to the subordinate. I create a seperate folder for him. But when I login as him, he can't run my report and he has run report permission. I'm wondering is that the people in the lower position can not run the report which created by user who in the upper position? 
 
Hi,
I have a picklist field on account object,using search button I am able to filter the records by selecting a picklist value.
but now i want to use the same picklist value as multi-select  picklist. 
can any one help me in resolving the issue.

Vf code:
<apex:page controller="ACCsearch">
  <apex:form id="form">  
        <span>Name</span>
        <apex:inputText value="{!searchstring}" label="Input"/>        
        <apex:selectList value="{!Typeoptions}" label="Type" size="2" multiselect="true" >
            <span>Type</span>
            <apex:selectOptions value="{!selectedType}"></apex:selectOptions>
        </apex:selectList>
            <apex:commandButton value="Searchrecords" action="{!search1}"/>
                <apex:pageBlock title="Inst Records" id="Block1">
                <apex:pageBlockSection id="section" collapsible="true" title="TABS">                
                    <apex:pageBlockTable value="{!Instlist}" var="inst" >
                        <apex:column value="{!inst.Name}"/>                                            
                        <apex:column value="{!inst.Type}"/>        
                    </apex:pageBlockTable>                    
                </apex:pageBlockSection>    
        </apex:pageBlock>           
    </apex:form>
</apex:page> 

apex code:
public class ACCsearch
{
    public list<Account> Instlist{get;set;}
    public string searchstring{get;set;}
    public string Typeoptions{get;set;}
    public ACCsearch()
    {
        string strqry ='select Name,Type  from Account';
        Instlist=Database.query(strqry); 
    }
    public list<Selectoption> GetselectedType()
    {
       List<SelectOption> options = new List<SelectOption>();           
       Schema.DescribeFieldResult fieldResult =Account.Type.getDescribe();
       List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();           
       options.add(new SelectOption('None','--None--'));
       for( Schema.PicklistEntry f : ple)
       {
          options.add(new SelectOption(f.getLabel(), f.getValue()));
       }       
           return options;
    } 
     public void search1()
    {  
        string strqry ='select id,Name, Active__c,Type from Account where id !=null ';
        if(Typeoptions!='None')
        {
           strqry =strqry +'and Type LIKE \'%'+Typeoptions+'%\'';
        }
        if(searchstring!='')
        {
           strqry =strqry +'and Name LIKE \'%'+searchstring+'%\'';
        }
        Instlist=Database.query(strqry);  
   }         
}
{!REQUIRESCRIPT("/xdomain/xdomain.js")} 
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} 
{!REQUIRESCRIPT("/support/console/33.0/integration.js")} 

var a = {!LEN( $Setup.New_Opportunity_Settings__c.RecordTypeId__c )}; 

if (a > 0) { 
window.parent.navigateToUrl('/006/e?retURL={!Contact.Id}&RecordType={!$Setup.New_Opportunity_Settings__c.RecordTypeId__c}&{!$Setup.New_Opportunity_Settings__c.ContactFieldNameId__c}={!Contact.Name}&{!$Setup.New_Opportunity_Settings__c.PrimaryContactFieldId__c}={!Contact.Id}&accid={!Account.Id}'); 
} else { 
window.parent.navigateToUrl('/setup/ui/recordtypeselect.jsp?ent=Opportunity&retURL={!Contact.Id}&save_new_url=/006/e?retURL={!Contact.Id}&{!$Setup.New_Opportunity_Settings__c.ContactFieldNameId__c}={!Contact.Name}&{!$Setup.New_Opportunity_Settings__c.PrimaryContactFieldId__c}={!Contact.Id}&accid={!Account.Id}'); 
}

This is an onclick javascript button that is on a contact page layout, allowing the user to create a new opportunity.  Seems to work most of the time but occasionally it doesn't, with the error "missing ) after arguments list".  Wondering if anyone knows why this would happen on some contacts not others.
We have over 200 layouts, and want to export a list of all Fields (with their Read Only/Required property, API name) for all Page Layouts. What is the best way to achieve this? Is it eclipse or is there better tool? thanks.
Here is my question please help me :

 <!-- <apex:commandButton action="{!onSend}" disabled="{!sendDeActive}" value="Send Text Message" /> -->
                
  <apex:commandButton rendered="{!(SMScount >= 2)}" disabled="{!sendDeActive}"  action="{onSend}" value="Send Text Message"  />
                
        
                  <apex:commandButton rendered="{(SMScount >= 3) || (!optOut) ||(desplayError = True ) }" action="{onClear}" value="Clear"  />

I have 2 buttons as you see above:
Clear 
Send Text Message

Clear and Send Text message should not be shown if the SMSCount=>3, (SmsCount is a label field which is running and incrementing +1 everytime when you send message).

I tried to write a code please help me in that peice of code that it will not show us the these two buttons if the Smscount>=3, or whenever its going to be after the 3 it will not show the these buttons, please help  me i am very new in it
Hello,

I am reposting this question in order to have a complete view on my solution

My use case.
1) Export of data
2) Export should be weekly once
3) Data should be saved somewhere for atleast 1 month

I tried to use dataloader CLI but i cant even install it. Well, I will arrive sucess at some poitn of time.

Once i install dataloader,

1) how to install scheduler
2) I also want to delete old exported files, how will i be able to acieve it.
3) Is there any other way alternative to dataloader CLI, wher i could acieve my requirement for free and not paying heavy money to external apps




 
Hi Folks,

After running test class, am able to see the percentage of the code covered, but unable to see covered code lines in developer console or any where.

Let me know if any body got this issue, and wat is the get rid of this issue.

Thank you in advance..
Hi,

I want to display Grand Total Amount of amount field in expensive object. 

Please help me to achieve this.
User-added image

**VF Page:**

<apex:page controller="ExpensesClass" >

<apex:form >
<!-- Need this variables for totals generation -->
<apex:variable value="{!0}" var="total1"/>

<apex:pageBlock >

<apex:pageBlockTable value="{!expensesList}" var="e" rendered="{!isTableExit}" >

<apex:column value="{!e.Date__c}"/>
<!--<apex:column value="{!e.Item__c}"/>-->
<apex:column >
<apex:outputLink target="_blank" value="/{!e.id}">{!e.Item__c}</apex:outputLink>
</apex:column>

<apex:column headerValue="Amount">
<apex:outputField value="{!e.Amount__c}" />
<apex:variable var="total1" value="{!e.Amount__c+total1}" />
<apex:facet name="footer">
               Total: <span class="t1"></span>   
</apex:facet>
</apex:column>
        
</apex:pageBlockTable>
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel value="Grand Total Amount:"/>
<apex:outputText value="{!totalsum1}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
<script>
    // Here we will set the generated subtotals to the footer cells
    
    document.getElementsByClassName('t1')[0].innerHTML = '{!total1}'; 
</script>
</apex:form>
</apex:page>

**Class:**
public class ExpensesClass {
public string nameQuery{get;set;}
public List<Expense__c> expensesList{get;set;}
public Boolean isTableExit {get;set;}
public Date fromdate {get; set;}
public Date todate {get; set;}
public list<AggregateResult> totalsum {get;set;}
public integer totalsum1{get;set;}

//public List<Expense__c> expensesList {get; set;}
public ExpensesClass(){
totalsize=[Select count() From Expense__c];
totalsum=new list<AggregateResult>();
//totalsum=[Select sum(Amount__c) From Expense__c];
}

public PageReference executeSearch(){
string str='%'+nameQuery+'%';
if(nameQuery==null || nameQuery==''){
    //errormessage ='Name cannot be null or empty. Please Try Again.';
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please Enter Owner Name'));
}else{
expensesList=[Select id, Item__c, owner.name,Amount__c, Date__c From Expense__c where owner.name LIKE:str Limit:limitsize Offset:offsetsize];
}

return null;
}

public Void gettotalsum1(){
AggregateResult[] groupedresult=[Select sum(Amount__c) From Expense__c];
object totalsum1=groupedresult[0].get('total');
//return totalsum;
}
}

Thanks in advance 
Sain
 
I am having some trouble with permissions when trying to open up a visualforce page that generates a PDF.  The onclick code is here:

var quoteId = "{!REVVY__MnQuote__c.REVVY__SalesforceId__c}";
var status = "{!REVVY__MnQuote__c.REVVY__Current_Status__c}";

window.open('/apex/PMnCustomTemplateCostSheet?quoteID=' + quoteId, '_blank', 'toolbar=0,location=0,menubar=0');

I would assume that the user's profile would just needs read and or create access to the Quote and its line items but still is denying access to the users with insufficient access.  Am I missing something simple here?

Thanks.
Hi when  use sortable() function of jquery on code where list comes on page load like on 
<apex:page standardController="Contact" extensions="extContactList">
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"/>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css"/>
   
     <style>
#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
#sortable li span { position: absolute; margin-left: -1.3em; }
</style>

<script>
$(function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
});
</script>

    <ul id="sortable" >
        <li class="ui-state-default"> First Name - Last Name - Id</li>
    <apex:repeat value="{!ContactList}" var="c">
        <li class="ui-state-default"> {!c.FirstName} - {!c.LastName} - {!c.Id} </li>
   
    </apex:repeat>
    </ul>
   
</apex:page>

It works perfectly but when i fetch the list after some action and rerender my list sortable() for drag and drop does not works as expected ?...please help me in this ASAP
Hi,

I have create a visualforce page with controller. I have create a button "send" when click this button that time i have call the email template. In my email template i have use " Component". But that time <c:PricelistFAELcontroller1 Serviceid="{!relatedTo.id}" ServiceSheet="{!relatedTo}"/>.
b
ut here my id, and type not populate in visualforce page into visualforce email template. How to pass id,object type into visualforce page into visualforce email component. Any one konow reply me.
I am unable to create a test class for wrapper.
Class:
global class ProductWrapper {
public Boolean isSelected {get;set;}
public PricebookEntry PBE{get;set;} 
    //creating a constructor
    public ProductWrapper(PricebookEntry PBE,Boolean isSelected)
    {
        this.PBE= PBE;
        this.isSelected= isSelected;
    }
    
}
Test class:
@istest
public class TestProductWrapper 
{
    static testMethod void productWrapper1() 
    {
        /*********************
        //insert Quote Line Item
        *********************/
        Product2 prod = new Product2(
			 Name = 'ENGEH16-2P',
			 ProductCode = 'ENGEH16-2P',
			 Item__c = 'ENGEH16-2P',
             Discount_Code__c='A',
			 isActive = true,
            Dealer_Price__c=100 
		);
		insert prod;
        system.debug('Product2 Id='+prod.id);
        /************************
         * Get standard pricebook
         * ************************/
         Id priceBookId2 = Test.getStandardPricebookId();
        /******************************
        //create price book entry
        ***************************/
        PricebookEntry PBE= new PricebookEntry();
        //PBE.Name='ENGEH16-2P';
        //PBE.Pricebook2Id=pb.Id;
        PBE.Pricebook2Id=priceBookId2;
        PBE.Product2Id=prod.id;
        PBE.UnitPrice=100;
        PBE.UseStandardPrice=false;
        PBE.isActive = true;
        Insert PBE; 
        boolean isSelected =True;
        /*******************************
         * Creating a constructor
         * *****************************/
		ProductWrapper TestPW = new ProductWrapper();
        TestPW.ProductWrapper(PBE, isSelected);
        
    }
}
I am getting an error message on second last line
ProductWrapper TestPW = new ProductWrapper();
Constructor not defined: [ProductWrapper].<Constructor>()
Any suggestions?



 


license limits

I have made all other users inactive for an activity in Trailhead thinking that would free up Salesforce licenses.  I have since switched all users for free licenses with the expection of 3:  System Administrator, Marketing Coordinator and Account Manager.  (This is for 'controlling access to fields' in Trailhead under the basic developer track.)  I keep getting that I have maxed license limits.  How do I resolve this? 
I can't seem to get a clear answer to this problem via Google search.  What is the best way to prevent trigger recursion with Data Loader in Bulk mode?  For example, consider needing to load 500,000 records and there is an After trigger updating the same records that caused the trigger to fire.  Any advice?

I'm trying to complete the trailhead challenge for Automating Process with the Lightning Process Builder and keep getting this error:
The record couldn’t be saved because it failed to trigger a flow. 
A flow trigger failed to execute the flow with version ID 30161000000CcPC.

I don't have any accounts in my setup, is that the problem?  Do I need to prepopulate the data before configuring the Process Flow?

My Process is doing this:

Object: Account -> Start the process when a record is created or edited -> Recursion is enabled

Criteria for Executing Actions: Conditions are met -> (5 conditions) [Account].billingData[city,province,country,zip,street] _ Is changed _ boolean _ false

Actions: [Account].ChildAccounts _ No Criteria _ (5 conditions) billingData[city,province,country,zip,street] _ Reference _ (5 conditions) [Account].billingData[city,province,country,zip,street]

I am trying to create a custom field to map my to with marketing automation tool to that will tell my if there is an open event on an account. So specifically an event, not an open task. Essentially I want to build a list off of this to exclude those contacts at these accounts from receiving automated emails. This is an indicator that my sales team has a scheduled conversation with them. Has anyone done this before?

 
My goal is to provide a field on the Account that lists all the products that have been sold from the various Opportunities.  I am looking for the best solution to achieve the goal.