• Subramani_SFDC
  • SMARTIE
  • 609 Points
  • Member since 2013
  • Technology Analyst
  • Infosys


  • Chatter
    Feed
  • 19
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 8
    Questions
  • 247
    Replies
Hi,

I have a user with Consulting-Sr.manager as profile. I have given all the access permission that a User should need and able to run and schedule reports. Still I am getting warning message as below;
However I tried giving access to "Manage Public Reports" permission , then the issue is resolved . But problem is the User got the rights to modify other public reports as well which I dont need. He should be able to have access only to his reports. Please suggest

User-added image
Hello,

I have a connection to external webservices, how can i track the erros and the execution order of this 
?
  • November 06, 2016
  • Like
  • 0
Hi all,
write a test class for extension Controller. 

public with sharing class OpportunityTermSheetCtlr {

public List<Custom_Asset__c> listActiveAssets {get;set;}
public List<OpportunityLineItem> listOpportunityLineItem {get;set;}
public Opportunity o;
public OpportunityTermSheetCtlr(ApexPages.StandardController controller)
{
this.o = (Opportunity) controller.getRecord();

listActiveAssets = [select End_User__c, Product_Name__c, Implementation_Method__c, Production_Version__c, UOM_Quantity__c
                    from Custom_Asset__c where End_User__c = :o.End_User__c AND Active__c = 'Yes'];
  
listOpportunityLineItem = [select OpportunityId, Product_Name__c, QBR_RevenueType__c, UOM_Qty__c, UOM_List_Unit_Price__c, UOM_Net_Unit_Price__c, DiscountPercentTotalUOM__c, TotalPrice
                        from OpportunityLineItem where OpportunityId = :o.id];
                    
}
}

Thanks in adv.
Hi Guys,

i've just tried to add the discount field into a Order Visualforce.
But i get the following error Error: Invalid field Discount for SObject OpportunityLineItem

This is my Visualforce.

<table border="0" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Pos.</font></td>
    <!--   <td bgcolor="#C0C0C0"><font face="Arial">Produkt Nr.</font></td> -->
       <td bgcolor="#C0C0C0"><font face="Arial">Produkt</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Beschreibung</font></td>
              
       <td bgcolor="#C0C0C0"><font face="Arial">Anzahl</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Einzelpreis</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Discount</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Gesamt Preis</font></td>
</tr>
<tr>
<apex:variable value="{!1}" var="count"/>
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!FLOOR(count)} </td>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Description}</td>
                          
             <td><apex:outputText value="{0, number, 0}">
              <apex:param value="{!line.Quantity}" /></apex:outputText></td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td>{!line.discount}</td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
          </tr>
          <apex:variable var="count" value="{!count+ 1}"/>
       </apex:repeat>  
</tr>
<tr>
       <td bgcolor="#C0C0C0" align="right" colspan="7">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:OutputField value="{!Opportunity.Amount}"/></font></td>
</tr>
</table>

We have a professional edition so there is no field level security or something like this.
Any suggestions?
Thanks in advance.
Hi,
I have two date fields Start_Date__c and Close_Date__c
and one picklist Field Status


My Requairment is
Example :
       Start Date : 15/04/2014
       Close Date : 18/04/2014
       Status : open

If Close Date is 19/04/2014 
Status should be change
Status : Close



How to chnge this picklist Status please help me..

Thanks ....
hi all 
           please tell to the work flow validaction rules
HI,
I need ot edit all contacts in related lists using VF script, i got one of the site but it only does selected ones, is htere a way to select all of the contacts
here is code

<apex:page standardController="Contact" recordSetVar="unused" sidebar="false">
<apex:includeScript value="{!$Resource.UtilJS}" />
<apex:form >
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlock >
Note: All modifications made on the page will be lost if Return button is clicked without clicking the Save button first.
</apex:pageBlock>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Return" action="{!cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selected}"  var="a" id="table">
<apex:column headerValue="Name">
<apex:inputField value="{!a.Name}"/>
</apex:column>
<apex:column headerValue="Phone">
<apex:inputField value="{!a.Phone}"/>
</apex:column>
<apex:column headerValue="Mobile Phone">
<apex:inputField value="{!a.MobilePhone}"/>
</apex:column>
<apex:column headerValue="Email">
<apex:inputField value="{!a.Email}"/>
</apex:column>
<apex:column headerValue="Title">
<apex:inputField value="{!a.Title}"/>
</apex:column>
<apex:column headerValue="Account">
<apex:inputField value="{!a.AccountId}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:inputField value="{!a.Description}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Hi,
I fill in my Account Details and click on the submit button.
On click of "submit", i need to check on the Account Name, Company Name, Website and Shipping Address. If any of these things are matching with any other records i need to throw an error saying "Duplicate Account".
Please let me know how can i configure this on the "Submit" button.

