• michaellatideas
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 20
    Replies

Hi,

 

I've been working through some SOQL queries, as I'm trying to determine how many open Tasks are attached to our cases.

 

So I've got a SOQL query like this as part of a batchable class:

 

Select l.Id, l.Open_Tasks__c, l.CaseNumber, (Select Id, WhatID, IsClosed From Tasks t where t.IsClosed = False and t.IsDeleted = False) From Case l

 

In this case, if I don't filter out the deleted tasks, it is being returned in the result.

 

I've got another variation where I don't seem to need to include the filter, where I've built a set of case IDs at the beginning:

 

Select l.Id, l.Open_Tasks__c,
            (Select Id From Tasks where IsClosed = False)
            From Case l where Id in :CaseIDs

 

[This logic is done in an Apex trigger]

 

I'm not sure what I'm missing something here -- and I'm getting the results that I expect now if I include the IsDeleted filter (in both cases) -- but I'm wondering what causes the difference in the results as I find it a bit odd.

 

Hi,

 

I'm wondering if there is any way to determine what Dashboard a Dashboard Visualforce Page is on as part of the dashboard.

 

If I try something that looks at document.location.href, I get something on *.visual.force.com -- and it is referring to the specific visualforce page, and not the dashboard that is "hosting" the visualforce page.  Where what I'd like is the URL of the actual dashboard.

 

Does anyone have any suggestions?

 

Thanks,

Michael

 

I'm working with the Inline Account Hierarchy App, and love the idea.

 

However, one thing that I'm struggling with is that we want to add some additional fields to the display.  This is easy, with a little bit of Apex and VF.  However,  what I'd really like to do is get it so we have a table view instead so columns line up.

 

Perhaps I just want to get rid of the tree view piece and just entirely replace it -- but any way to drop things into columns that line up would be ideal.

 

Anyone have any ideas here?

 

Hopefully this is an easy question.  I'd rather not have to dive into and code something at the Apex level for this.

 

I'd like to be able to output a string into a fixed width field when I use apex:outputText

 

I'd like to output it and say that if the string I'm outputting is less than a specific width, it should be padded out enough to match that width.

 

I can't really use a table in this case, unfortunately.

 

Any good ideas?

Hi,

Has anyone successfully deployed the Salesforce Labs Time-Off Manager application?  I've got it deployed, but the Team Calendar s-controls aren't working for me.  It's probably not a browser thing, since it isn't working both on Firefox and IE.

I'm also a little confused about the Employee Number on the "My Time Off Balance" -- I'm seeing one of the numbers filled in, but not the other one.

We're hoping to be able to get this into place for 1/1/2009, so we're hoping to get this working quick!

Thanks,
Michael
Hi,

I've been working on this off and on for a while in one way or another, and perhaps this approach will get me closer.

I'd like to link to the standard new/edit page for a brand new object for a record type.  I've got the record type.  I don't have a new record yet, and it certainly hasn't been written to the database -- and because of this, there isn't a record id, so urlFor($Action.Foo__c.New, Foo__c.id,NULL,true) wouldn't work -- because there isn't an id.

Any ideas how I might be able to do this?

Thanks,
Michael
Hi,

I'm getting a chance to do my first major Visualforce exercise.  I've got a custom object that has several record types.  I've got a custom controller and visual force page that is designed for when you create a new instance of one particular record type.

What I'd like to know if there's any way to capture it so I can go to that VisualForce page when that record type is selected when creating a new record.  I can get the visual force page to replace the tab content, but that's not really what I want to do -- I'm only interested in going to the Visualforce page when a new record is created of that record type.

Any suggestions?

Thanks,
Michael Lee
michael.lee@ideas.com

Hi All,

 

I have a requirement to show # of open Task on Lead Detailpage. Below is the logic that we are planning to implement. I would like tocheck with you if any one has implemented similar functionality handling BULK insert/update.If so could you please share the code?

 

Trigger on Task <after insert after update>

 

{

    for (Task thistask : Trigger.new)

      {

    // Get all leads assosited to Tasks

    if (WhoId.startsWith('00Q'))               

      leadIdToUpdateList.add(taskWhoId.WhoId);

     }

 

FOR each Lead

           SelectCount() from Task where whoId=LeadId and Status=Completed

           Updatecustom field “ Open Task” on  Lead object

End Loop   

 

}

 

Thank You . 

Has anyone had any luck creating a formula field that calculates the difference between two dates but does not include weekends in the calculation?  I have searched and did find one example, however, it does not work for every date... It has to do with the rounding... This is what I have so far:

 

 

IF(AND(MOD( Date_Released_to_Sales__c -DATE(1900,1,7),7)< (Date_Released_to_Sales__c- Date_to_U_W__c), ((Date_Released_to_Sales__c- Date_to_U_W__c)<7)),((Date_Released_to_Sales__c- Date_to_U_W__c)-2), ((Date_Released_to_Sales__c- Date_to_U_W__c)-(2 * ((Date_Released_to_Sales__c- Date_to_U_W__c)/7))))

 

 In some instances, however, the timeframe is off a day.  I think it has to do with the rounding of the calculation of

