• RDN_LHR
  • NEWBIE
  • 25 Points
  • Member since 2005

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 35
    Questions
  • 46
    Replies

Hi,

 

I'm trying to render the field "Opportunity__c" only when the user changes the Lead.status to "Part of an Existing Opportunity."  I have a feeling that I'm close, after trying to adapt the examples in the documentation but there's still something not right.

 

Hopefully this is easy for someone to point out?

 

Thanks ....

 

<apex:page standardController="Lead" extensions="leadConverter2">
<apex:form >
  <apex:pageBlock title="Fill in the following">
   <apex:pageBlockSection columns="2">
     <apex:outputField value="{!lead.id}"/>
     <apex:outputField value="{!lead.name}"/>
       <apex:actionRegion>
          <apex:inputField required="true" id="ls" value="{!lead.status}">
            <apex:actionsupport event="onchange" rerender="opp" />
          </apex:inputField>
       </apex:actionRegion>


   <apex:outputPanel id="opp">
      <apex:inputField rendered="{!lead.status == 'Part of an Existing Opportunity'}" required="true" value="{!lead.Opportunity__c}"/>
   </apex:outputPanel>
  </apex:pageBlockSection>      

  <apex:pageBlockButtons location="bottom">
     <apex:commandButton value="Submit" action="{!convertLeadNoOpp_2}"/>
  </apex:pageBlockButtons>
  </apex:pageBlock>

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

 

Hi,

 

We have a new business rule in place that says that whoever closes a case should become the owner of that case if he isn't already.  If there are cases in a queue that are the result of spam for instance, a rep can simply close it rather than taking ownership first, then closing it.  I accomplish this using an update trigger on Case.

 

The only trouble is that when this trigger fires, an email also fires to the rep letting him know that he's been assigned a case.  He already knows ... he's basically assigned the case to himself.  So now reps get loads of email every time they do this.

 

In the Setup under Support Settings, the checkbox for "Use this setting to automatically select the Send Notification Email checkbox on cases when users change a case owner to another user" is unchecked.  The option for Case Assigned Template is blank.

 

Is there anything I should be putting in the trigger to supress the assignment email?

 

The trigger:

trigger updateCloseCase on Case (before update) { for (Integer i = 0; i < Trigger.new.size(); i++) { if (Trigger.new[i].Status == 'Closed' && Trigger.old[i].Status != 'Closed')

 

{ Trigger.new[i].OwnerId = UserInfo.getUserId() ; } } }

 

The funny thing is that I also have a button on cases called "Take Ownership" which allows a user to quickly change case ownership to himself and that doesn't cause any email to fire, but the trigger above does.

 

Can anyone shed some light on this?

public class emailController { List<EmailMessage> emails = [select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0'

and (Parent.IsClosed = false or emailMessage.CreatedDate > Parent.ClosedDate) order by Parent.IsClosed asc, messagedate desc ]; public List<EmailMessage> getEmails() { return emails; } }

 

The above class works nicely without the red addition, but when I add this additional part I get an error "unexpected token: 'Parent.ClosedDate".

 

What is wrong with comparing one date to another date?  If I compare either date to something like "LAST_WEEK" then the query will work, but not to each other.

 

How can I accomplish comparing these dates against each other in the WHERE clause just like I would in regular SQL?

 

Much appreciated!

Hi,

 

I've created a simple Visualforce page and a simple controller.  I've created a Web tab and pointed it at the page's url.  Clicking on the tab simply gives a list of our org's unread emails related to Cases.   Most times it takes over 30 seconds to load and render, even though it's only returning 20 or so rows at any given time.

 

 

The page:

 

<apex:page controller="emailController" tabstyle="emailmessage" sidebar="true"> <apex:pageBlock > <apex:pageBlockTable value="{!emails}" var="m"> <apex:column headerValue="Case" value="{!m.ParentId}"/> <apex:column headerValue="Closed" value="{!m.Parent.IsClosed}"/> <apex:column headerValue="Received" value="{!m.messagedate}"/> <apex:column headerValue="Owner" value="{!m.Parent.Owner.Name}"/> <apex:column value="{!m.fromaddress}"/> <apex:column value="{!m.toaddress}"/> <apex:column value="{!m.subject}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

 

The controller:

 

 

