• Saurabh B
  • NEWBIE
  • 440 Points
  • Member since 2014

  • Chatter
    Feed
  • 14
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 72
    Replies
I have the following controller extetion which works to make a pdf as attachment, but need some help writing a testclass for so far i have the following:
 
public with sharing class attachPDF {
private final Facturatie__c a;
    public attachPDF(ApexPages.StandardController standardPageController) {
        a = (Facturatie__c)standardPageController.getRecord(); //instantiate the Facturatie__c object for the current record  
    }    
    Facturatie__c  currentRecord = [SELECT Id, Accountname__r.Name FROM Facturatie__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    
    public PageReference attachPDF() {
        PageReference pdfPage = Page.Factuur2PDF;
        pdfPage.getParameters().put('id',a.id);
        Blob pdfBlob = pdfPage.getContent();
        
        Attachment attach = new Attachment(parentId = a.Id, Name = 'Factuur ' + '-' + currentRecord.Accountname__r.Name +'-'+ date.today().format() +'.pdf', body = pdfBlob); //create the attachment object
        insert attach;
        PageReference pageWhereWeWantToGo = new ApexPages.StandardController(a).view();
        pageWhereWeWantToGo.setRedirect(true);
        return pageWhereWeWantToGo;
    }
}
 
@isTest(seeAllData=true) 
public class attachPDFTestClass {

static testMethod void testAttachments() { 
    Facturatie__c a = new Facturatie__c(Facturatie__c.Accountname__r.Name='Test');
    insert a; 

    Attachment attach=new Attachment(); 
    attach.Name='Unit Test Attachment'; 
    Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); 
    attach.body=bodyBlob; attach.parentId=a.id;
    insert attach;

    List<Attachment> attachments=[select id, name from Attachment where parent.id=:a.id]; 
    System.assertEquals(1, attachments.size()); 

    Test.StartTest();
    FeedItem f = new FeedItem();
        f.ParentId = a.id;
        f.body = 'test';
        insert f;
        FeedComment fc = new FeedComment();
        fc.CommentBody = 'legal test';
        fc.FeedItemId = f.Id;
        insert fc;
        Test.StopTest();
        System.assertEquals ('legal test', fc.commentbody); 
    }
}

I get the error invalid field initializer
I have created a VF Page of an opportunity list view. One of the fields is Opportunity Name. When you click the name it opens the record in the VFPage. Can I modify the code to open a new tab when the opportunity is clicked? 

<apex:page sidebar="false">
 
   <apex:enhancedlist height="450" listid="00Be0000001eBaB" rowsperpage="100">;
    
</apex:enhancedlist></apex:page>
Hi All
I have searched for multiple post to find an answer for this common error but I am not sure what mistake I am commiting.. All I need to do query a local list and add ID's to a SET so that I dont execute multiple SOQL's. Appreciate your help on this

My CODE
I am using "Execute Highlight" option to see if my code works and it breaks in line 7
Line: 7, Column: 18
Initial term of field expression must be a concrete SObject: List<Allocation__c>
 
List <Allocation__C> lst =  new List <Allocation__c>();
lst = [Select  Percentage__c, Line_of_Business__c, Support_Contract__c
                          from Allocation__C WHERE Percentage__c = 50 LIMIT 1 ];
Set<ID> supConID = new Set<ID>(); --IS THIS THE CORRECT DATA STRUCTURE
for(Allocation__C al :lst) -- THIS IS WHERE THE ERROR HAPPENS, 
{
    supConID.Add(lst.Support_Contract__c);
}
List <Request__C> req = new List <Request__c>();
req = [Select ID, LOB_Allocations__c 
                         FROM Request__c WHERE ID IN (Select  Support_Contract__c
                          from Allocation__C WHERE Percentage__c = 50)];