((Date_Released_to_Sales__c- Date_to_U_W__c)-(2 * ((Date_Released_to_Sales__c- Date_to_U_W__c)/7))))

 

I thought I might need to use ceiling but that did not solve the problem either....

 

Any help would be greatly appreciated!!

 

Fred


 

  • October 14, 2009
  • Like
  • 0

Hopefully this is an easy question.  I'd rather not have to dive into and code something at the Apex level for this.

 

I'd like to be able to output a string into a fixed width field when I use apex:outputText

 

I'd like to output it and say that if the string I'm outputting is less than a specific width, it should be padded out enough to match that width.

 

I can't really use a table in this case, unfortunately.

 

Any good ideas?

Hi,

Has anyone successfully deployed the Salesforce Labs Time-Off Manager application?  I've got it deployed, but the Team Calendar s-controls aren't working for me.  It's probably not a browser thing, since it isn't working both on Firefox and IE.

I'm also a little confused about the Employee Number on the "My Time Off Balance" -- I'm seeing one of the numbers filled in, but not the other one.

We're hoping to be able to get this into place for 1/1/2009, so we're hoping to get this working quick!

Thanks,
Michael
Maybe I'm missing this and it's easy, but is there a way to globally replace the standard Account form throughout the application from any account link in other objects?

In other words, if I create my own custom VF account page, and I click the account link from an opportunity list, case list, contact form, etc. how do I automatically make all links to account detail forms go to my new VF page? OR do I have to replace any standard page in the application with a new VF page that will open it's account links to my new VF account form?
Hey community!
 
Easy question.
 
1. I have a visualforce page that is an edit page
2. I override both the edit and new standard buttons so that they go to this page.
 
Use Case
a) I am in the list view to show many records of my object
b) I click on the "New" standard button to create a new record, it goes to this page:
https://na2.salesforce.com/a05/e?retURL=%2Fa05%2Fo
c) I add data and click save.
d) PROBLEM: After the save it takes me to the list view, not the newly created records detail view.
 
I can see by the URL that the retURL will throw me back to the list view, not the detail view, but why this behavior? How do I override it if possible or account for it?
 
Thanks and do let me know if you need more clarity.
 
Appreciate in advance!
 
 


Message Edited by bev90210 on 10-09-2008 06:49 PM

Message Edited by bev90210 on 10-09-2008 06:50 PM
Hi,

I'm getting a chance to do my first major Visualforce exercise.  I've got a custom object that has several record types.  I've got a custom controller and visual force page that is designed for when you create a new instance of one particular record type.

What I'd like to know if there's any way to capture it so I can go to that VisualForce page when that record type is selected when creating a new record.  I can get the visual force page to replace the tab content, but that's not really what I want to do -- I'm only interested in going to the Visualforce page when a new record is created of that record type.

Any suggestions?

Thanks,
Michael Lee
michael.lee@ideas.com
Hi,
 
I need to override the standard edit page for a custom object. If the status of the custom object record is "Approved", then I do not want users to edit the record, else I need to redirect the users to the standard edit page for this record.
 
I have the following code in VF and controller. I can see the the URL is changed to the edit page URL when I click the edit button after overiding the button with the VF page, but the standard edit page is not getting displayed. Insatead the word Hello is getting displayed.
 
VF Code:
<apex:page standardController="Fixture_Order__c" extensions="conSEditOverrideFixtureOrder" 
id="mypage">
Hello
</apex:page>

 
Controller Code:
public class conSEditOverrideFixtureOrder {
Fixture_Order__c fixordobj; 

private String vid; 


public conSEditOverrideFixtureOrder(ApexPages.StandardController controller) { 

this.vid = ApexPages.currentPage().getParameters().get('id'); 
reset();

} 

public PageReference reset() { 

if(fixordobj.Approval_Status__c=='Approved'){
 PageReference editPage = new PageReference('/'+this.vid+'/e—retURL=' + this.vid);
 editPage.setRedirect(true);
 return editPage;
}else{
PageReference errPage = new PageReference('/apex/editFixtureOrderError');
 errPage.setRedirect(true);
 return errPage;
 
}

return null; 

} 

public String getApprovalStatus(){
 return this.fixordobj.Approval_Status__c;
}

public Fixture_Order__c getFixtureOrder() { 

if(fixordobj == null) reset(); 

return fixordobj; 

} 


public void setLead(Fixture_Order__c leaddet) { 

fixordobj = leaddet; 

} }

 

Can anyone please help to understand the cause? Appreciate all your valuable feedbacks.

Thanks and regards,
Ambili
  • September 02, 2008
  • Like
  • 0