public class emailController { List<EmailMessage> emails = [select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0' order by Parent.IsClosed asc, messagedate desc ]; public List<EmailMessage> getEmails() { return emails; } }

 

What could possibly be causing a 30-second delay on this?  I'm not saying that Salesforce.com performs that fantastically in the best of times for those of us on European instances, but 30 seconds for such a simple page is a little bit absurd. 

 

Any input is greatly appreciated!!

I want to do the following query to find unread EmailMessage records related either to (1) open cases or (2) related to cases that were already closed when the EmailMessage record was created.

 

I would think it would be:

 

select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0' and (Parent.IsClosed = false or emailMessage.CreatedDate > Parent.ClosedDate)

 

I get "unexpected token: 'Parent.ClosedDate'"

 

Can I not compare one date to another using "greater-than"?

 

If I replace either Parent.ClosedDate or emailMessage.CreatedDate with something like LAST_WEEK then the query works but not comparing to each other.

 

Any help is appreciated!!

Message Edited by RDN_LHR on 06-08-2009 09:27 AM

I currently have a "before delete" trigger on OpportunityLineItem which stops line item records from being deleted if certain conditions are met.

 

Is there a way use an if to say that if the delete call is coming from the API or is due to a delete on the parent Opportunity record, to ignore the steps in the trigger?  I'd only want the steps to execute if the trigger is called from a line item delete via the UI.

 

I thought I read this once somewhere, but after all my searching, I can't seem to find it. 

 

Anybody know?

 

Thanks!!

Hi,

 

I'm getting frustrated with governor limits on triggers.  I've taken all the correct steps as per the documentation (except the "helper class" one) and it's not a case anymore of coding correctly.  It's now just a case of having a lot of data in the system.

 

In the "Force.com Cookbook" the chapter called "Avoiding Apex Governor Limits" has a beautiful example that I would like to use almost exactly as it is.  In the example, whenever an address changes on an account, a trigger updates the address onto all the contacts.

 

Now this is wonderful if you don't have too many contacts, if you only sell to small companies.  If you sell to large companies as we do and we have hundreds of sales and service contacts in a company, such a trigger will most likely hit governor limits no matter what you do.

 

What good would such a trigger be if it could only update, say, the first 100 contacts out of 500 and leave the other 400 unmodified?

 

What other magic tricks have you guys done when you've found yourself in similar situations?  Do you just say, oh well, triggers can't help us or are there some really clever ways I've not thought of?

 

I hope I can get a couple of clever tips from the experts. 

Hi,

 

I'm experimenting with putting my own Visualforce page in for Opportunity Line Items related list.

 

To start with, I have this:

 

<apex:page standardController="Opportunity"> <apex:pageBlock > <apex:pageBlockTable value="{!Opportunity.OpportunityLineItems}" var="oli"> <apex:column value="{!oli.Quantity}"/> <apex:column value="{!oli.ListPrice}"/> <apex:column value="{!oli.TotalPrice}"/> <apex:column value="{!oli.Sale_Type__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

I also want the first column "Action" in there as well, so that I can present the "Edit | Del" hyperlinks, slightly modified for my purposes, but still retaining the Salesforce.com look.

 

How do I put that into the markup above?  I get the feeling that it's not something I can easily put into a pageBlockTable.  If not, where (or how) do I put it in?

 

Also, my next problem is how to get the pageBlockButtons section in so that it refers to the OpportunityLineItems methods (whatever they actually are??? I can't seem to find standard controller methods anywhere in documentation).

 

Thanks! 

Message Edited by RDN_LHR on 04-09-2009 03:57 AM
 
Hi,

 

I would like to mimic a bit of Salesforce behavior in a Visualforce Page I'm creating.

 

Examples: When you're on a Contact page and you click New Task, the contact's detail is filled in for you.  When you're on an Opportunity page and you click New Task, the opportunity's detail gets placed in the Related To box for you.  There are countless examples of this behavior all over Salesforce

 

I have a custom object called Trial.  It has lookup fields called Campaign, Contact and Opportunity which I'm putting on my custom Visualforce Page which represents a wizard's "Step 1." 

 

I'll add a custom button on Campaign, Contact and Opportunity called "New Trial" which will call this page and pass parameters to it off the record it's being called from.

 

On the page, I've got the three fields as  <apex:inputField>.   How do I get values in those fields the same way Salesforce does?

Has anyone used DatabaseDMLOptions?

 

When creating a case via a visualforce page with standard and extension controller, I would like the default assignment rule to fire.

 

I cut and paste the following out of the documentation as shown here:

 

 DatabaseDMLOptions dmo = new Database.DMLOptions();

 dmo.assignmentRuleHeader.useDefaultRule= true;

 

and pasted it in my code as  :

 

 

DatabaseDMLOptions dmo = new Database.DMLOptions();

dmo.assignmentRuleHeader.useDefaultRule= true; 

 

Case c = new Case();

 

c.SuppliedName = 'myName';

c.SuppliedEmail = 'my@emailaddy.com';

c.SuppliedCompany = 'myCompany';

 

c.setOptions(dmo);

 

insert c;

 

---

 

When I try to save this version of the code in Eclipse, it moans about the second line, with the following: "Save error: unexpected token: dmo.assignmentRuleHeader.useDefaultRule".

 

So then I checked the class itself, and it is saved against API version 15.  I can't see how I've done anything wrong since I cut and pasted the thing exactly as in the documentation.

Message Edited by RDN_LHR on 03-02-2009 06:35 AM

I'm putting together a Visualforce page which is an edit mode page that collects some inputFields and creates a case.

 

I've gone the route of creating a controller and I've realised that I prefer the ease and benefits of the standard Case controller.

 

I have five or so fields that I want to hardcode values into and a few more that I'd like to populate with things like {!$CurrentPage.parameters.xxx} and {!$User.FirstName} {!$User.LastName}. 

 

I'd have thought from my light experience with S-Controls, that there'd be an easy way to assign these values to object fields directly in the page markup.  If there is some way, I'm missing it in all my reading.  All the examples I see of parameters and such are for getting them, not using them to set values.

 

So if you want to get these values values and write them to the object on Save, am I looking at only creating my own controller?  or maybe creating a controller extension?  If it's the latter, I can't seem to find good samples that speak to that either.

 

Can someone give me a fairly short answer to this?  Thanks!!

I've got two fields side by side, both picklists.  One is a regular Salesforce picklist field, the second is a picklist I'm explicitly tagging so that I can restrict further the values that will eventually be placed in the underlying field on this particular page.

 

I want them to behave exactly the same:  both have a title, both be required, both default to "-None-" option (which errors when left on -None-).  All of this happens with the first field, and none of it with the second: no title, no red mark for required, no enforcement of the required propertly.

 

I've put this:

 

<apex: pageBlockSection id="Section1" columns="2">

 

  <apex:inputField value="{!PSCase.Route_To__c}" required="true"/>

 

 

  <apex:selectList size="1" title="Setup Type" value="{!PSCase.Reason}" required="true"

     <apex:selectOption itemLabel="-None-"/>

     <apex:selectOption itemValue="Trial Setup" itemLabel="Trial"/>

     <apex:selectOption itemValue="Subscription Setup" itemLabel="Subscription"/>

  </apex:selectList>

 

</apex: pageBlockSection>

Message Edited by RDN_LHR on 02-26-2009 05:05 AM

How do I mimic the usual Page Layout section behavior where you can say a section is one column wide and have your field fill the whole column?

 

I've been playing with the number of columns as below, setting it to all sorts of numbers.  Setting columns="1"  shoves the field off to the left and leaves the entire right of the pageBlockSection wastefully blank.

 

<apex:pageBlockSection title="Users" columns="1">

<apex:inputField id="descr" value="{!Case.'Description}"/>

 

What am I missing?

Hi,

 

This is my first seriouis Visualforce page and I have what I think is a simple question.  This page takes user input for a custom controller and creates a new Case.

 

We've been using Case.CurrencyIsoCode in our Case Assignment rules for years.  For these particular cases, the user can have a say in how they are assigned. 

 

I could use <apex:inputField value="{!PSCase.CurrencyIsoCode}"/>

 

This would put the currency field out there and its picklist choices very nicely.  I think it would be more elegant to hide that and use something like:

 

<SELECT NAME="location" ID="R2CSI">

 <OPTION VALUE=" ">--None--

<OPTION VALUE="GBP">London

<OPTION VALUE="USD">New York 

<OPTION VALUE="AED">Dubai</OPTION>

 

... and then just be able to pass the selected picklist value off to ="{!PSCase.CurrencyIsoCode}"  easily enough by combining it with a visualforce page tag.

 

Am I far off the mark here?

 

Thanks

Hi,

 

I have a situation where for a certain Opportunity Record Type, I would like to restrict the ability to delete products.  I can't find any way to do this through the UI.

 

Am I missing something?  If so, is there a APEX way around this?  Can you use an On Delete trigger for OpportunityLineItem that stops the delete?

 

Thanks

Hi,

 

I have a custom field on my Account object called CSR__c for a Customer Service Rep which is related to User.  If I want two emails, one for the CSR__c and one for the Account Owner, I do something like this to get what I need:

 

    select Id, Name, Owner.Email, CSR__r.Email from Account where  ...

 

 

However, today, I would like to select this information about a Contact's Account in one statement.  I would really love to be able to write:

 

      select Id, Firstname, Lastname, Account.Owner.Email, Account.CSR__r.Email from Contact where ....

 

 

 

Is this possible to write somehow, using one query?  Am I close at least?

 

Thanks!!

Message Edited by RDN_LHR on 01-22-2009 10:21 AM
Hi,
 
I would like to automatically assign certain records to their Account Owners on insert.  In this particular version,
I am trying to do this only when the Owner has IsActive=true in the User table.  I'm guess that while this SOQL statement is ok in real life, it doesn't work in a map.
 
 
 
Map<Id, Account> accMap = new Map<Id, Account>([select Id, OwnerId, Owner.isActive
            from Account where Id in :accSet]);
           
     
for ( Contact loopContact : Trigger.new )
 {
    
 if (accMap.get(loopContact.AccountId).isActive = true)
  { 
      loopContact.OwnerId = accMap.get(loopContact.AccountId).OwnerId;
  } 
 
    else {
 
       // do something else
  }
This trigger adds a few values to an account from its parent account.  When there is no ParentId, it should put the information about itself in the same fields.
 
When updating an Account, this works as it should -- if ParentId == null, do one thing, otherwise do the other thing.  When inserting an account, it only works if there is a ParentId.  If ParentId == null, it just does nothing.
 
Why would it work differently on insert than update?  If it works differently, why does the "else" portion still evaluate properly and work as expected, but do nothing when evaluating the "if" portion?
 
 
trigger accountSetUltimateParent on Account (before insert,  before update) {
// Sets custom account fields by fetching values from the parent account


Set<Id>  ParAccSet = new Set<Id>();

 for ( Account acct : Trigger.new ) 
  {
  ParAccSet.add(acct.ParentId);
  }
 

Map<Id, Account> ParAccMap = New Map<Id, Account>([select Id, ParentId, Custom_Account_ID__c,SF_Account_ID_of_Parent__c,
      Global_Tiering__c,Parent_Account_Location__c, Country_Picklist__c,State__c
      from Account where Id in : ParAccSet]);


 for ( Account acct : Trigger.new ) 
  {

   
  if (acct.ParentId == null)     
    { 
      acct.Ultimate_Parent_Id__c = acct.Id;
      acct.SF_Account_ID_of_Parent__c = acct.Custom_Account_ID__c;
      if(acct.Country_Picklist__c == 'United States') 
             {acct.Parent_Account_Location__c = acct.State__c;}
      else 
             {acct.Parent_Account_Location__c = acct.Country_Picklist__c;}     
    }
  
  
  else
    {
      acct.Ultimate_Parent_Id__c = ParAccMap.get(acct.ParentId).Id;
      acct.SF_Account_ID_of_Parent__c = ParAccMap.get(acct.ParentId).Custom_Account_ID__c;
      if(ParAccMap.get(acct.ParentId).Country_Picklist__c == 'United States') 
             {acct.Parent_Account_Location__c = ParAccMap.get(acct.ParentId).State__c;}
        else {acct.Parent_Account_Location__c = ParAccMap.get(acct.ParentId).Country_Picklist__c;}
      acct.Global_Tiering__c = ParAccMap.get(acct.ParentId).Global_Tiering__c;
    }
  }
}


Message Edited by RDN_LHR on 12-09-2008 07:31 AM
 
 
I've written the trigger that I'm including below. 
 
The trigger looks for when an account owner has been changed, and then calls up the related contacts and assigns the new account owner as the owner of all contacts.
 
 
trigger accountUpdateContactOwner on Account (after update) {

// first Id is Account.Id, second Id is Account.OwnerId

Map<Id, Id> AcctOwners = new Map<Id, Id>();
// loop through and for each account, put its Id and its OwnerId in the map                 
 for (Integer i = 0; i < Trigger.new.size(); i++)
 {
  if (Trigger.old[i].OwnerId != Trigger.new[i].OwnerId ) {
   AcctOwners.put(Trigger.new[i].Id,Trigger.new[i].OwnerId);
  }
 
 }

// for each account in the map, find the contacts and loop through them to 
// reassign the OwnerId
 for (Contact updContact : [select Id, AccountId, OwnerId from Contact
       where AccountId in :AcctOwners.keyset() limit  999 ])
 {
    updContact.OwnerId = AcctOwners.get(updContact.AccountId);
  
 }          
    

}

 
The problem is that I tested it to death before deploying it to production.  If the trigger just didn't work at all, I woudln't think it strange.  The fact that it only works for certain accounts and not for others, and only in production, is really baffling.
 
Sadly, I asked Salesforce.com for support, and while they did look at and test my code, they refused to support me and told me I'd have to use discussion boards instead.
 
The process:  Wrote it in development org, wrote unit test, got 100% coverage.  Began tests.  Loaded thousands of test accounts and contacts.  Assigned 2000 contacts to an account, used the UI to make changes, trigger ran, all changes made beautifully.  Did the same, but assigned one contact to 2000 accounts, changed owner through the UI (250 at a time), they all worked.  Repeated the tests through the Data Loader.  Got errors due to limits.  Reworked the code to its present form above, re-ran lots of Data Loader tests mirroring what I'd done through the UI and they all worked wonderfully.
 
I deployed the code to Production and it seemed to work there, but after watching it for a couple days using reports, I found that the trigger was firing only sometimes.
 
I put a ticket in with Salesforce.com support so they can explain why triggers only fire sometimes.  I thought either they work or they don't work, right??  I gave them two account examples to try.  The first example had 10 contacts and the trigger works.  The second example had one contact which didn't work.  Then I found about 1000 other examples, most but not all were modified through the data loader.  I thought it was just for large accounts with lots of contacts maybe hitting a limit or something, but most of these accounts had one or two contacts.
 
 
How do things work so nicely in development, but not work in production?




Message Edited by RDN_LHR on 12-09-2008 02:37 AM

Message Edited by RDN_LHR on 12-09-2008 02:40 AM

Message Edited by RDN_LHR on 12-09-2008 02:44 AM

Message Edited by RDN_LHR on 12-10-2008 09:12 AM
Hi,
 
I've got the following trigger which simply puts the Account.OwnerId in as the Contact.OwnerId before insert.  When I convert a lead, the trigger doesn't work -- but only in Production.  When I do this in a Development instance, it does work. 
 
Why would this be?  It is the only "before insert" trigger that I have on Contact.  The only other trigger I have is a "before update" one.  I've got no triggers on Lead.  I find it very strange!!
 
Thanks!!
 

 

trigger contactInsertOwner on Contact (before insert) {

Set<Id> accSet = new Set<Id>();

     for ( Contact newContact : Trigger.new )

     {

          accSet.add(newContact.AccountId);

     }

Map<Id, Account> accMap = new Map<Id, Account>([select Id, OwnerId

                                   from Account where Id in :accSet]);

        for ( Contact updContact : Trigger.new )

         {

              updContact.OwnerId = accMap.get(updContact.AccountId).OwnerId;

          }

}

public class emailController { List<EmailMessage> emails = [select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0'

and (Parent.IsClosed = false or emailMessage.CreatedDate > Parent.ClosedDate) order by Parent.IsClosed asc, messagedate desc ]; public List<EmailMessage> getEmails() { return emails; } }

 

The above class works nicely without the red addition, but when I add this additional part I get an error "unexpected token: 'Parent.ClosedDate".

 

What is wrong with comparing one date to another date?  If I compare either date to something like "LAST_WEEK" then the query will work, but not to each other.

 

How can I accomplish comparing these dates against each other in the WHERE clause just like I would in regular SQL?

 

Much appreciated!

Hi,

 

I've created a simple Visualforce page and a simple controller.  I've created a Web tab and pointed it at the page's url.  Clicking on the tab simply gives a list of our org's unread emails related to Cases.   Most times it takes over 30 seconds to load and render, even though it's only returning 20 or so rows at any given time.

 

 

The page:

 

<apex:page controller="emailController" tabstyle="emailmessage" sidebar="true"> <apex:pageBlock > <apex:pageBlockTable value="{!emails}" var="m"> <apex:column headerValue="Case" value="{!m.ParentId}"/> <apex:column headerValue="Closed" value="{!m.Parent.IsClosed}"/> <apex:column headerValue="Received" value="{!m.messagedate}"/> <apex:column headerValue="Owner" value="{!m.Parent.Owner.Name}"/> <apex:column value="{!m.fromaddress}"/> <apex:column value="{!m.toaddress}"/> <apex:column value="{!m.subject}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

 

The controller:

 

 

public class emailController { List<EmailMessage> emails = [select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0' order by Parent.IsClosed asc, messagedate desc ]; public List<EmailMessage> getEmails() { return emails; } }

 

What could possibly be causing a 30-second delay on this?  I'm not saying that Salesforce.com performs that fantastically in the best of times for those of us on European instances, but 30 seconds for such a simple page is a little bit absurd. 

 

Any input is greatly appreciated!!

I want to do the following query to find unread EmailMessage records related either to (1) open cases or (2) related to cases that were already closed when the EmailMessage record was created.

 

I would think it would be:

 

select id,ParentId, Parent.Owner.Name,Parent.IsClosed, Parent.ClosedDate,status,fromaddress,toaddress,messagedate,subject from emailMessage where status ='0' and (Parent.IsClosed = false or emailMessage.CreatedDate > Parent.ClosedDate)

 

I get "unexpected token: 'Parent.ClosedDate'"

 

Can I not compare one date to another using "greater-than"?

 

If I replace either Parent.ClosedDate or emailMessage.CreatedDate with something like LAST_WEEK then the query works but not comparing to each other.

 

Any help is appreciated!!

Message Edited by RDN_LHR on 06-08-2009 09:27 AM

Hi,

 

I'm getting frustrated with governor limits on triggers.  I've taken all the correct steps as per the documentation (except the "helper class" one) and it's not a case anymore of coding correctly.  It's now just a case of having a lot of data in the system.

 

In the "Force.com Cookbook" the chapter called "Avoiding Apex Governor Limits" has a beautiful example that I would like to use almost exactly as it is.  In the example, whenever an address changes on an account, a trigger updates the address onto all the contacts.

 

Now this is wonderful if you don't have too many contacts, if you only sell to small companies.  If you sell to large companies as we do and we have hundreds of sales and service contacts in a company, such a trigger will most likely hit governor limits no matter what you do.

 

What good would such a trigger be if it could only update, say, the first 100 contacts out of 500 and leave the other 400 unmodified?

 

What other magic tricks have you guys done when you've found yourself in similar situations?  Do you just say, oh well, triggers can't help us or are there some really clever ways I've not thought of?

 

I hope I can get a couple of clever tips from the experts. 

Hi,

 

I'm experimenting with putting my own Visualforce page in for Opportunity Line Items related list.

 

To start with, I have this:

 

<apex:page standardController="Opportunity"> <apex:pageBlock > <apex:pageBlockTable value="{!Opportunity.OpportunityLineItems}" var="oli"> <apex:column value="{!oli.Quantity}"/> <apex:column value="{!oli.ListPrice}"/> <apex:column value="{!oli.TotalPrice}"/> <apex:column value="{!oli.Sale_Type__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

 

I also want the first column "Action" in there as well, so that I can present the "Edit | Del" hyperlinks, slightly modified for my purposes, but still retaining the Salesforce.com look.

 

How do I put that into the markup above?  I get the feeling that it's not something I can easily put into a pageBlockTable.  If not, where (or how) do I put it in?

 

Also, my next problem is how to get the pageBlockButtons section in so that it refers to the OpportunityLineItems methods (whatever they actually are??? I can't seem to find standard controller methods anywhere in documentation).

 

Thanks! 

Message Edited by RDN_LHR on 04-09-2009 03:57 AM

I have created custom case page overriding standard functionality through controller extension

 

and I want to fire assignment rule conditionally

 

my code is here

 **************************************************

public class caseextension
{
private  Case case1;
public boolean assrulevalue;
public caseextension(ApexPages.StandardController stdController)
{
this.case1= (Case)stdController.getRecord();


}
public PageReference save()
{

AssignmentRule assgn=[Select Name, Id From AssignmentRule  where name='Testassign'];
string id=assgn.id;
if(assrulevalue==true)
{
database.DMLOptions dmo = new database.DMLOptions();
dmo.AssignmentRuleHeader.assignmentRuleId=id;
 dmo.AssignmentRuleHeader.useDefaultRule= false;
case1.setOptions(dmo);
   //mailerror('testing');
}
//mailerror('testing'+id);

 insert case1;
//database.insert(case1, dmo);
PageReference pageRef = new PageReference('/' + case1.id);
pageRef.setRedirect(true);
return pageRef;

}

public boolean getassrule()
{
    return assrulevalue;
}
public void setassrule(boolean value)
{
    assrulevalue=value;
}

**********************************************************

 

So what wrong with this code.