List <Allocation__C> alloc = new <Allocation__c>();
List <Request__C> reqUpdate = new <Request__C>();
for(Request__C r: req)
{
    string lobstring = '';
    Request__c rtemp = new Request__c();
    for(Allocation__c a: [select Line_of_Business__c, Percentage__c FROM lst WHERE Support_Contract__c = :r.ID])
    {
        lobstring += (lobstring ==''?'':' / ')+a.Line_of_Business__c+'('+  a.Percentage__c + '%)';
    }
    rtemp.ID = r.ID;
    rtemp.LOB_Allocations__c = lobstring;
    reqUpdate.Add(rtemp);
    
}
update reqUpdate;
/*List<Request__C, string> fnl = new List<Request__c , string>;
for ( Allocation__C ac :lst)
{
    ac.Allocation_Notes__c = ac.Allocation_Notes__c;
    update ac;
}*/
Hi everyone!

I read in a previous post that it is possible to implement both in a single class, but the post didn't give any exemples.
Could you explain  how to do that to me (with exemples if possible)
Thanks!
Vianney Bancillon
I'm looking to update a calculation for a large number of fields and have an APEX command line.  I have some base instructions to go to Setup --> Developer Console --> Debug --> Open Execute Anonymous Window.  This is where I get stuck and not sure what the syntax is.  This is the command line I have to run:

database.executebatch(new XXXX_YY_AAA_YTD_CALC (),200);

And i believe the class is: XXXX_YY_AAA_YTD_CALC

So what would the syntax be that I drop into the box that pops up for me to execute?  Is it as simple as just entering in one line of database.executebatch(new....)

Thanks,
Arun
Hello,

It is really helpful if someone clarifies below scenario:

1. Can we edit standard salesforce report.
2. Can we add bucket filter, field filter in standard report?

As per my understanding while we try to edit a standard report using customize button it will give us option to save the report in another name that is the clone of the standard report(we can refer it as custom report also) and the customization is not saved in the standard report. Please correct me if I am wrong.

Hence is there any another way to edit standard report.

Thanks
Preyanka
I created a VF Page using a standard controller and a custom extension.  My purpose for this VF Page is to update fields on a specific record within a custom object, but for some reason it is not updating the record once I enter in the data and click on the save button.  

BELOW IS MY CONTROLLER AND EXTENSION:

public class SupplierInfoExtension{
  public order__c selectedOrder {get;set;}
  public List<Order_Line_Item__c> selectedOrderLines {get;set;}
  
  public SupplierInfoExtension(ApexPages.StandardController controller) {
    selectedOrder = (Order__c) controller.getRecord();
    selectedOrderLines = [SELECT Additional_Information__c, Approx_Lbs_Gal__c, CreatedById, CreatedDate, FOB_DVD_Customer__c, FOB_DVD_Supplier__c, 
                                 Id, Name, Order__c, Product__r.name, Product_Code__c, Customer_Product_Code__c
                            FROM Order_Line_Item__c
                           WHERE Order__c = : selectedOrder.Id];
  }
  public void save()
  {
      update selectedOrder;
  }
}



BELOW IS MY VF PAGE CODE:

<apex:page sidebar="false" StandardController="Order__c" extensions="SupplierInfoExtension">
    <apex:form >
    <apex:pageBlock >
            <apex:pageBlockTable value="{!Order__c}" var="Order">
                <apex:column value="{!Order__c.name}"/>
                <apex:column value="{!Order__c.customer__r.name}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
        <apex:pageBlock >
        <apex:pageBlockButtons >
            <apex:commandButton value="save" action="{!save}"/>
        </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selectedOrderLines}" var="ol">
                 <apex:column headerValue="Product Code">
                    <apex:inputField value="{!ol.Product_Code__c}"/>
                </apex:column>
            </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>


Any thoughts on why the record is not updating?  
I'm trying to create a simple cross-object formula on the Oppty to reference Last Activity on Account.  I have the formula working using the TEXT function and refencing the date field, TEXT(Account.LastActivity), but it's formatting the date as 2017-01-20 when it comes over.  I would prefer it be formatted like other date fields in Salesforce as 01/20/2017.  Any idea what function I would use for that?
  • February 07, 2017
  • Like
  • 0
