• BoolsEye
  • NEWBIE
  • 5 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 18
    Replies
I reference a custom label in a VF page by using {!$Label.myLabel}.
 
How can I package the label or is it added to the package automatically by the reference ?
 
I cannot find it in my package and there is no component type 'Custom Labels' when you add things to a managed package.
 
Thanks.
In my sample code the partial page update on one tab is not working.
 
Can someone help me out if I understand the concept behind partial page updates right ?
 
I have a pageBlockTable on Tab1 with Contacts and a second page pageBlockTable on Tab2 with Accounts
 
If I click the commandButton on Tab1 the Contacts should be rerendered.
 
It works, but when I check the debug log, the query for the Accounts is also run. Not only once, but twice. Why ?
 
>>Class.myController.getContacts: line 5, column 16: [select Name from Contact LIMIT 10]: executed 2 times in 11 ms<<
>>Class.myController.getAccounts: line 13, column 16: [select Name from Account LIMIT 10]: executed 2 times in 11 ms<<
I tried everything with actionRegion, outputPanel etc. but nothing helps.
 
What do I have to change that only the query for Contacts on Tab1 is run ? Is this possible ?
 
Code:
<apex:page controller="myController">
<apex:tabpanel switchtype="client">
 <apex:tab label="Tab2">
  <apex:form >
  <apex:pageBlock > 
   <apex:pageblockButtons >
    <apex:actionRegion >
     <apex:commandButton action="{!doSomething}" value="Go!" status="testStatus" rerender="out"/>
    </apex:actionRegion>
   </apex:pageblockButtons>
   <apex:outputpanel id="out">
    <apex:actionStatus id="testStatus" startText="Requesting...">
    <apex:facet name="start">
     Requesting...  
    </apex:facet>
    <apex:facet name="stop">
     <apex:pageBlockTable id="blockContacts" value="{!Contacts}" var="con">
      <apex:column value="{!con.Name}"/>
     </apex:pageBlockTable>
    </apex:facet>
   </apex:actionStatus>
   </apex:outputPanel>
  </apex:pageBlock>
  </apex:form>
 </apex:tab>
 <apex:tab label="Tab2">
  <apex:pageBlock >
   <apex:pageBlockTable value="{!Accounts}" var="acc">
    <apex:column value="{!acc.Name}"/>
  </apex:pageBlockTable>
  </apex:pageBlock>
 </apex:tab>
</apex:tabpanel>
</apex:page>

 
Code:
public class myController {
 
 
 public List<Contact> getContacts() {
  return [select Name from Contact LIMIT 10];
 }
 
 public PageReference doSomething() {
  return null;
 }

 public List<Account> getAccounts() {
  return [select Name from Account LIMIT 10];
 }
 
}

 
Code:
00:12:02 DEBUG - 
***Begining Page Log for /apexpages/devmode/developerModeContainer.apexp
20081009221203.062:External entry point:     returning LIST:SOBJECT:Contact from method public LIST:SOBJECT:Contact getContacts() in 0 ms
20081009221203.062:Class.myController.getContacts: line 5, column 16: SOQL query with 10 rows finished in 7 ms
20081009221203.062:External entry point:     returning LIST:SOBJECT:Account from method public LIST:SOBJECT:Account getAccounts() in 0 ms
20081009221203.062:Class.myController.getAccounts: line 13, column 16: SOQL query with 10 rows finished in 6 ms
20081009221203.062:External entry point:     returning NULL from method public System.PageReference doSomething() in 0 ms
Element j_id7 called method {!doSomething} returned type PageReference: none20081009221203.062:External entry point:     returning LIST:SOBJECT:Contact from method public LIST:SOBJECT:Contact getContacts() in 0 ms
20081009221203.062:Class.myController.getContacts: line 5, column 16: SOQL query with 10 rows finished in 4 ms
20081009221203.062:External entry point:     returning LIST:SOBJECT:Account from method public LIST:SOBJECT:Account getAccounts() in 0 ms
20081009221203.062:Class.myController.getAccounts: line 13, column 16: SOQL query with 10 rows finished in 5 ms
Cumulative profiling information:2 most expensive SOQL operations:
Class.myController.getContacts: line 5, column 16: [select Name from Contact LIMIT 10]: executed 2 times in 11 ms
Class.myController.getAccounts: line 13, column 16: [select Name from Account LIMIT 10]: executed 2 times in 11 ms
No profiling information for SOSL operations.
No profiling information for DML operations.3 most expensive method invocations:
Class.myController: line 4, column 26: public LIST:SOBJECT:Contact getContacts(): executed 2 times in 11 ms
Class.myController: line 12, column 26: public LIST:SOBJECT:Account getAccounts(): executed 2 times in 11 ms
Class.myController: line 8, column 26: public System.PageReference doSomething(): executed 1 time in 0 ms
***Ending Page Log for /apex/Candidates—core.apexpages.devmode.url=1&save_new=1

 