Any help appreciated.
Thanks in advance.
I'm a greener of Apex development.

I'm now creating a Trigger Test Class. The class is to create a new Account, and then create a Opportunity for the Account.

My problem is, after creating Account and Opportunity, I could not get Account by soql query. Can anyone help this?

My code and Execution log as below:

@isTest
public with sharing class TriggerTest_InvoiceItemUpdate {
    static testMethod void myUnitTest()
    {
        test.startTest();
            List<Account> accounts = new List<Account>{};
            List<Opportunity> opportunities = new List<Opportunity>{};
            String AccountId, OpportunityID;
       
         //Create a new Account
            Account testAccount = new Account(Name='Account_Test');
            accounts.add(testAccount);
            insert accounts; 
            AccountId = accounts[0].id;
       
         //Create a new Opportunity
            Opportunity Opportunity_test= new Opportunity(Account = accounts[0], Name='Opportunity_Test', StageName='Close Won', CloseDate=date.newInstance(2011, 7, 4));
            opportunities.add(Opportunity_test);
            insert opportunities;
            OpportunityID=opportunities[0].id;
            system.debug('1>>>'+opportunities[0].Account.id);
        
         //To querry the Opportunity's Account
         opportunities =[select id, account.name  from Opportunity where id=: OpportunityID];
         system.debug('2>>>'+opportunities[0]);
         system.debug('3>>>'+opportunities[0].account.name);
       
        test.stopTest();
        }
}



Execution log:
[21]|DEBUG|1>>>001N000000ACdfjIAD
[25]|DEBUG|2>>>Opportunity:{Id=006N0000003BzKOIA0}
[26]|DEBUG|3>>>null
Is there a way to remove the standard clone button from a page layout in salesforce?

What is the difference between Custom Settings & Custom Objects?

 

I have here two VFP's one for Edit and one for Detail.

 

On Detail is a button called 'Edit' which opens the Edit page.

 

On the Edit page is a button called 'Save' and a button 'Cancel'. When i click the Save button, it saves the edited record  and navigates to the Detail page as defined in the save() method, however the Edit button on the Detail page is not displayed. Even the Cancel button navigates to where I was but the Edit button disappears from the Detail Page.

 

I thik there's some conflict between StandardController and the extension.

 

Can someone please takle a look and tell me what I doing wrong  .

 

Thanks.

 

 

Detail Page 

<apex:page standardController="Transaction__c" extensions="TransactionsCtrl" id="thePage" >
<apex:pagemessages />
<apex:form id="theForm" >  
     <apex:pageBlock id="detailsPB" title="Details" mode="detail">
          <apex:pageBlockButtons id="detailButtons" location="top" >
          <apex:commandButton id="editBtn" value="Edit" action="{!edit}" />    
          </apex:pageBlockButtons>
<apex:pageBlockSection title=" AUDIT RESEARCH" columns="2" id="pgBlckSct1">
    <apex:outputField id="rescodeFld" value="{!transaction.Research_Code__c}"/>
    <apex:outputField id="mancloseFld" value="{!transaction.Manually_Close_Y_N__c}"  />
</apex:pageBlockSection> 
</apex:pageBlock> 
</apex:form>
</apex:page>



Edit Page 

<apex:page standardController="Transaction__c" extensions="TransactionsCtrl" id="thePage" >
<apex:pagemessages />
<apex:form id="theForm" >  

<apex:pageBlock id="editPB" title="Edit" >
          <apex:pageBlockButtons id="editButtons" location="top" rendered="true">
          <apex:commandButton id="saveBtn" value="Save" action="{!save}" />
          <apex:commandButton id="cancelBtn" value="Cancel" action="{!cancel}" />
          </apex:pageBlockButtons>
<apex:pageBlockSection title="Audit Record" columns="2" id="pgBlckSct1">
<apex:inputField id="statusFld" value="{!transaction.Status__c}" />
<apex:inputField id="empidFld" value="{!transaction.EmplId__c}"  />
</apex:pageBlockSection> 