Hi,

I’m new to Salesforce apex and I'm trying to create the unit testing for a controller extension.  The extension just grabs basic values from the page the user is currently on and populates them on a new visual force creation page.  (e.g. user is on an order record, clicks create new visual force page and the account id and order id from the page carries over to the yet unsaved VF record).  I’ve been combing through posts and examples to come up with proper unit testing, but I haven’t found anything that seems to works for me yet.  I think what I might be getting thrown on is that my controller extension isn’t committing anything, just pre-populating values on the new page that the user will continue to edit and then save when they finish filling out all the applicable values.

Any help and guidance would be greatly appreciated.

Here's the VF page:
<apex:page sidebar="false" StandardController="Cust_Credit__c" extensions="CreditExtension">
    <apex:form >
        <apex:pageBlock title="Create A New Credit">
            <apex:pageBlockSection title="My Content Section" columns="2">
                <apex:inputField value="{!Cust_Credit__c.Credit_Memo_Account__c}"/>
                <apex:inputField value="{!Cust_Credit__c.Credit_Memo_Details__c}"/>
                <apex:inputField value="{!Cust_Credit__c.Credit_Memo_Item__c}" required="true"/>
                <apex:inputField value="{!Cust_Credit__c.Credit_Amount__c}"/>
                <apex:inputField value="{!Cust_Credit__c.Related_Order__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
            <apex:commandButton action="{!save}" value="Save" id="theButton"/>
    </apex:form>
</apex:page>

Here's the controller extension:
public class CreditExtension {
    Cust_Credit__c custCred {get;set;}

    public CreditExtension(ApexPages.StandardController stdController){
        custCred = (Cust_Credit__c)stdController.getRecord();
        custCred.Credit_Account__c = ApexPages.currentPage().getParameters().get('AccountId');
        custCred.Related_Order__c = ApexPages.currentPage().getParameters().get('OrderId');
    }
}
Here's the URL from the custom button that hits the controller extension/VF page:
/apex/Credit_Memo_Entry?AccountId={!Account.Id}&OrderId={!Order.Id}
And here's my poor attempt at a unit test:
@IsTest public with sharing class CreditMemoControllerTest {
     @IsTest(SeeAllData=true) public static void testCreditMemoControllerTest() {
        CreditExtension controller = new CreditExtension();
        controller.setAccountId('001C000001Iqyqa');    
        controller.setOrderId('801C00000008fYW');               
        System.assertEquals(controller.CreditExtension(),null);                           
    }    
}

Thanks

 
I have an email alert setup to fire out when a lead is at a specific lead status and there has been no activity in 25 days. But now I need to add a third statement ensuring that if the lead is modified by the following profile id's: 00570000001m9eZ and 00570000002oRin - - the email alert should NOT fire. Can someone please let me know how I can add that statement to my formula below?

((LastModifiedDate = Now() + (-25))) && (ISPICKVAL(Status,"Workig"))
trigger NumOfContacts on contact (after insert, after update, after delete, after undelete) 
{
    
    List<account> acc = new List<account>();
    
    Set<Id> sid = new Set<Id>();
    
    if(Trigger.isDelete) 
    {
        for(contact con:Trigger.Old) 
        {
            sid.add(con.accountId);   
        }    
    }
    else
        if(Trigger.isUpdate) 
    {
        
        for(contact con:Trigger.New) 
        {            
            sid.add(con.accountId);   
        }
        
        for(contact con:Trigger.Old)
        {
            sid.add(con.accountId);   
        }   
    }
    
    else
    {
        for(contact con:Trigger.New) 
        {
            sid.add(con.accountId);   
        }
    }
    
    AggregateResult[] groupedResults = [SELECT COUNT(Id),accountId FROM contact where accountID IN :sid GROUP BY accountID ];
    
    for(AggregateResult ar:groupedResults) 
    {
        
        Id custid = (ID)ar.get('accountId');
        
        Integer count = (INTEGER)ar.get('expr0');
        
        account cust1 = new account(Id=custid);
        
        cust1.No_Of_Contacts__c = count;
        
        acc.add(cust1);
        
    }
    
    
    update acc;
    
}
Hi All,
I need to create a batch class to be executed every night to make some field updates.
 