Message Edited by BoolsEye on 10-10-2008 12:35 AM
I have a weird behaviour when adding apex:detail and apex:commandButton on different tabs on a tabpanel.
 
In my code when I click on the commandButton on Tab2 the page gets refreshed.
 
Now I click on the standard 'Edit' button for the contact on Tab1, click on 'Cancel' and the Contact is gone.
 
It seems as if the ID is lost when the edit page is redirected back to my VF page.

It works if I do not click on the commandButton on Tab2 before using the edit button.
 
Is there any workaround for this or am I doing something wrong ?
 
Thanks.
 
 
Code:
<apex:page standardcontroller="Contact" extensions="MyContactControllerExt">
 <apex:tabpanel >
  <apex:tab label="Tab1">
   <apex:detail subject="{!Contact.Id}"/>
  </apex:tab>
  <apex:tab label="Tab2">
   <apex:form >
   <apex:commandButton value="Go" action="{!doSomething}"/>
   </apex:form>
  </apex:tab>
 </apex:tabpanel>
</apex:page>

 
Code:
public class MyContactControllerExt{

    private Contact c;
    
    public MyContactControllerExt(ApexPages.StandardController controller) {
        c = (Contact)controller.getRecord();
    }

    public PageReference doSomething() {
        return null;
    }
    
    public Contact getContact() {
        return c;
    }
}

 
I tried to create the ApexPages.StandardSetController example from the Winter 09 Apex Developers Guide in our Pre-Release environment.
 
I create the controller and the page as displayed below. The controller is ok but when I try to save the page I get the error:
 
Error: Unknown property 'SObject.name' 
 
I first tried this with a custom object and got the same error, can anyone confirm this.
 
Is there a cast missing somewhere ?
 
Code:
public class opportunityList2Con {
public ApexPages.StandardSetController setCon {
get {
if(setCon == null) {
setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select
name,closedate from Opportunity]));
}
return setCon;
}
set;
}
}

 
Code:
<apex:page controller="opportunityList2Con">
<apex:pageBlock >
<apex:pageBlockTable value="{!setCon.records}" var="o">
<apex:column value="{!o.name}"/>
<apex:column value="{!o.closedate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 
I cannot change the plural label for a new custom object any more. When I change the singular value, the plural label is also changed to singular.
 
I also tried it manually from the Force.com IDE and in different orgs. This has always worked, must be a bug.
 
Can someone try this and let me know. I am on NA4.
 
Thanks.
 
 
Is it possible to extract the attachment from an inbound email and store it to Saleforce.com Content and link it to a Contact ?
 
Is there a SF Content API available for doing this ?
 
I do not know where else I could ask this. Maybe someone has already done it.
 
Thanks.
In the FAQ for Visualforce pages I found this:
 
>> With Professional edition you cannot create custom logic for your pages, you must build pages with only standard controllers. <<
 
Is the "standardController"/"controller" attribute restricted in some way or is the "extensions" attribute not supported in Professional Edition ?
 
Is it possible that a Professional Edition user installs my certified managed package and create a new page using my custom controller class as an extension or will he get an error when saving the page ?

 
An example would be that we provide a controller class within our package that collects data for a quote from custom objects (as in the Quote2PDF example) and the user creates a VF page to be displayed as a PDF with his own layout.
 
