• eliotstock2
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 19
    Replies

Hi there.

 

I have a couple of radio buttons and I want clicking either of them to result in the form submitting itself (for which I have a function that does some other stuff before submitting).

 

 

<apex:selectRadio value="{!mode}" layout="pageDirection" id="modeSelect" onChange="toggleMode()"> <apex:selectOption itemValue="oneByOne" id="oneByOneRadio" itemLabel="Enter hours for each volunteer individually"/> <apex:selectOption itemValue="splitTotal" id="splitTotalRadio" itemLabel="Split the following number of hours evenly among all volunteers:"/></apex:selectRadio>

 

With the event handlers like this, with an onChange on the selectRadio only and nothing on the selectOptions, this will work ok with Firefox but not with IE. IE only fires the onChange event *after* you click or tab away from the radio button you just checked. So this is no good.

 

What would work is if I could make that event handler an onClick instead of an onChange, and preferably put it on the selectOption tags rather than the selectRadio. IE does fire the onClick event when you expect. However this is not possible with Salesforce, as far as I can tell. If I use an onClick attribute in the VF like so:

 

<apex:selectOption itemValue="oneByOne" id="oneByOneRadio" onClick="toggleMode()" itemLabel="Enter hours for each volunteer individually"/>

 

 

 

is not rendered in the HTML at all:

 

 

<input type="radio" checked="checked" name="VolunteeringTeamEvent:form:j_id1:modeSelect" id="VolunteeringTeamEvent:form:j_id1:modeSelect:0" value="oneByOne" /><label for="VolunteeringTeamEvent:form:j_id1:modeSelect:0"> Enter hours for each volunteer individually</label>

 

 

 

 

Is this a bug?

 

Thanks in advance,

 

Eliot. 

 

 

 

Hi all.

 

I'm aware of the metadata API and understand how to use it from code external to Salesforce, in Java or C# for example. But what I really need is to use this API from within Apex code in a custom controller. I want to be able to set up some page layouts in the browser, then query the fields on them and whether they're required or not from within my Apex code.

 

I could generate a SOAP client for the metadata API in Apex code and use that, but I'd really like to aovid going outside just to get back in again. For a start, the tool under Setup that consumes a WSDL and generates an Apec class pukes on the metadata WSDL file (Error: Class name 'Metadata' already in use. Please edit WSDL to remove repeated names). So that already seems a bad approach.

 

Is there an internal way to access this API?

 

Thanks in advance,

 

Eliot Stock. 

Hi.

 

I need to load hundreds of accounts, enable them as partners for the partner portal, loads hundreds of contacts for them, and then enable the contacts as partner portal users, so they get our custom clone of the partner portal user license provisioned.

 

Can all this be done through the data loader. I read elsewhere in the forums that I can set isPartner on the accounts, but can I also do something similar for th Contacts/users? Do I just load Contacts or do I also have to load Users and connect them somehow?

 

Thanks in advance.

 

Eliot Stock.

Hi there.

 

I have a situation where I want to behave differently in Prod to the Sandbox. Is there anyway to tell programmatically which environment I'm executing in?

 

Thanks,

 

Eliot Stock.

Hi there.

 

ApexPages.currentPage().getParameters() returns a Map<String, String>. But I have an HTML select field on my page which accepts multiple values:

 

 

<select size="7" name="a0780000004jDTQAA2" multiple="true"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> </select>

 