I have a custom object called rate_card_item_price__c with two lookup fields:
Advert_Assignment__c    
Product_Node__c

the batch have to find al the rate_card_item_price__c records with the field borrado__c not equals to "X" , and update the Title_Product_Node__c field (IF IT IS NULL) from the Advert_Assignment__c lookup record with the id of the Product_Node__c lookup field.

Also i need to change the picklist value of the Media_Types__c field from the Product_Node__c lookup record to "Print"

Any idea how to do it?

Thanks in advance!
Dear all, I`m new to apex and I need help with issue below. I have a "New Case" custom button on Opportunity record which allows me to create Case. When clicked on "New Case" button, I can select record type and page gets redirected to standard page or visualforce page using redirect class below. Code works fine but I`m unable to auto-populate fields when record type with standard page is selected. Fields are not getting auto populated the way it happens with standard functionality. For example, I`m not able to auto-populate Opportunity Name, Stage or Close Date while creating new case record. Can someone please help? Any help is much appreciated. Thank you!

Redirect VF page
<apex:page standardController="Case" extensions="Redirect" action="{!Redirect}">

</apex:page>

Redirect class
 
public with sharing class Redirect{

    private Id id;


 private ApexPages.StandardController controller;
 public String retURL {get; set;}
 public String saveNewURL {get; set;}
 public String rType {get; set;}
 public String cancelURL {get; set;}
 public String ent {get; set;}
 public String confirmationToken {get; set;}


 public Redirect(ApexPages.StandardController controller) {

  this.controller = controller;
  retURL = ApexPages.currentPage().getParameters().get('retURL');
  rType = ApexPages.currentPage().getParameters().get('RecordType');
  cancelURL = ApexPages.currentPage().getParameters().get('cancelURL');
  ent = ApexPages.currentPage().getParameters().get('ent');
  confirmationToken = ApexPages.currentPage().getParameters().get('_CONFIRMATIONTOKEN');
  saveNewURL = ApexPages.currentPage().getParameters().get('save_new_url');
 }

 
 public PageReference redirect(){
  
  PageReference returnURL;
  // Redirect if Record Type corresponds to custom VisualForce page
  if(rType == '0121b0000009t60') {
   returnURL = new PageReference('/apex/vfcasepage');
  }
  else {
   returnURL = new PageReference('/500/e?nooverride=1');
  }

  returnURL.getParameters().put('retURL', retURL);
  returnURL.getParameters().put('RecordType', rType);
  returnURL.getParameters().put('cancelURL', cancelURL);
  returnURL.getParameters().put('ent', ent);
  returnURL.getParameters().put('_CONFIRMATIONTOKEN', confirmationToken);
  returnURL.getParameters().put('save_new_url', saveNewURL);
    returnURL.getParameters().put('nooverride', '1');
  returnURL.setRedirect(true);
  return returnURL;

 }

 public PageReference cancel() {
          PageReference pr = new PageReference('/500/o');
          pr.setRedirect(true);
          return pr;
     }


}


 
Hello, we have recently made change to our Opportunity stages and I was wondering is there is a way I can mass update filters in the Reports. What we want to do is mass update new stage values with the old one`s. I checked and this cant be done via data loader. Is there any other way ? Can I update stage values using metadata/with eclipse?

Hello:

I have a VF page which dynamically shows field based on stages selected. What I need help with is an extension which will automatically populate Probabilty associated with each stage. I tried using below extension (OpportunityControllerExt) but it gives me an error "System.NullPointerException: Attempt to de-reference a null object". Not sure what is wrong? Can someone pls help me with fixing this code or provide an alternate solution which will work with this VF page? 