Thanks.
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.
Is it possible to have a different than the standard governor limit for an entire namespace ?
 
We need a slightly higher limit for
 
Trigger: "Total number of records processed as a result of DML statements = 100"
 
120 would solve most of our problems so that the user has not to use a workaround too often.

Can this be specifed somewhere in the package or done by Salesforce when it is a certified/managed package ?
 
Thanks.
Hi,
 
we created a managed package in our dev org and published this to AppExchange.
 
Is it possible to change s-controls and custom objects with the new Force.com IDE within this package ?
 
When I create a new project our app is listed under 'Referenced Packages' and I can only change things locally. Synchronizing with the server does not work.
 
Does the new IDE work with managed packages ?
 
Thanks.
Hi,

I  want to manipulate the data from the queries before they are merged into the template. I think I can do this with the pre-merge field of the package in javascript but there is no example.

What is the syntax to access the data from the queries ? The data must be availabe somewhere in an array but I could not find them.

Anyone knows how to do this ?

Thanks.
Hi,
 
I created a custom style for a custom tab and added an icon from the document folder to it.
 
I can see the icon in the custom style dialog and in the custom tabs list but it is not shown in the caption when I go to this tab or the detail page of the related custom object.
 
It was working and I think it did not work anymore after the Spring 07 release.
 
Anyone else noticed that ?
 
Thanks,
 
BoolsEye
Is it not possible for a customer to change a default value for a field in a custom object when the app is managed.
 
I installed the LMA app and the default value edit field is disabled in the custom objects.
 
Is this true for all managed apps ?
 
We have a field VAT in one of our application's custom object and the customer should be able to change this to his country settings. Is it possible in managed apps ?
 
Thanks,
 
BoolsEye
Code:
function runQuery() {
 sforceClient.setBatchSize(5);
 sforceClient.query("Select Id, Name From Account", queryCallBack, true);
}

function queryCallBack(qr) {
 if (qr.size > 0) {
   alert(qr.records.length);
  if (qr.done != true) {
   sforceClient.queryMore(qr.queryLocator, queryCallBack, true);
  }
 }
}

 
I set setBatchSize to 5 but I always get all my Accounts with this code and 'done' is always true. I only have nearly 50 accounts in my database but does setBatchSize only has an effect on the query if there are more than that in the database ?  I cannot find anything I'm doing wrong in this code. (I use AJAX toolkit 3.3 beta).
 
Thanks,
 
// Juergen
 
 
 
 
 
 
 
I tried to set a custom currency (double) field to null using the AJAX toolkit (beta 3.3) but it does not work.
 
The field is in the fieldsToNull array of the DynaBean and nillable is true but it is ignored during saving. The value stays the same.
 
Setting my value to 0 works, so saving is fine.
 
Is it not possible to set a currency field to null using the toolkit ?
 
Thanks,
 
// Juergen
How can I get the current users currency separator characters  (thousands/decimals) via API ?
 
I use the function below to convert a currency to a number. In the last line the "," character (thousand separator) is removed from the number but if the user uses european settings this will be a "." character.
 
I looked at GetUserInfoResult but could not find any information.
 
// Juergen
 
function convertCurrencyToNumber(currValue) {
if(currValue == null || currValue =="") {
currValue = "0";
} else {
currValue = stripCurrencyCode(currValue);
}
return currValue.replace(",", "");
}
I want to mimic the behaviour of a standard object tab with two scontrols.
 
I put one scontrol on a web tab which shows a list of some custom objects.
 
When the users clicks on one object I want to display the details of this custom object on the same web tab.
 
I tried

top.location.href = "servlet/servlet.Integration?lid=00b30000000rk5n&eid=" + dynaBean.get("Id");

to go to the details scontrol. It works and the details scontrol is displayed but  the selected tab on the top changes to "Contacts" (?).

Is it possible to "replace" the current scontrol with another on the same web tab ?

Thanks,

Juergen

 

 

Message Edited by BoolsEye on 07-12-2006 10:14 AM

I am working on an AJAX application with S-controls which reference third party javascript libraries and images from a folder on the documents tab.

It works fine but when I upload my application to AppExchange and someone installs the application the file ids in the download urls change