Note that this is really plain old HTML in my VF page, not an <apex:inputField> tag. If I select two values in this field and submit the form, the browser will send both values. But in Apex code in my controller, I only have access to the first value (ie. it's Map<String, String>, not Map<String, List<String>>).How do I get access to what was really posted in the form submission?

 

Thanks.

Hi there.

 

I'm trying to build a tool for monitoring various records udring QA. Is there any way to query for an SObject knowing only its Id and not its type?

 

Thanks,

 

Eliot Stock.

Hi.

 

I have a parent to child subquery like this:

 

for (Parent__c parent : [ SELECT Parent_Field__c, (SELECT Id, Child_Field__c FROM Childs__r WHERE Id IN :childIds) FROM Parent__c]) { // Do something with parent.Parent_Field__c }

 

If I have one parent with two children, I expect this to get me two records back. My question is, how do I then refer to the children of the parent? None of these seem to work:

 

 

parent.Childs__r.Child_Field__c parent.Childs__c.Child_Field__c parent.Child__r.Child_Field__c parent.Child__c.Child_Field__c

 

 

Thanks,

 

Eliot Stock.

Hi there.

 

I have a messages tag in a VF page like this:

 

 

<apex:messages styleClass="error"/>

 

and I am then adding a message to the page in my controller. The resulting HTML has no CSS class attriubute:

 

 

 <ul>
<li> My error message. </li>
</ul>

 

The CSS class exists. It's in a stylesheet pulled in as a static resource. Am I using this incorrectly or does it just not work?

 

Thanks,

 

Eliot Stock.

 

Hi there,

 

I have a VF page with a table of fields on it that allows me to create mulitple custom objects at once. In a custom controller I iterate over the custom objects, set some more stuff on them, add them to a list and then call insert() on that list. Every other field on the object is saved except for the DateTime fields. Another page on which I create these objects one by one works. The unit test for by controller also works, which sets up thenew object instance programmatically.

 

Is this a known issue or a bug or am I doing something wrong?

 

Here's a cut-down version of the VF page:

 

 

<apex:page controller="AddLineItems" tabStyle="Opportunity" id="line_items_page" sidebar="false"> <apex:sectionHeader title="Add Line Items to Opportunity" /> <apex:messages /> <apex:form id="line_items_form"> <div id="ins"></div> <apex:dataTable value="{!LineItems}" var="lic" id="line_items_table" border="0" cellPadding="2" cellSpacing="2"> <apex:column > <apex:facet name="header">Start Time</apex:facet> <apex:inputField value="{!lic.Start_Time__c}" id="start_time"/> </apex:column> <apex:column > <apex:facet name="header">End Time</apex:facet> <apex:inputField value="{!lic.End_Time__c}" id="end_time" /> </apex:column> </apex:dataTable> <apex:commandButton value="Save" action="{!saveLineItems}"/> <apex:commandButton value="Cancel" onclick="window.history.back();"/> </apex:form> </apex:page>

 and here's the controller:

 

 

public class AddLineItems { private Id opportunityId; private static final Map<String, Schema.RecordTypeInfo> opportunityTypeMap = Opportunity.SObjectType.getDescribe().getRecordTypeInfosByName(); public static final Id subContractTypeId = opportunityTypeMap.get('Sub-Contract').RecordTypeId; private List<Line_Item__c> lineItems = new Line_Item__c[] { new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c()}; public AddLineItems() { this.opportunityId = ApexPages.currentPage().getParameters().get('opportunity_id'); System.assert(this.opportunityId != null, 'AddLineItems controller requires an opportunity_id' + ' parameter on the query string.'); } public Line_Item__c[] getLineItems() { return this.lineItems; } public PageReference cancelLineItems() { PageReference ref = new PageReference('/' + this.opportunityId); ref.setRedirect(true); return ref; } // 1 SOQL, 1 DML public PageReference saveLineItems() { Opportunity opp = [ SELECT RecordTypeId, Master_Contract__c FROM Opportunity WHERE Id = :this.opportunityId]; List<Line_Item__c> lineItemsToInsert = new List<Line_Item__c>(); for (Line_Item__c lineItem : this.lineItems) { // The type will be null for a row in the table that's not filled out if (lineItem.Line_Item_Type__c == null) continue; lineItem.Opportunity__c = this.opportunityId; if (opp.RecordTypeId == subContractTypeId) { lineItem.Block_Booking_Master__c = opp.Master_Contract__c; } // System.assert(false, '################### start time: ' + lineItem.Start_Time__c); lineItemsToInsert.add(lineItem); } insert lineItemsToInsert; PageReference ref = new PageReference('/' + this.opportunityId); ref.setRedirect(true); return ref; } public static testMethod void canSaveSevenLineItems() { Program__c program = new Program__c(Name = 'Test Program'); insert program; Opportunity opp = new Opportunity( RecordTypeId = subContractTypeId, Name = 'Test Opp', StageName = 'New', CloseDate = Date.today()); insert opp; Test.setCurrentPageReference(new PageReference('Page.AddLineItems')); System.currentPageReference().getParameters().put('opportunity_id', opp.Id); DateTime now = DateTime.now(); AddLineItems controller = new AddLineItems(); List<Line_Item__c> lineItems = controller.getLineItems(); Integer i = 0; for (Line_Item__c lineItem : lineItems) { i++; // Leave the last one blank if (i == 8) continue; lineItem.Program__c = program.Id; lineItem.Line_Item_Type__c = 'Performance'; lineItem.Fee_Charged__c = 1.00; lineItem.Start_Time__c = now; lineItem.End_Time__c = now; lineItem.MSAC_Allowable_Amount__c = i; lineItem.Audience_Age__c = i.format(); lineItem.Audience_Size__c = i; } controller.saveLineItems(); List<Line_Item__c> lineItemsAfterSave = [ SELECT Id, Program__c, Line_Item_Type__c, Fee_Charged__c, Start_Time__c, End_Time__c, MSAC_Allowable_Amount__c, Audience_Age__c, Audience_Size__c FROM Line_Item__c WHERE Program__c = :program.Id]; System.assertEquals(7, lineItemsAfterSave.size()); i = 0; for (Line_Item__c lineItem : lineItemsAfterSave) { i++; System.assertEquals(program.Id, lineItem.Program__c); System.assertEquals('Performance', lineItem.Line_Item_Type__c); System.assertEquals(1.00, lineItem.Fee_Charged__c); System.assertEquals(now, lineItem.Start_Time__c); System.assertEquals(now, lineItem.End_Time__c); System.assertEquals(i, lineItem.MSAC_Allowable_Amount__c); System.assertEquals(i.format(), lineItem.Audience_Age__c); System.assertEquals(i, lineItem.Audience_Size__c); } } }

 

Any help would be greatly appreciated.

 

Cheers,

 

Eliot Stock

 

 

 

Hi there.

 

Is there any way to get access to the User object from within a custom controller or an extension to a standard controller? It seems strange that I have it in the VF page but not in the controller.

 

Thanks,

 

Eliot Stock.

There's an "Apex Test Runner" tab in the Force.IDE Eclipse plugin. On the right hand side of it is the log output from running my tests. Is this log also in the filesystem somewhere? Is there some way I can use common Unix tools against it, like grep and tail?

Hi there,

 

I have a series of Visualforce pages with forms that need to be filled out sequentially. Suppose on page 2 in this flow, I need access to a custom SObject that I just created on page 1. Except that I never actually stuck it in the DB with 'insert' on page 1, I just construted it.

 

In a Java web app, I'd put my instance from page 1 in the session and get at it from page 2. Is there any such thing in Salesforce?

 

If not, do I have to either put my custom SObject in the DB after page 1 (before I'd like to), just so I can get it out again on page 2? Or perhaps put a huge set of hidden form fields from page 1 on page 2 and have the controller populate these?

 

Thanks in advance.

 

Eliot Stock.

I'm getting these at least once a day, and on the sandboxes I use most often, sometimes many times a day. Is this normal? Is there any way of stopping it?

Hi.

 

I am finding that this inputField tag in my Visualforce page:

 

 

<apex:pageBlock mode="edit" id="block"> <apex:pageBlockSection title="Data Collection" columns="1" id="dataCollection"> <apex:inputField value="{!metric.Is_Cumulative__c}" required="true" id="isCummulative"/> ...

 


 

 

produces this HTML:

 

 

<select id="j_id0:j_id2:j_id3:j_id42:j_id43" name="j_id0:j_id2:block:dataCollection:isCummulative">

 

 which means that I can't find the document element like so:

 

 

var cummulativeDropdown = document.getElementById('{!$Component.block.dataCollection.isCummulative}');

 

 It looks to me like the name attribute has been set to what should be in the ID attribute. Any ideas anyone?

 

Thanks.

 

 

Hi there.

 

I have a couple of radio buttons and I want clicking either of them to result in the form submitting itself (for which I have a function that does some other stuff before submitting).

 

 

<apex:selectRadio value="{!mode}" layout="pageDirection" id="modeSelect" onChange="toggleMode()"> <apex:selectOption itemValue="oneByOne" id="oneByOneRadio" itemLabel="Enter hours for each volunteer individually"/> <apex:selectOption itemValue="splitTotal" id="splitTotalRadio" itemLabel="Split the following number of hours evenly among all volunteers:"/></apex:selectRadio>

 

With the event handlers like this, with an onChange on the selectRadio only and nothing on the selectOptions, this will work ok with Firefox but not with IE. IE only fires the onChange event *after* you click or tab away from the radio button you just checked. So this is no good.

 

What would work is if I could make that event handler an onClick instead of an onChange, and preferably put it on the selectOption tags rather than the selectRadio. IE does fire the onClick event when you expect. However this is not possible with Salesforce, as far as I can tell. If I use an onClick attribute in the VF like so:

 

<apex:selectOption itemValue="oneByOne" id="oneByOneRadio" onClick="toggleMode()" itemLabel="Enter hours for each volunteer individually"/>

 

 

 

is not rendered in the HTML at all:

 

 

<input type="radio" checked="checked" name="VolunteeringTeamEvent:form:j_id1:modeSelect" id="VolunteeringTeamEvent:form:j_id1:modeSelect:0" value="oneByOne" /><label for="VolunteeringTeamEvent:form:j_id1:modeSelect:0"> Enter hours for each volunteer individually</label>

 

 

 

 

Is this a bug?

 

Thanks in advance,

 

Eliot. 

 

 

 

Hi all.

 

I'm aware of the metadata API and understand how to use it from code external to Salesforce, in Java or C# for example. But what I really need is to use this API from within Apex code in a custom controller. I want to be able to set up some page layouts in the browser, then query the fields on them and whether they're required or not from within my Apex code.

 

I could generate a SOAP client for the metadata API in Apex code and use that, but I'd really like to aovid going outside just to get back in again. For a start, the tool under Setup that consumes a WSDL and generates an Apec class pukes on the metadata WSDL file (Error: Class name 'Metadata' already in use. Please edit WSDL to remove repeated names). So that already seems a bad approach.

 

Is there an internal way to access this API?

 

Thanks in advance,

 

Eliot Stock. 

Hi there.

 

I have a situation where I want to behave differently in Prod to the Sandbox. Is there anyway to tell programmatically which environment I'm executing in?

 

Thanks,

 

Eliot Stock.

Hi there.

 

ApexPages.currentPage().getParameters() returns a Map<String, String>. But I have an HTML select field on my page which accepts multiple values:

 

 

<select size="7" name="a0780000004jDTQAA2" multiple="true"> <option value="a">a</option> <option value="b">b</option> <option value="c">c</option> </select>

 

Note that this is really plain old HTML in my VF page, not an <apex:inputField> tag. If I select two values in this field and submit the form, the browser will send both values. But in Apex code in my controller, I only have access to the first value (ie. it's Map<String, String>, not Map<String, List<String>>).How do I get access to what was really posted in the form submission?

 

Thanks.

Hi there.

 

I'm trying to build a tool for monitoring various records udring QA. Is there any way to query for an SObject knowing only its Id and not its type?

 

Thanks,

 

Eliot Stock.

Hi there,

 

I have a VF page with a table of fields on it that allows me to create mulitple custom objects at once. In a custom controller I iterate over the custom objects, set some more stuff on them, add them to a list and then call insert() on that list. Every other field on the object is saved except for the DateTime fields. Another page on which I create these objects one by one works. The unit test for by controller also works, which sets up thenew object instance programmatically.

 

Is this a known issue or a bug or am I doing something wrong?

 

Here's a cut-down version of the VF page:

 

 

<apex:page controller="AddLineItems" tabStyle="Opportunity" id="line_items_page" sidebar="false"> <apex:sectionHeader title="Add Line Items to Opportunity" /> <apex:messages /> <apex:form id="line_items_form"> <div id="ins"></div> <apex:dataTable value="{!LineItems}" var="lic" id="line_items_table" border="0" cellPadding="2" cellSpacing="2"> <apex:column > <apex:facet name="header">Start Time</apex:facet> <apex:inputField value="{!lic.Start_Time__c}" id="start_time"/> </apex:column> <apex:column > <apex:facet name="header">End Time</apex:facet> <apex:inputField value="{!lic.End_Time__c}" id="end_time" /> </apex:column> </apex:dataTable> <apex:commandButton value="Save" action="{!saveLineItems}"/> <apex:commandButton value="Cancel" onclick="window.history.back();"/> </apex:form> </apex:page>

 and here's the controller:

 

 

public class AddLineItems { private Id opportunityId; private static final Map<String, Schema.RecordTypeInfo> opportunityTypeMap = Opportunity.SObjectType.getDescribe().getRecordTypeInfosByName(); public static final Id subContractTypeId = opportunityTypeMap.get('Sub-Contract').RecordTypeId; private List<Line_Item__c> lineItems = new Line_Item__c[] { new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c(), new Line_Item__c()}; public AddLineItems() { this.opportunityId = ApexPages.currentPage().getParameters().get('opportunity_id'); System.assert(this.opportunityId != null, 'AddLineItems controller requires an opportunity_id' + ' parameter on the query string.'); } public Line_Item__c[] getLineItems() { return this.lineItems; } public PageReference cancelLineItems() { PageReference ref = new PageReference('/' + this.opportunityId); ref.setRedirect(true); return ref; } // 1 SOQL, 1 DML public PageReference saveLineItems() { Opportunity opp = [ SELECT RecordTypeId, Master_Contract__c FROM Opportunity WHERE Id = :this.opportunityId]; List<Line_Item__c> lineItemsToInsert = new List<Line_Item__c>(); for (Line_Item__c lineItem : this.lineItems) { // The type will be null for a row in the table that's not filled out if (lineItem.Line_Item_Type__c == null) continue; lineItem.Opportunity__c = this.opportunityId; if (opp.RecordTypeId == subContractTypeId) { lineItem.Block_Booking_Master__c = opp.Master_Contract__c; } // System.assert(false, '################### start time: ' + lineItem.Start_Time__c); lineItemsToInsert.add(lineItem); } insert lineItemsToInsert; PageReference ref = new PageReference('/' + this.opportunityId); ref.setRedirect(true); return ref; } public static testMethod void canSaveSevenLineItems() { Program__c program = new Program__c(Name = 'Test Program'); insert program; Opportunity opp = new Opportunity( RecordTypeId = subContractTypeId, Name = 'Test Opp', StageName = 'New', CloseDate = Date.today()); insert opp; Test.setCurrentPageReference(new PageReference('Page.AddLineItems')); System.currentPageReference().getParameters().put('opportunity_id', opp.Id); DateTime now = DateTime.now(); AddLineItems controller = new AddLineItems(); List<Line_Item__c> lineItems = controller.getLineItems(); Integer i = 0; for (Line_Item__c lineItem : lineItems) { i++; // Leave the last one blank if (i == 8) continue; lineItem.Program__c = program.Id; lineItem.Line_Item_Type__c = 'Performance'; lineItem.Fee_Charged__c = 1.00; lineItem.Start_Time__c = now; lineItem.End_Time__c = now; lineItem.MSAC_Allowable_Amount__c = i; lineItem.Audience_Age__c = i.format(); lineItem.Audience_Size__c = i; } controller.saveLineItems(); List<Line_Item__c> lineItemsAfterSave = [ SELECT Id, Program__c, Line_Item_Type__c, Fee_Charged__c, Start_Time__c, End_Time__c, MSAC_Allowable_Amount__c, Audience_Age__c, Audience_Size__c FROM Line_Item__c WHERE Program__c = :program.Id]; System.assertEquals(7, lineItemsAfterSave.size()); i = 0; for (Line_Item__c lineItem : lineItemsAfterSave) { i++; System.assertEquals(program.Id, lineItem.Program__c); System.assertEquals('Performance', lineItem.Line_Item_Type__c); System.assertEquals(1.00, lineItem.Fee_Charged__c); System.assertEquals(now, lineItem.Start_Time__c); System.assertEquals(now, lineItem.End_Time__c); System.assertEquals(i, lineItem.MSAC_Allowable_Amount__c); System.assertEquals(i.format(), lineItem.Audience_Age__c); System.assertEquals(i, lineItem.Audience_Size__c); } } }

 

Any help would be greatly appreciated.

 

Cheers,

 

Eliot Stock

 

 

 

Hi there.

 

Is there any way to get access to the User object from within a custom controller or an extension to a standard controller? It seems strange that I have it in the VF page but not in the controller.

 

Thanks,

 

Eliot Stock.

Hi there,

 

I have a series of Visualforce pages with forms that need to be filled out sequentially. Suppose on page 2 in this flow, I need access to a custom SObject that I just created on page 1. Except that I never actually stuck it in the DB with 'insert' on page 1, I just construted it.

 

In a Java web app, I'd put my instance from page 1 in the session and get at it from page 2. Is there any such thing in Salesforce?

 

If not, do I have to either put my custom SObject in the DB after page 1 (before I'd like to), just so I can get it out again on page 2? Or perhaps put a huge set of hidden form fields from page 1 on page 2 and have the controller populate these?

 

Thanks in advance.

 

Eliot Stock.

I'm getting these at least once a day, and on the sandboxes I use most often, sometimes many times a day. Is this normal? Is there any way of stopping it?

I am having trouble adding javascript events to the individual selectOptions.  I am able to add events to the wrapping selectList and selectCheckboxes.

 

Please see the following code example.  The expected behavior when clicking on a selectOption would be:

  1. An alert from the surrounding selectList or selectCheckboxes
  2. An alert from clicking on each individual selectOptio, like "Click me 1"
The rendered behavior only alerts when clicking on the selectList and not the underlying selectOptions.
 

I've inspected the HTML source and have confirmed that the onclick events do not get rendered.  Has there been a bug filed against this?

 

 

 

<apex:form >
<apex:selectCheckboxes id="selectedCheckboxesId"  layout="pageDirection" onclick="alert('clicked apex:selectCheckboxes')">
       <apex:selectOption id="so00" itemValue="Click me 1" itemLabel="Click me 1" onclick="alert('Click me 1')" onmouseover="alert('Moused Over 1')"/>
       <apex:selectOption id="so11" itemValue="Click me 2" itemLabel="Click me 2" onclick="alert('Click me 2')"/>
</apex:selectCheckboxes>
<apex:selectList id="selectedListId" onclick="alert('clicked selectList')">
       <apex:selectOption id="so0" itemValue="Click me 1" itemLabel="Click me 1" onclick="alert('Click me 1')" onmouseover="alert('Moused Over 1')"/>
       <apex:selectOption id="so1" itemValue="Click me 2" itemLabel="Click me 2" onclick="alert('Click me 2')"/>
</apex:selectList>
</apex:form>

 

 

Message Edited by parkerAPT on 02-24-2009 02:14 PM
I have a list of a custom object that I display on a VisualForce page using a dataTable. The dataTable has four columns. The first is outputText, the second and third inputText, and the fourth inputCheckbox. The user modifies the contents of the inputText and inputCheckbox and then saves (updates). Initially everything works as expected. However after a few successful saves I always get the following error message:

<apex:inputText> element value must resolve to a String type!

If I log out, close the browser, and then return to the page I still get the error. I've read a few articles related to this type of functionality and my code seems to be using the correct approach.

Any thoughts on this?

Here is the code:

Code:
public class UpdateContractUsageStats {
 
        private final List<Contract_Usage_Data__c> ContractUsageData;
        
        public UpdateContractUsageStats() {
   
   ContractUsageData = [Select Id, Usage_Report_Interval_Label__c, Usage_Report_Date__c, UsageLives__c, UsageAmount__c, Usage_Report_Certified__c From Contract_Usage_Data__c Where Contract__c=: ApexPages.currentPage().getParameters().get('cid')];
        }
        
  public PageReference save() {
   try{
    update ContractUsageData;
   }
   catch(DmlException ex){
    ApexPages.addMessages(ex);
   }
   return null;
  }
        
        public List<Contract_Usage_Data__c> getContractUsageData(){
                return ContractUsageData;
        }
}

 
Code:
<apex:page controller="UpdateContractUsageStats">
 <apex:messages />
    <apex:form >
        <apex:dataTable value="{!ContractUsageData}" var="intervalData" id="theTable" rowClasses="odd,even" styleClass="tableClass">
            <apex:column width="25%">
                    <apex:facet name="header">Interval</apex:facet>
                    <apex:outputText value="{!intervalData.Usage_Report_Interval_Label__c}"/>
            </apex:column>
            <apex:column >
                    <apex:facet name="header">Usage Lives</apex:facet>
                    <apex:inputText value="{!intervalData.UsageLives__c}" disabled="{!intervalData.Usage_Report_Certified__c}"/>
            </apex:column>
            <apex:column >
                    <apex:facet name="header">Usage Amount</apex:facet>
                    <apex:inputText value="{!intervalData.UsageAmount__c}" disabled="{!intervalData.Usage_Report_Certified__c}"/>
            </apex:column>
            <apex:column >
                    <apex:facet name="header">Certified</apex:facet>
                    <apex:inputCheckbox value="{!intervalData.Usage_Report_Certified__c}" disabled="{!intervalData.Usage_Report_Certified__c}"/>
            </apex:column>
        </apex:dataTable>
        <apex:commandButton value="Update Statistics" id="theButton" action="{!save}"/>
    </apex:form>
</apex:page>

 


  • October 16, 2008
  • Like
  • 0
Is it possible to call the UserInfo.getUserId() in a testMethod and do I always get a valid User Id when uploading my package ?
 
Are the tests run under a generic user Id and this method will return NULL instead of a valid user id ?
 
Anyone used this before ? I add events for this user id in my test methods and wonder if this will work in all cases.
 
Thanks.
Hi,
 
I've got a small problem. In a team edition of salesforce, i've got a standard field under opportunities called close date. I was to create a custom formula field that gives me the date 5 bank days from the close date. This means skipping saturday and sunday. I've not been able to solve this, does anyone have any ideas how i can do it?
 
Best regards,
johan