</apex:pageBlock> 
</apex:form>
</apex:page>


Class

public with sharing class TransactionsCtrl { 
    
    private ApexPages.StandardController stdController  { get; set; }
    public Transaction__c transaction { get; set; }
    
    public TransactionsCtrl(ApexPages.StandardController stdController) {
        
        
      System.debug('is it in the constructor');
      this.stdController = stdController;
      this.transaction = (Transaction__c)this.stdController.getRecord();

        pbatransaction = [SELECT Id, Name
                        FROM Transaction__c 
                                        WHERE Id = :transaction.Id limit 1];   
       }       
  public PageReference edit() {  
    PageReference page = new Pagereference('/apex/Transactions_Edit?Id='+transaction.Id);
        page.setRedirect(true);
        return page;
  }
        
  public PageReference save() {   
            try{
                update this.transaction;
                }catch(exception e){
                }
                PageReference page = new Pagereference('/apex/Transaction_Detail?Id='+transaction.Id);
            page.setRedirect(true);
            return page;
 }
 public Pagereference cancel(){
        PageReference newpage = new Pagereference('/apex/Transaction_Detail?Id='+transaction.Id);
        newpage.setRedirect(true);
        return newpage;
 }
   
}





 

Hi community,

 

I am getting this error while running a test class, I don't really understand why because I am not even trying to insert a user, only opportunities...

 

 

Error message:

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_USERNAME, Duplicate Username.<br>Another user has already selected this username.<br>Please select another.: [Username] Stack Trace Class.CloseDuplicateOpportunitiesTest.test1: line 17, column 1

 

 

 

Class:

 

global class CloseDuplicateOpportunities{

   webService static String closeDuplicateOpportunities(Id contextOppId) {
       
        Opportunity contextOpp;
        List<Opportunity> relevantOpps;
        String finalMessage;
        Profile userProfile = [SELECT Name FROM Profile WHERE Id = :Userinfo.getProfileId()];


        /*********************************************************/
        /*****************AUTHORIZED USER ************************/
        /*********************************************************/
   
        try{
        contextOpp = [SELECT Id,AccountId,Owner.Name FROM Opportunity WHERE Id=:contextOppId];
        } catch(Exception e){
        System.debug('The following exception has occurred while trying to get the context opp: ' + e.getMessage());
        }
        
        
        if (   (userProfile.Name.equals('NA Telesales Rep') ||
                userProfile.Name.equals('NA Telesales Manager') ||
                userProfile.Name.equals('NA Territory Manager - Outbound')) && 
                contextOpp.Owner.Name == 'NA BS User' )
        {
            List<Opportunity> oppsToUpdate = new List<Opportunity>();
            
            oppsToUpdate.add(contextOpp);
                       
            try{
            relevantOpps = [SELECT Id,StageName,Reason_For_Closed_Lost__c FROM Opportunity WHERE 
                AccountId = :contextOpp.AccountId AND
                IsClosed = false AND
                Owner.Name like 'NA BS User' AND
                Id != :contextOpp.Id AND 
                Product_Target__c INCLUDES ('Advanced','Express Checkout Shortcut (ECS)','Pro')];
            oppsToUpdate.addAll(relevantOpps);
            } catch(Exception e){
            finalMessage = 'No relevant opportunities have been closed because either none were found or an error has happened.';
            }

            if(oppsToUpdate.size() > 0)
            {
                for (Opportunity o : oppsToUpdate)
                {
                 o.StageName = 'Closed Lost';
                 o.Reason_For_Closed_Lost__c = 'Close - TS Duplicate';
                }

                System.debug('###########oppsToUpdate '+ oppsToUpdate);
                try{
                update oppsToUpdate;
                finalMessage = relevantOpps.size() + ' similar opportunities have been closed in addition to this one';
                } catch(Exception e){
                finalMessage = 'No relevant opportunities have been closed';
                }
            }
            
        } 
           


        /*********************************************************/
        /********************NON-AUTHORIZED USER *****************/
        /*********************************************************/
        else{            
            finalMessage = 'No relevant opportunities have been closed because you do not have an authorized profile or the opportunity is not owned by NA BS User.';
        }


     return finalMessage;
    }


}

 

 

 

  • December 10, 2013
  • Like
  • 0

Hi all,

I want to display Account History as a related list in Visual force page. I am trying below syntax