"https://na1.salesforce.com/servlet/servlet.FileDownload?file=015300000005Gll"
"https://emea.salesforce.com/servlet/servlet.FileDownload?file=015300000006846"

Even the server name changes from n1.salesforce.com to emea.salesforce.com. How can I resolve this ?

Is this good practice or should I host the libraries and images on our own website.

I looked into the "Sforce Explorer" s-control and it includes javascript files from "http://sandbox.sforce.com/ajax/sforceExplorer/". What other options do I have in salesforce to upload files.

Thanks,

Juergen
Hi,

I have an urgent problem that needs to figure out ASAP.

We have an app on appexchange. In our app, we use some internal link like so "https://na5.salesforce.com/servlet/servlet.FileDownload?file=01540000000KqY6" in our S-Control. As I understand, When an user install our app, AppExchange will will update these links with their environment setting. Everything is working fine since last week. But today, when a new user installed our app, the links don't update properly. Any ideas? does saleforce/appexchange change something? I need this resolves quickly. Please response. Thanks.

William
  • October 24, 2008
  • Like
  • 0
Hi all,

I have a question regarding visualforce. I have a page which shows the contact lists. I use apex:datatable to show those and add checkbox in every row. What I want to do is send email to every contact that is checked. I don't have a clue on how to do this.
Or is there any apex control besides apex:datatable that already show checkbox ? Any suggestions would be great.

thanx,
edwin
I'm trying to set up a custom list controller to take advantage of the new build-in pagination capabilities in the new release, but the example provided in the docs doesn't appear to be working.

The sample code:

public class opportunityList2Con {
  public ApexPages.StandardSetController setCon {
  get {
    if(setCon == null) {
      setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select
      name,closedate from Opportunity]));
    }
  return setCon;
  }
  set;
  }
}

<apex:page controller="opportunityList2Con">
  <apex:pageBlock >
    <apex:pageBlockTable value="{!setCon.records}" var="o">
      <apex:column value="{!o.name}"/>
      <apex:column value="{!o.closedate}"/>
    </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>


Produces a compiler error: "Unknown Property: 'SObject.name'"    My dev account is on NA6 so I do have the winter '09 release.

Has anyone succeeded in using the pagination feature with a custom list controller??

Thanks,
Hi,
I am developing an apex class which is getting fired by a cron toolkit. In this Apex class I am checking for the name of the day for today(Example. Sunday, Monday etc.). I need to perform some database operations in today is the Wednesday. But I am not getting method in date object static and instance methods which will geive me the name of the day for  specified date. Can anyone tell me the syntax of such method. Please note that it should be Apex class method.
Thanks for the help :)
I have a weird behaviour when adding apex:detail and apex:commandButton on different tabs on a tabpanel.
 
In my code when I click on the commandButton on Tab2 the page gets refreshed.
 
Now I click on the standard 'Edit' button for the contact on Tab1, click on 'Cancel' and the Contact is gone.
 
It seems as if the ID is lost when the edit page is redirected back to my VF page.

It works if I do not click on the commandButton on Tab2 before using the edit button.
 
Is there any workaround for this or am I doing something wrong ?
 
Thanks.
 
 
Code:
<apex:page standardcontroller="Contact" extensions="MyContactControllerExt">
 <apex:tabpanel >
  <apex:tab label="Tab1">
   <apex:detail subject="{!Contact.Id}"/>
  </apex:tab>
  <apex:tab label="Tab2">
   <apex:form >
   <apex:commandButton value="Go" action="{!doSomething}"/>
   </apex:form>
  </apex:tab>
 </apex:tabpanel>
</apex:page>

 
Code:
public class MyContactControllerExt{

    private Contact c;
    
    public MyContactControllerExt(ApexPages.StandardController controller) {
        c = (Contact)controller.getRecord();
    }

    public PageReference doSomething() {
        return null;
    }
    
    public Contact getContact() {
        return c;
    }
}

 
I tried to create the ApexPages.StandardSetController example from the Winter 09 Apex Developers Guide in our Pre-Release environment.
 
I create the controller and the page as displayed below. The controller is ok but when I try to save the page I get the error:
 