Any help is much appriciated! :)

VF Page:
 
<apex:page standardController="Opportunity" sidebar="True" extensions="OpportunityControllerExt" >
    <apex:sectionHeader title="Edit Opportunity" subtitle="{!opportunity.name}"/>
    <apex:form >
        <apex:pageBlock title="Edit Opportunity" id="thePageBlock" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>                
            </apex:pageBlockButtons>
            <apex:actionRegion >
                <apex:pageBlockSection title="Basic Information" columns="1">
                    <apex:inputField value="{!opportunity.name}"/>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Stage"/>
                        <apex:outputPanel >
                            <apex:inputField value="{!opportunity.stageName}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock" action="{!updateProbability}" immediate="true"
                                                    status="status"/>
                            </apex:inputField>
                            <apex:actionStatus startText="applying value..." id="status"/>
                        </apex:outputPanel>
                    </apex:pageBlockSectionItem>
                    <apex:inputField value="{!opportunity.amount}"/>
                    <apex:inputField value="{!opportunity.closedate}"/>
                    <apex:inputField value="{!opportunity.Probability}"/>

                </apex:pageBlockSection>
            </apex:actionRegion>
            
                        <apex:pageBlockSection title="Closed Lost Information" columns="1"
                                   rendered="{!opportunity.stageName == 'Prospecting'}">
                <apex:inputField value="{!opportunity.Description}"  required="true"/>
                <apex:inputField value="{!opportunity.Type}"/>
                <apex:inputField value="{!opportunity.Dev_Sau_123__DeliveryInstallationStatus__c}"/>
                <apex:inputField value="{!opportunity.Dev_Sau_123__Languages__c}"/>
                
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Closed Lost Information" columns="1"
                                   rendered="{!opportunity.stageName == 'Closed Lost'}">
                <apex:inputField value="{!opportunity.Primary_Competitor__c}"  required="true"/>
                <apex:inputField value="{!opportunity.Reason_Lost__c}"/>
                <apex:inputField value="{!opportunity.OrderNumber__c}"/>
                <apex:inputField value="{!opportunity.TrackingNumber__c}"/>
                
            </apex:pageBlockSection>
            
            

        </apex:pageBlock>

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

Extension:
 
public class OpportunityControllerExt {
    public static Opportunity opp {get;set;}

    private map<string,decimal> probabilities = new map<string,decimal>();
    public OpportunityControllerExt(ApexPages.StandardController stdController){        
        OpportunityControllerExt.opp = (Opportunity)stdController.getRecord();
       
    }
    public PageReference updateProbability(){
        //probabilities map was made before
        OpportunityControllerExt.opp.Probability = probabilities.get(OpportunityControllerExt.opp.StageName);

                    return null;
    }
}

 

When I try to perform the following line of code:

Schema.sObjectType.Campaign.fields.Parent.isAccessible();

I get the following error: "parent is not a field of Campaign". However, when I look at the standard object in my org, I can see that there is a standard field "Parent". Is there a way to check the CRUD/FLS on this Parent field? 

Hi

I am trying to write a trigger to update account custom fields with total,won and lost cases.unable to get won and lost cases number.(I had tried to write soql for won and lost cases.but not sure how can i update them?do i need to update individual list?Is there any other way)

Also when i delete a case,how can i update the count.

please help!!
trigger counttrigger on Case (after insert, after update,after delete) {
    List<Case> lstCase = [select id, AccountId from Case where id in: trigger.newmap.keyset()];
    set<Id> sAccId = new set<Id>();
        for(Case cs: lstCase)
        {
            if(cs.AccountId != null)
            {
            sAccId.add(cs.AccountId);
            }
        }
            
    if(sAccId != null && sAccId.size() > 0){
        List<Account> lstAccount = [select id,Totalcases_c,Woncases__c,Iostcases__c, (select id,Status from Cases ) from Account where id in: sAccId];

            for(Account acc:lstAccount ){
                acc.Totalcases__c = lstAccount.Cases.size();
            }
          }  
       }
}

 