<apex:page standardController="Account">
        <apex:relatedList list="AccountHistory"/>
</apex:page>

But it is giving error as 'AccountHistory' is not a valid child relationship name for entity Account '

Please let me know the correct syntax of API name for account history to display it as a related list.

Hi,

 

Diff between Enterprise WSDl and Partner WSDL ?When we will use these WSDLs?Pls Explain...

 

 

Thanks,

 

VickySFDC

Csv Error Invalid Csv FileFormat Please select a different file
com.sforce.async.CSVReaders$CSVParseException:Excceded number of records:
10002.Number of records should be less than or equal to 10001

 

I am updating data using dataloader i was geting this error can anybody help me

Hi Experts,

 

My questions about visualforce pages

 

how many records we can show on visual force page.

 

Thanks in advance

Hi,

 

I'm trying to code an Apex test class for a Dynamic Related List that add and delete rows in a table through visualforce.

The complete code I got here:

 http://visualforcemadeeasy.blogspot.com.br/2009/03/how-to-add-and-delete-row-in-datatable.html

 

public class AccountsController {

/* I set the Account and Case Objects
here for use through out the code*/
public Account acct { get; private set;}
public Case[] caseItems { get; private set; }
private ApexPages.StandardController controller;

// constructor, loads the Account and
// any cases associated with it

void caseItems(id id) {
acct = [SELECT Id, Name, Type, AccountNumber, Site,
      (SELECT Id, CaseNumber, Status, Reason,Origin,
      Subject FROM Cases) FROM Account
      where id = :id limit 1];
//Hook caseItems to the query above
 caseItems = acct.Cases;
}

//Define the id
id accountid;

/* A List Method to delete the Cases assigned*/
public list todelete = new list();

public AccountsController (ApexPages.StandardController c)
{
/* this will kickoff you main page */
controller = c;
/* to get this current Account Id*/
accountid = c.getRecord().id;
/*kick off the init() function*/
init();
}
public AccountsController () {
accountid =
ApexPages.CurrentPage().getParameters().get('id');

init();

}

void init() {
/* load up Cases
basically we defined caseitems up on top, so
when the page loads then caseItems(accountId)
will go through the query and list out the
Items assoicated with it */
caseItems(accountid);  
}

public PageReference save() {
try {
upsert caseItems;
if ( todelete.size() > 0 ) {           
delete todelete;   
}
caseItems(acct.id);
}
catch ( DmlException exc) {
      ApexPages.addMessages(exc);
      return null;
}
return null;
}


/* your Delete functionality*/
public PageReference del() {

string delnumber =
ApexPages.CurrentPage().getParameters().get('delnumber');

system.assert( delnumber != null );
integer gone = -1;
integer i = 0;
  
for ( i=0; i< casenumber ="="" gone =" i;">= 0) {
todelete.add(caseItems.remove(gone) );
}
return null;
}
public PageReference add() {
// insert a new line, after user clicks Add
Case cs =  new Case(
AccountId = acct.id,
Subject = 'hello', Status = 'Low',
Reason = 'Other',Origin='Low'
);
caseItems.add ( cs );
return null;
 }
}

 

 

 

 

My test class coverage 71%. I'm using custom objects. When I include the function del() - DELETE, it returns the following exception: System.AssertException: Assertion Failed

 

        LineItem__c item = new LineItem__c(ObjectId__c = ag.Id);
        insert item;

        ApexPages.StandardController QContracts_Line = new ApexPages.StandardController(item);
	AccountsController qe = new AccountsController(QContracts_Line);
	ApexPages.currentPage().getParameters().put('id', item.Id);
	qe.add();
	qe.save();
        qe.del();

 

Does anyone knows any way to resolve this?

 

String a= 'SELECT ' + strfield +' FROM ' +  sobjectName + ' WHERE Id = :strid';
how can i get NULL value records also using Database.query() ?

suppose the contact is sobjectName and strfield result is  lastname,firstname right?

if i query the lastname and firstname . but the firstname is null means i need to display that value also using database.query...


Any help is much appreciated
 
How can i get all the custom objects and standard objects in HTML5 app?
I need to create HTML5 app in salesforce using visualforce. i want all the custom objects details and standard object details here....any ideas and suggestions are welcome? i never worked this app.....


regards,
Subramani