Error: Unknown property 'SObject.name' 
 
I first tried this with a custom object and got the same error, can anyone confirm this.
 
Is there a cast missing somewhere ?
 
Code:
public class opportunityList2Con {
public ApexPages.StandardSetController setCon {
get {
if(setCon == null) {
setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select
name,closedate from Opportunity]));
}
return setCon;
}
set;
}
}

 
Code:
<apex:page controller="opportunityList2Con">
<apex:pageBlock >
<apex:pageBlockTable value="{!setCon.records}" var="o">
<apex:column value="{!o.name}"/>
<apex:column value="{!o.closedate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 
In the FAQ for Visualforce pages I found this:
 
>> With Professional edition you cannot create custom logic for your pages, you must build pages with only standard controllers. <<
 
Is the "standardController"/"controller" attribute restricted in some way or is the "extensions" attribute not supported in Professional Edition ?
 
Is it possible that a Professional Edition user installs my certified managed package and create a new page using my custom controller class as an extension or will he get an error when saving the page ?

 
An example would be that we provide a controller class within our package that collects data for a quote from custom objects (as in the Quote2PDF example) and the user creates a VF page to be displayed as a PDF with his own layout.
 
Thanks.
Hi,

I saw this : http://blogs.salesforce.com/features/2008/05/visualforce-pag.html

In Summer 08 Will we be available to create Visualforce pages into Production ? Or it's already available ?

Thank you
  • May 07, 2008
  • Like
  • 0
Is there anyway for a trigger to know if is being executed in the context of a user interface or a web service?

What i want to do is this:

I am extracting pdf data and putting it in salesforce objects through a client application using webservice. I don't want to give errors -
I want to just insert the data and send an e-mail to the user and letting them know if there are errors. When they go into salesforce, they will see the data.
When they edit the data, saving it would require fixing the errors - I would use .addError when used in the UI context.





Hi,
 
I created a custom style for a custom tab and added an icon from the document folder to it.
 
I can see the icon in the custom style dialog and in the custom tabs list but it is not shown in the caption when I go to this tab or the detail page of the related custom object.
 
It was working and I think it did not work anymore after the Spring 07 release.
 
Anyone else noticed that ?
 
Thanks,
 
BoolsEye
Code:
function runQuery() {
 sforceClient.setBatchSize(5);
 sforceClient.query("Select Id, Name From Account", queryCallBack, true);
}

function queryCallBack(qr) {
 if (qr.size > 0) {
   alert(qr.records.length);
  if (qr.done != true) {
   sforceClient.queryMore(qr.queryLocator, queryCallBack, true);
  }
 }
}

 
I set setBatchSize to 5 but I always get all my Accounts with this code and 'done' is always true. I only have nearly 50 accounts in my database but does setBatchSize only has an effect on the query if there are more than that in the database ?  I cannot find anything I'm doing wrong in this code. (I use AJAX toolkit 3.3 beta).
 
Thanks,
 
// Juergen
 
 
 
 
 
 
 
I tried to set a custom currency (double) field to null using the AJAX toolkit (beta 3.3) but it does not work.
 
The field is in the fieldsToNull array of the DynaBean and nillable is true but it is ignored during saving. The value stays the same.
 
Setting my value to 0 works, so saving is fine.
 
Is it not possible to set a currency field to null using the toolkit ?
 
Thanks,
 
// Juergen
I am working on an AJAX application with S-controls which reference third party javascript libraries and images from a folder on the documents tab.

It works fine but when I upload my application to AppExchange and someone installs the application the file ids in the download urls change

"https://na1.salesforce.com/servlet/servlet.FileDownload?file=015300000005Gll"
"https://emea.salesforce.com/servlet/servlet.FileDownload?file=015300000006846"

Even the server name changes from n1.salesforce.com to emea.salesforce.com. How can I resolve this ?

Is this good practice or should I host the libraries and images on our own website.

I looked into the "Sforce Explorer" s-control and it includes javascript files from "http://sandbox.sforce.com/ajax/sforceExplorer/". What other options do I have in salesforce to upload files.

Thanks,

Juergen