I am having trouble wrapping my head around this so if someone could help me with a start to the code, I would be very grateful.  

I have a custom object called Inventory__c.  It has Year__c, Make__c, and Model__c custom fields and I want to display the Year, Make and Model for each record within the Inventory object in a grid layout similar to this: https://webtemplatemasters.com/screenshots/cardealer/wordpress-car-theme-search.jpg.

I'm going to theme it accordingly and do all the styles, but I can't seem to figure out how to get the records in that sort of grid layout.  I know I need a custom controller, but not sure how to write it or invoke it from the VF page. 

Any help would be great. thanks a lot

I'm brand new to classes and controllers so I'm sure this is an easy fix but I'm getting an error of "Unknown property 'InventoryController.Inventory__c".  I'm just trying to start with some simple code to make sure I know what I'm doing - clearly I don't :)  I started with a Snippet from the VF Dev Guide.  Anyone give me a hand with this?

Apex Class
public class InventoryController {

    private final Inventory__c inventory;

    public InventoryController() {
        Inventory = [SELECT Id, Name, Year__c, Make__c, Model__c, Description__c, Price__c FROM Inventory__c 
                   WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    }

    public Inventory__c getInventory() {
        return inventory;
    }

    public PageReference save() {
        update inventory;
        return null;
    }
}

Visualforce Page
<apex:page controller="InventoryController" sidebar="false" showHeader="false">
    <apex:form>
        <apex:pageBlock>
            Year: <apex:inputField value="{!Inventory__c.Year__c}"/>
            Make: <apex:inputField value="{!Inventory__c.Make__c}"/>
            Model: <apex:inputField value="{!Inventory__c.Model__c}"/>
            <apex:commandButton action="{!save}" value="save"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
Hi Professionals,

I have a visualforce page, i have some components in vfpage, and i have check box component in vf page, and page block button called 'search'
Now my scenario is when ever i checked the check box, then only vf page button(search) should be "Highlighten", If i should'nt check the checkbox then search button should not be in highlighten.

Please help with this task.

Thanks In advance.
Hi,
I'm trying consume a Rest API of another system using apex, but I don't know how do that.
I'm reading and following the steps of the Trailhead (REST and SOAP Integration) but this is not clearly for me.

So my ideia is:
Consume Rest API from another system and make a GET request (Thats include the authentication of the another system).
I don't know which exactly code the apex accept, so I'm totaly lost.
if someone can help me, telling me the steps I need to do and some GET code for example that include authentication, will help me a lot.

Someone can help me with this issue?

Best Regards
Rafael
I have the following controller extetion which works to make a pdf as attachment, but need some help writing a testclass for so far i have the following:
 
public with sharing class attachPDF {
private final Facturatie__c a;
    public attachPDF(ApexPages.StandardController standardPageController) {
        a = (Facturatie__c)standardPageController.getRecord(); //instantiate the Facturatie__c object for the current record  
    }    
    Facturatie__c  currentRecord = [SELECT Id, Accountname__r.Name FROM Facturatie__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    
    public PageReference attachPDF() {
        PageReference pdfPage = Page.Factuur2PDF;
        pdfPage.getParameters().put('id',a.id);
        Blob pdfBlob = pdfPage.getContent();
        
        Attachment attach = new Attachment(parentId = a.Id, Name = 'Factuur ' + '-' + currentRecord.Accountname__r.Name +'-'+ date.today().format() +'.pdf', body = pdfBlob); //create the attachment object
        insert attach;
        PageReference pageWhereWeWantToGo = new ApexPages.StandardController(a).view();
        pageWhereWeWantToGo.setRedirect(true);
        return pageWhereWeWantToGo;
    }
}
 
@isTest(seeAllData=true) 
public class attachPDFTestClass {

static testMethod void testAttachments() { 
    Facturatie__c a = new Facturatie__c(Facturatie__c.Accountname__r.Name='Test');
    insert a; 

    Attachment attach=new Attachment(); 
    attach.Name='Unit Test Attachment'; 
    Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); 
    attach.body=bodyBlob; attach.parentId=a.id;
    insert attach;

    List<Attachment> attachments=[select id, name from Attachment where parent.id=:a.id]; 
    System.assertEquals(1, attachments.size()); 

    Test.StartTest();
    FeedItem f = new FeedItem();
        f.ParentId = a.id;
        f.body = 'test';
        insert f;
        FeedComment fc = new FeedComment();
        fc.CommentBody = 'legal test';
        fc.FeedItemId = f.Id;
        insert fc;
        Test.StopTest();
        System.assertEquals ('legal test', fc.commentbody); 
    }
}

I get the error invalid field initializer
I have created a VF Page of an opportunity list view. One of the fields is Opportunity Name. When you click the name it opens the record in the VFPage. Can I modify the code to open a new tab when the opportunity is clicked? 

<apex:page sidebar="false">
 