global class getProductDetail
{

  
    
    WebService static List<string> getProductUpdate(List<Product2> lstPro)
    {
            List<string> lstProName = new List<string>();
            List<Product2> Productlist = new List<Product2>();
          //  List<Product2> prod=new  List<Product2>();
          Product2 pro = new  Product2();
            system.debug('---------------Name----------------'+lstPro);
             system.debug('---------------Name----------------'+lstPro[0].Name);
             system.debug('---------------strname__c----------------'+  lstPro[0].strOnhand__c);
             system.debug('---------------strname__c----------------'+  lstPro[0].QB_Available__c);
             
            for(Product2 p: lstPro)
            {
                try 
                {
            
                   pro =[Select Name,Family,ProductCode,QB_Available__c,QB_Next_due_date__c,QB_On_Hand__c,QB_On_order__c,QB_On_sales_order__c from Product2 where ProductCode=:p.Name and Family != 'Retail'];
                  
                  
                       system.debug('---------------Name----------------'+ pro.Name);
                       pro.QB_Available__c = Decimal.valueof(p.strAvailable__c);
                      system.debug('---------------Available----------------'+ pro.QB_Available__c);
                       pro.QB_On_Hand__c = Decimal.valueof(p.strOnhand__c);
                       pro.QB_On_order__c= Decimal.valueof(p.strOnOrder__c);
                       pro.QB_On_sales_order__c= Decimal.valueof(p.strOnOrderSales__c);
                       if(p.strNextDewDate__c != null)
                       pro.QB_Next_due_date__c= Date.valueof(p.strNextDewDate__c);
                     
                     
                      update pro;
                      string strname = 'Updated successfully:  '+p.Name;
                      lstProName.add(strname );
                  
               }
                catch(Exception e) 
                { 
                   System.debug('The following exception has occurred: '+p.Name + e.getMessage());
                   string pname = 'Update Failed -Error:' +p.Name+ e ;
                   lstProName.add(pname);
                } 
                  
             
            
            } 
            
          
           // Update Productlist;
            system.debug('---------------ProductUpdated----------------');
        
            return lstProName ;
    }
    
}

i need some help reg self reg of portal......first validating the user and if the user account is validate then it will allow self-register for the portal through visual force.......

 

thanks in advance

anybody provide the code for displaying page buttons like 1,2,3........etc in visual force and i want if i click it will show the page records related to that page.I am using stdsetcontroller for pagination.

I have vf page...I have run report button to display the records and also filtering by dates...I want export the result into excel,pdf,csv files through command button...Any one help regarding this welcome.....Thanks in advance....

i have checkboxes in pageblock table for passing that value from one page to another vf page....if i am selecting one by one it wil get selected and passing the values to the next vf page. but if i am going to select the next value it not added to the next vf page.Also if i selecting all checkboxes it will give the error like this...

 

System.StringException: Invalid id: checkedone

Error is in expression '{!doSelectItem}' in page searchproduct
 
 
how to avoid this...i m using wrapper class...if need i will post my entire code here. anyone give the solution for this..
 
 
 
Thanks

i have the wrapeer class for checkbox....without that my pagination,sorting,searching functionality is working fine.....After adding checkbox is pageblock table.....all the above functions are not working.....anybody can help this??? i am using standardsetcontroller......



i got the error like this


  • Value 'false' cannot be converted from Boolean to lib.id.ID
Hello All

I'm sending an HTML email via Apex. But when opening the email in Outllok is empty. Eventhough in the preview I see there is text.
Can you please help?
 
Hi Experts,

i wrote below code after order is created , i need to update the case status 'New'  after any field is updated on case  and i wrote the code like below but  lot of errors, i am not sure how to take case and to update. can you help me pls i wrote the code its totally wrong kindly need a help on this

i am not sure how to use the case here Map<Id, Case> oldMap

if(Trigger.isInsert && Trigger.isAfter){
        OrderHandler.OnAfterInsert(Trigger.new, Trigger.newMap);
}
public static void OnAfterInsert(List<order> lstObject, Map<Id, Case> oldMap)
  {
    
    set<id> caseIds = new set<id>();
    for(order ord : lstObject)
    {
     if(ord.Case__c!= null)
     {
       caseIds.add(ord.Case__c);
     }
     }
     if(caseIds != null)
     {
      
      for(Case obj : caseIds)
        {
            for (String fieldName: schemaFieldMap.keySet())
                {
                 if((obj.get(fieldName) != oldMap.get(obj.Id).get(fieldName)))
                {
                    (obj.status=='Partially Complete')) ? obj.status : 'New';
                    break;
                }
            
                
        }
        }
      
      }
      }