   <apex:enhancedlist height="450" listid="00Be0000001eBaB" rowsperpage="100">;
    
</apex:enhancedlist></apex:page>
Hi All
I have searched for multiple post to find an answer for this common error but I am not sure what mistake I am commiting.. All I need to do query a local list and add ID's to a SET so that I dont execute multiple SOQL's. Appreciate your help on this

My CODE
I am using "Execute Highlight" option to see if my code works and it breaks in line 7
Line: 7, Column: 18
Initial term of field expression must be a concrete SObject: List<Allocation__c>
 
List <Allocation__C> lst =  new List <Allocation__c>();
lst = [Select  Percentage__c, Line_of_Business__c, Support_Contract__c
                          from Allocation__C WHERE Percentage__c = 50 LIMIT 1 ];
Set<ID> supConID = new Set<ID>(); --IS THIS THE CORRECT DATA STRUCTURE
for(Allocation__C al :lst) -- THIS IS WHERE THE ERROR HAPPENS, 
{
    supConID.Add(lst.Support_Contract__c);
}
List <Request__C> req = new List <Request__c>();
req = [Select ID, LOB_Allocations__c 
                         FROM Request__c WHERE ID IN (Select  Support_Contract__c
                          from Allocation__C WHERE Percentage__c = 50)];


List <Allocation__C> alloc = new <Allocation__c>();
List <Request__C> reqUpdate = new <Request__C>();
for(Request__C r: req)
{
    string lobstring = '';
    Request__c rtemp = new Request__c();
    for(Allocation__c a: [select Line_of_Business__c, Percentage__c FROM lst WHERE Support_Contract__c = :r.ID])
    {
        lobstring += (lobstring ==''?'':' / ')+a.Line_of_Business__c+'('+  a.Percentage__c + '%)';
    }
    rtemp.ID = r.ID;
    rtemp.LOB_Allocations__c = lobstring;
    reqUpdate.Add(rtemp);
    
}
update reqUpdate;
/*List<Request__C, string> fnl = new List<Request__c , string>;
for ( Allocation__C ac :lst)
{
    ac.Allocation_Notes__c = ac.Allocation_Notes__c;
    update ac;
}*/
Hi ,

my requirement is to merge account records with same name . after merge i will store the deleted record value in another object  . the deleted record which will store in new object will have the id of the master record of account to which it is merged . 
can someone share with me step by step as to how i would add a custome button to be able to export a single case. my customers want copies and wanted to be able to export them to word or pdf so i can email them to them
Hello,

It is really helpful if someone clarifies below scenario:

1. Can we edit standard salesforce report.
2. Can we add bucket filter, field filter in standard report?

As per my understanding while we try to edit a standard report using customize button it will give us option to save the report in another name that is the clone of the standard report(we can refer it as custom report also) and the customization is not saved in the standard report. Please correct me if I am wrong.

Hence is there any another way to edit standard report.

Thanks
Preyanka