Hi All,

I am getting the below Error for my Template - VF_Quote Email Template :

Error occurred trying to load the template for preview: List has no rows for assignment to SObject. Please try editing your markup to correct the problem.

Code for VF_Quote Email Template (Visualforce Template):
 
<messaging:emailTemplate subject="Dear Approver, Quote Number {!relatedTo.QuoteNumber} {!relatedTo.Name} was sent for your approval {!relatedTo.Urgent_Text__c}" recipientType="Contact" relatedToType="Quote">

<messaging:htmlEmailBody >
   
   
<html>

    <img src="http://photos.prnewswire.com/prnvar/20120528/535447?max=400" width="250" height="30"/>
    
    
    

  <head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
    <meta name="Template" content="Response"/>
    
    <style>
    td {
        text-align: right;
        font-family: Verdana;
    }
    
    p{
        text-align: left;
        font-family: Verdana;
    }
    
    h3 {
        font-family: Verdana;
    }
    
    </style>

  </head>
    <body>
        
        <br/>
        <p> <h3><b> Dear Approver, </b> </h3> </p>
        
        <br/>
        
        <p> <b> Quote {!relatedTo.QuoteNumber} {!relatedTo.Name} was sent for your approval . <font color="#FF9900"> <apex:outputText value="Urgent" rendered="{!relatedTo.Urgent__c}"/> </font></b> </p>

        <p> <u> <b> Opportunity Owner : </b> </u>  <c:QuoteEmailTemplate2 theQuoteId="{!relatedTo.Id}"/> </p>
        
        <p> <u> <b> Opportunity Territory : </b> </u>  <c:QuoteEmailTemplate3 theQuoteId="{!relatedTo.Id}"/> </p>
        
        <p> <u> <b> Account : </b> </u>   {!relatedTo.BillingName} (#{!relatedTo.Account_Number__c })</p>
       
        <p> <u> <b>Sales Type:</b> </u>  {!relatedTo.bl_Sales_Type__c}   </p>
        
        <p> <u> <b> Upgrade/Traded : </b> </u>  {!relatedTo.Upgrade_Traded_In_Equipment_Type__c}   </p>
        
        <p> <u> <b>Comments for Approval : </b> </u>  {!relatedTo.Comments_For_Approval__c}   </p>
        
        <p> <u> <b> Payment Method </b> </u>: {!relatedTo.Payment_Method__c} <c:QuoteEmailTemplate4 theQuoteId="{!relatedTo.Id}"/> 
        
        
          {!relatedTo.Number_Of_Installments__c}, 
        
         <u> <b> Payment Notes : </b> </u> {!relatedTo.Payment_Notes__c}  </p>
         <p> <u> <b> Payment Notes in English : </b> </u> {!relatedTo.Payment_Note__c}  </p>
          <p> <u> <b>Payment Type : </b> </u>  {!relatedTo.Payment_Type__c }   </p> 
         
          <p> <u> <b> Special Instructions :</b> </u>  {!relatedTo.Special_Instructions__c}   </p>
          
          <p> <u> <b> Obligation : </b> </u> {!relatedTo.Obligation__c}   </p>
          
           <p> <u> <b> Amount for the Obligation : </b> </u> {!relatedTo.Amount_for_the_Obligation__c}   </p>
          
          
        
        <table BORDERCOLOR="blue" style="solid">
                <tr>
                  
                    <th bgcolor="blue"> <font color="#fff"> <b> Product Name</b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> Part/KIT Code</b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> List Price</b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> Quantity</b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> Sales Price</b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> Total Sales Price</b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> Line Discount </b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> GM</b> </font> </th>
               <!-- <th bgcolor="blue"> <font color="#fff"> <b> Target Price </b> </font> </th>
                    <th bgcolor="blue"> <font color="#fff"> <b> Discount from Target price </b> </font> </th> -->
                    
                </tr>
                <apex:repeat var="item" value="{!relatedTo.QuoteLineItems}">
                <tr>
                 
                    <td bgcolor="#E2E1E1" text="alignright;"> <p>{!item.Product2.Name} </p> </td>
                    <td bgcolor="#E2E1E1">{!item.Part_KIT_Code__c}</td>  
                    <td bgcolor="#E2E1E1">{!item.VF_Total_Line_List_Price__c}</td>
                    <td bgcolor="#E2E1E1">{!item.Quantity}</td>
                    <td bgcolor="#E2E1E1"> {!item.VF_Sales_Price_After_Discount__c}</td>
                    <td bgcolor="#E2E1E1"> {!item.VF_Total_Sales_Price__c}</td> 
                    <td bgcolor="#E2E1E1">  {!item.Line_Discount_Calculated__c} </td>
                    <td bgcolor="#E2E1E1">  {!item.QLI_Gross_Margin__c} </td>
              
                </tr>
                </apex:repeat> 
          </table> 
          
          <p> <u> <b> Opportunity Currency :</b> </u> {!relatedTo.Opp_Currency__c}   </p>
                    
          <p> <u> <b> Total Deal :</b> </u> {!relatedTo.VF_TotalPrice__c}   </p>   
          
          <p> <u> <b> Customer Discount :</b> </u> {!relatedTo.Customer_Discount__c}%   </p>   
          
          <p> <u> <b>  Internal Discount :</b> </u> <c:QuoteEmailTemplate1 theQuoteId="{!relatedTo.Id}"/>*(after target,promotion) </p>

          <p> <u> <b> Gross Margin  :</b> </u>  {!relatedTo.Quote_Gross_Margin__c}%  </p>
          
          <p> <u> <b> Billing Address : </b> </u> {!relatedTo.BillingStreet}, {!relatedTo.BillingCity}, {!relatedTo.BillingState}, {!relatedTo.BillingCountry}, {!relatedTo.BillingPostalCode}  </p>
        
          <p> <u> <b> Shipping Address : </b> </u>: {!relatedTo.ShippingStreet}, {!relatedTo.ShippingCity}, {!relatedTo.ShippingState}, {!relatedTo.ShippingCountry}, {!relatedTo.ShippingPostalCode} </p>        
        
          <p> <u> <b>For further info on the quote </b> </u>: <a href="https://syneron-candela.my.salesforce.com/{!relatedTo.Id}">Link</a> </p>  
          
          <p> <u> <b> Please approve or reject using one of the following options </b> </u> : </p> 
          
          <p> <b> 1.  Through the approval request page: </b> </p> <a href="https://Test.my.salesforce.com/home/home.jsp"> Home Page </a>
          
          <p> <b> 2.   Reply this mail with the one of the following key words: </b> </p>
          
          <p>  <b>  Approve / Approved / Reject / Rejected / Yes / No </b> </p>
          
          
          <p> <b> Thank you,  &nbsp; <c:QuoteEmailTemplateOppOwnerName theQuoteId="{!relatedTo.Id}"/> </b> </p>
          
        
     </body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
how to create apex trigger using email message in email to case (automatically task sholud created notification have to come using salesforce lightind)uisng apex trigger ,can anyone tell me this requiremnt as soon as possible?
can you please me to write test class on below code:
Apex code:

public class copycontact {
    public list<selectoption>account1{set;get;}
    public list<selectoption>account2{set;get;}
    public list<contact>contacts{set;get;}
    public String getListOfAccounts { get; set; }
    public id selectedaccountId1 {set;get;}
    public id selectedaccountId2 {set;get;}
    public list<id>selected ;
    public List<SelectOption> getListOfAccounts1()
    {
        List<Account> AccountList1 = [select id,Name from Account] ;
        System.debug('Accounts'+AccountList1.size());
        account1 = new List<SelectOption>();
        account1.add(new SelectOption( ' ' ,'---Select---'));
        for(Account acc : AccountList1 )
        {
            account1.add(new SelectOption(acc.id , acc.Name));
        }
        return account1 ;         
    }
    public List<SelectOption> getListOfAccounts2()
    {
        List<Account> AccountList2 = [select id,Name from Account] ;
        System.debug('Accounts'+AccountList2.size());
        account2 = new List<SelectOption>();
        account2.add(new SelectOption( ' ' ,'---Select---'));
        for(Account acc : AccountList2 )
        {
            account2.add(new SelectOption(acc.id , acc.Name));  
        }
        system.debug('java');
        return account2 ;  
    } 
    public  void clonecontacts(){
        system.debug('gsvdd');
        if(selectedaccountId1!=null){
            contacts=new list<contact>([select id,lastname from contact where accountid=:selectedaccountId1]);
            if(contacts.size()==0){
                system.debug('gsg'   );
               ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,'No contacts to display'));
            }
            else{
                system.debug('dhg');
                list<contact>clist=new list<contact>();
                for(Contact con:contacts){
                    contact c=new contact();
                    c.lastname=con.LastName;
                    c.AccountId=selectedaccountId2;
                    clist.add(c);
                }
                insert clist;
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM,'successfully copied'));
            }
        }
    }
}
vf page:

<apex:page controller="copycontact">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection title="from Account" >
                <apex:OutputPanel >
                    <apex:selectList value="{!selectedaccountId1}" size="1" multiselect="false" >
                        <apex:selectOptions value="{!ListOfAccounts1}"  />
                    </apex:selectList>
                </apex:OutputPanel>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <apex:pageBlock >
            <apex:pageBlockSection title="to account">
                <apex:selectList value="{!selectedaccountId2}" size="1" multiselect="false"  >
                    <apex:selectOptions value="{!ListOfAccounts2}" />
                </apex:selectList>
            </apex:pageBlockSection> >
        </apex:pageBlock>
        <apex:commandButton value="clone" action="{!clonecontacts}"/>
        <apex:pageMessages ></apex:pageMessages>
    </apex:form>
</apex:page>
Hi,

I have a user with Consulting-Sr.manager as profile. I have given all the access permission that a User should need and able to run and schedule reports. Still I am getting warning message as below;
However I tried giving access to "Manage Public Reports" permission , then the issue is resolved . But problem is the User got the rights to modify other public reports as well which I dont need. He should be able to have access only to his reports. Please suggest

User-added image
Hi All,
my requirement is given below:-
Need a Tab Configure History Tracking
It will open a view where user will see a DropDown Select Object, all Native and Custom Objects will be listed on it
Upon selection it will show list of all fields for that object, this screen should match to native screen.
i am trying to build a visualforce page can anyone guide me?

Here's what I've been staring at for 16 minutes so far. 

User-added image

Deployed via SFDX, specifying a single apex test to run, which has less than 40 lines of code. Takes only a fraction of a second to run in scratch org or sandbox.

But when I deploy to Production, all components are validated within a minute or two, then the status switches to 'Running {testname}'.... and stays that way. For literally 15 minutes or more. Before the test is even started. 

I'm not finding a lot of posts on this issue. Plenty of people talking about the time it takes to actually run the test. But I'm talking about the time it takes to start running the tests. This isn't a one time thing, but it also isn't consistent. Sometimes the tests will begin running pretty much immediately. Sometimes I'll end up cancelling and redeploying because a 30 minute delay to START testing seems ridiculous even given Salesforce's standards. And when I do cancel and redeploy? Good chance it'll take a fifth of the time, for no apparent reason.

What I'd really like is some better communication during this process. Why is my test run delayed? What was prioritized ahead of it? How can I anticipate deployment times so it's not a complete crapshoot regardless of build size? 

Field (1) How_did_you_hear_about_us__c has the following values and it is a multi picklist field

Brochure
Bus Advert
EDM [Email]
Events
Facebook
Instagram
Others
Parent Forum
Search Engine
Twitter
Website
Word of Mouth

Field 2 Others_How_did_you_hear_about_us__c is a text field (50 characters)

I am having trouble in writing a validation rule, if 'Others' is selected from field 1, field 2 need to be manadatory.  and if rest of the values are choosen, the Field 2 is not mandatory.  I have a situation if the user select 'Others' and some other options, the record is not able to save, I need some help on this, for example if I choose (Instagram, Others, Parent Forum), I cannot save the record

 
  • November 07, 2016
  • Like
  • 0
Hi, I have created an approval process and to access that we are using custom approval page, reassign page and recall page. I want to add "comments" field in Reassign page the same way it exists in standard functionality. But when I tried to add it on custom page then I got an error message "field is not writable". We have used workbench as well to access it but no luck. Can anyone help in that if it is a possibility!
Guys,

We have a custom field on case obj called email address.
I want to show the list of cases that have same email address on a case record.

Something like,

A related list on the case record that shows the list of cases(previous inquiries) that are from same email address.

Right now enhanced lookup is not available on the case object,  and also
we dont want to create contacts from these cases.

I couldn't get started on this.

Are there any other ways to do this other than using apex?
If not, how to code this via apex?

Appreciate your help!
Hello,

I have a connection to external webservices, how can i track the erros and the execution order of this 
?
  • November 06, 2016
  • Like
  • 0

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.