• Drew1815
  • NEWBIE
  • 109 Points
  • Member since 2005

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 84
    Replies
Hi,
In the Setup/Develop/Apex Classes page, there's a column called 'Is Valid'. Most of my classes have a check on that column, but some of them don't and I'm trying to figure out what makes a class valid.

I have tests for most of my code too. Is there a certain percent coverage that needs to be achieved for a class in order to become valid?

Any insight on this will be appreciated.

Thanks!


  • December 18, 2008
  • Like
  • 0
hi
 
Can u please tell me how to convert a date value to datetime value.
 
I want to convert startdate(date value) value to datetime value.
 
 
Hi experts,

I need to compare two same strings with different casing.

In java, equating strings is case sensitive. But in apex, it is case insensitive.

How can i force my two same strings with different casing to be not equal?

Example:

In apex:
'Name' == 'name' --> this gives TRUE

I need to force this to FALSE like how it works in java.

Please help me with this.

Thanks in advance,
ces :)
  • December 16, 2008
  • Like
  • 0
Hi,
 
In our S-Control, due a particular reason, we first login using another User.
The following is the code to do so
/*****************************************
var usrPwd = null;
  var usrName = null;
  var currentUrl = sforce.connection.serverUrl;
  var results = sforce.connection.query("Select Password__c,Username__c from Administrator__c");
  records = results.getArray("records");
  if (records.length > 0)
  {
   admName = records[0].get("Username__c");
   admPwd = records[0].get("Password__c");
  } 
    sforce.connection = new sforce.Connection();
  try
  {
   var loginResult = sforce.connection.login(usrName, usrPwd);
  }
  catch (error)
  {
   alert("Failed to Authenticate Administrator, + error);
   self.close();
  }
  sforce.connection.serverUrl = currentUrl;
*****************************************/ 
 
Now I need to migrate the same code to an Apex Class. I can query in an Apex Class but can I login as another User in apex Class in the same way as I am currently doing in S-Control code.
Thanks.
 
Regards,
Rajesh

I logged a Case with salesforce.com support two weeks ago. Case #06716380. Its still being worked on but I was curious if anyone else has seen issues with an HTTPS Force.com Site on Chrome and Windows PC. My sites page times out when using HTTPS. All browsers on a Mac OSX work fine. All browsers but Chrome work fine on Windows PC. The page loads fine in all browers and both operating systems if I use HTTP (instead of HTTPS URL). I created a dummy Visualforce page with nothing but text to remove any possible issue with my Visualforce/Apex. And I am able to reproduce the issue. My org is a Free Force.com Edition org. 

 

Anyone else seen this issue? 

Has anyone else had issues loading a https Force.com site URL in Chrome on a Windows PC? I can load my https site pages fine on all Mac OSX browsers (including Chrome) and Firefox/Safari/IE on my PC. But Chrome on the PC hangs - every once in a while it will load a few parts of the page with no CSS and then time out. If I change the URL to the http version of my site url, chrome loads just fine. 

 

 

I am testing out setting up a CNAME on my godaddy.com sub-domain with a Sandbox Force.com Site. I setup a CNAME for the subdomain. For example, the subdomain is called "sbx", so I setup a CNAME that maps "sbx" to my free force.com site domain setup on a Sandbox (test.salesforce.com) environment. Secondly, I setup the custom web address within the Sandbox Force.com Site to point to sbx.godaddydomain.com (example only).

 

When I go to sbx.godaddycomain.com, I get redirected to cs9.salesforce.com and not the Site. So it looks like some aspect of the CNAME works since it loads the salesforce sandbox domain (cs9), but its not directing me to the Force.com Site home page (ie visualforce page). Any ideas why?

I am setting up a CNAME to map a custom domain I purchased with my Force.com Site (free Force.com).  Free Force.com doesn't let you set your Force.com domain so I am using a CNAME solution instead. I am able to get the CNAME and custom web address configuration working. So I can go to my domain: http://www.customdomain.com and it automatically masks and loads my free force.com site. 

 

My question is this: With CNAME enabled, should the robots.txt file be on the Force.com Site configuration? Or should it be stored within my custom domain folder structure and not within Force.com? I believe it should on Force.com since my custom domain will not have any actual HTML files - they are all Visualforce pages on Force.com. I just wanted to confirm my understanding is correct (or not).

 

 

I am trying to localize a date field in Visualforce and I can't apply the end-users locale. I know I can use the outputField component but I want to manipulate the positioning and output differently. So I am trying to use outputtext component. I am able to output it as I like, but I am not able to apply the end-users locale.

 

Here is a snippet of code:

 

 

<apex:page controller="controllertest" >
<apex:form>
 <apex:outputText value="The formatted time right now is: 
         {0,date, EEEEEEE, d MMM yyyy}">
       <apex:param value="{!d}" />
   </apex:outputText>

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

 

 

No matter what locale or language the user is logged in with, I get "The formatted time right now is: Wednesday, 27 Oct 2010".

 

Anyone know how I can apply locale to this VF snippet?

I am not able to explicitly set the portal user's timezone or language with the Site.createPortalUser() method. My apex controller sets those fields as shown below, but when I execute the Site.createPortalUser() method, the newly created User inherits the Site Guest User's timezone and language. The Site method ignores what my controller code set in those fields.

 

In the example below, I hardcode the language and timezones.  The locale related fields get ignored and overriden by the Site Guest User's locale defaults. 

 

User u = new User(); u.Username = username; u.Email = email; u.CommunityNickname = communityNickname; u.emailencodingkey='UTF-8'; u.languagelocalekey='es'; u.localesidkey='en_BM'; u.timezonesidkey='Pacific/Auckland'; System.debug('user:' + u); String accountId = PORTAL_ACCOUNT_ID; // lastName is a required field on user, but if it isn't specified, we'll default it to the username String userId = Site.createPortalUser(u, accountId, password);

 

Is there anyway on a Site registration page to let the user set their locale fields (timezone, locale, language)? Is this expected behavior of the Site.createPortalUser() method? If yes, can this please be added to the documentation?

 

Thanks 

 

 

I am trying to implement record locking within an Apex controller. To test this out, I have a very simple Visualforce page with a custom controller. In the controller's constructor I have a SOQL query that uses the FOR UPDATE keyword to lock the Account records queried. On page load, I want to lock the record so if another user access the same Visualforce page, record locking is enforced. The controller also has an action method to do a simple DML Update on the same account records that can be invoked through an apex command button. 

 

Here is my test scenario: I log in a 2 different users in different browsers, load the visualforce page which invokes the controller constructor. I then invoke the action method which performs the DML update. I was expecting to see the 2nd action fail since the first constructor invocation had locked the account records. But I was able to successfully update the account records. 

 

 

Question #1: How does Apex handle record locking across a controller's entire view state?

 

Question #2: Is there a way to lock a record for the duration of a Visualforce page where the SOQL is in the constructor but the DML operations are in other action methods within the same controller?  

 

 

Is it possible to configure a Force.com Site to only enable HTTPS connections (meaning the http://test.force.com/siteHomePage won't work)? I saw a post about developing logic on the HTTP Site landing page to redirect to HTTPS. That might work. Just curious if there is a way to turn off the HTTP Site and only use HTTPS.

Is there any upper limit to the number of connections a specific Org can have enabled for salesforce-2-salesforce? For example, can you have 500 connections? Is there any technical limitation to be aware of? Is there a cost required to purchase more connections? 

 

 

 

The WSDL I am generating through WSDL2Apex does not include the necessary SOAP Headers. Is there anyway to modify the generated apex code to include the SOAP Header properties? If so, how do I do that? I see the inputHttpHeaders__x but I am looking for the equivalent for SOAP Headers (if they exist)? 

 

 

Message Edited by Drew1815 on 08-07-2009 02:48 PM

I am building a Site that sends out an email confirmation using Apex SingleEmailMessage class. I see in the Apex documentation for Outbound Email states: "The email address of the user calling the sendEmail method is inserted in the From Address field of the email header. " 

 

Question - When using Sites, who is the user calling the sendEmail method? Is it the User configured as the Site Contact? 

 

Ultimately, I am trying to set the "From Address" as a "noreploy@companyABC.com" type of email address. I know how to set the Reply-To and Display Name values. But I am trying to understand how the From address is set in a Site.

 

Thanks,

Andrew 

 

I know the anonymous profile created along with a Force.com Site does not allow a Site to create or edit standard objects such as Accounts. As part of my prototype, I created a custom object that the Site inserts and updates records. Then, I created an Apex Trigger to move that data from the custom object to the standard Account object (using Upsert and an External Id). I had expected the Apex Trigger to fail in the context of a Site since the Site Profile doesn't allow Create on Accounts. But I was able to upsert the Account objects when the Site inserts or updates to a custom object. This solution works for me - but I did want to verify this is expected functionality. 

 

Thanks. 

Are tasks and events (including calendar) available in Customer Portal?

 

I was building a simple customer portal and noticed that neither Tasks nor Events were available. Even the Activity related lists are not displayed in portal for page layouts. Is there anyway to enable that functionality? It doesn't look like it - especially since the customer portal profiles don't have those object CRUD permissions Or am I just missing a setting in my configuraiton? 

I am prototyping out the ability to build a Force.com Site to create new Ideas without having to login. I see that the Profile associated to my Force.com Site doesn't let me grant "Create" permission. I can only grant "Read" access to a generic/unauthenticated user. First, is that true? Secondly, if so, are there plans to change that so a unauthenticated user can create new Idea records through a Force.com Site?

 

The use case is to create an anonymous Ideas application using Force.com Sites and keeping all Ideas posting anonymous. 

I have been able to prototype out authenticating a user from a Force.com Site to the associated customer portal. And I was able to navigate the user to a custom Visualforce landing page after login. That worked well and as expected.

My question is this: is it possible to authenticate a non-portal user from a Force.com Site? I see in the provided Site templates the SiteLoginController apex class which uses the Site.login() method to authenticate the portal user. But can I pass in a non-portal user into that method?

Or if I want to login a non-portal user (Platform license, for example), should I just re-use the www.salesforce.com/login.jsp form post from the Force.com Site login page and then do the redirect in the form post?

Any insight is appreciated.

-Andrew


I am trying to use this very simple apex page to prototype the relatedListHover property of the apex:detail component. I am not able to get the related List Hovers to show up with both the relatedList and relatedListHover properties set to true on the apex:detail component. The standard related lists do show up. But the hovers do not. I have double-checked that the User Interface setting to enable related list hover is truly enabled in the org too.

Any ideas? The example code is below where I try to render the hover links on the User detail page for the currently logged in user.

Here is my apex:detail snippet

I was wondering how I can use a custom controller with a class variable, totalAmount, defined as a Double data type and have it displayed as a Currency field in a Visualforce Page? I know if I use a standard controller and use component that Visualforce will automatically render it as a currency field. But how do I accomplish that with a custom controller and a class field defined as a "Double" data type?

To elaborate, the scenario is to display the total amount of multiple line items. The visualforce page allows users to enter multiple lines items with varying amounts and at the bottom there is the "Total" amount. The VF/Apex code is properly aggregate the amount, but it is stored as a Double data type field in the Apex Code controller class - and therefore displayed in the page as a double.


Thanks.

Message Edited by Drew1815 on 04-14-2008 11:33 AM
Does anyone have an example of how to display a radio button next to each row within a <dataTable> ?

I want to simply display a radio button as the first column of a dataTable. I am trying to figure out how to code the <selectRadio> elements within a multiple row <dataTable>.

Any examples?
Hi,
   I am running into a javascript issue when a specific merge field, Account Name, has both single and double-quotes in its name. So, my sample code looks like:

SControl Code
var accountName = "{!Account_Name}";

After SControl dynamically replaces the Merge Field values
var accountName = "Aethn"a Home Products";
***This causes JavaScript issues as the inner " is not escaped. So I receive a syntax error.

If I wrap the the merge field syntax with single-quotes (var accountName = '{!Account_Name}'), I will resolve the issue for double-quotes within the Account Name, but then I will get errors if a single-quote is in the Account Name.

I have a javascript function that escapes a single-quote and double-quotes, but I can't execute that method since the javascript doesn't even execute due to the syntax error mentioned above.

Question - How can I store a merge field value in javascript that contains BOTH an single-quote and double-quote?


I am having some issues with Account Shares as it pertains to Account Team Members after the Account Owner has been updated through the API. By updating the Account Owner, the Account Shares for each Account Team Member is removed implicitly by the API Update call. The issue I am trying to programmatically fix is that by having each Team Member corresponding Account Share RowCause="Manual" and not set to "Team", the Account Team Member Related List displays the Org Wide Default Sharing Rule for Account Access which is "Public Read Only." Functionally, the Account Share still has "Edit" privileges granted for each Team Member so those end-users still have full functionality. But my problem is that the UI displays the Org Wide Default Rule instead of the granted Team Share which has been deleted by the API.

Furthermore, using the API, I have logic in my code that tried to re-create the Account Shares after the Account Owner has been updated. That create call for Account Shares is successfully, but simply updates the Account Share where RowCause="Manual". So the UI related list doesn't reflect the 'Edit' privileges granted to those team members. It appears that the Related List for Account Team Members displays the Org Wide Default for Account Access if and only if there is no corresponding Account Share for that same User where the RowCause="Team." Is that correct? Is that valid behavior? How can I set the RowCause?

Question - How can I get the Account Team Member Related list to show "Read/Write" after an Account Owner has been changed and the corresponding "Team" Account Shares have been deleted?

I logged a Case with salesforce.com support two weeks ago. Case #06716380. Its still being worked on but I was curious if anyone else has seen issues with an HTTPS Force.com Site on Chrome and Windows PC. My sites page times out when using HTTPS. All browsers on a Mac OSX work fine. All browsers but Chrome work fine on Windows PC. The page loads fine in all browers and both operating systems if I use HTTP (instead of HTTPS URL). I created a dummy Visualforce page with nothing but text to remove any possible issue with my Visualforce/Apex. And I am able to reproduce the issue. My org is a Free Force.com Edition org. 

 

Anyone else seen this issue? 

Has anyone else had issues loading a https Force.com site URL in Chrome on a Windows PC? I can load my https site pages fine on all Mac OSX browsers (including Chrome) and Firefox/Safari/IE on my PC. But Chrome on the PC hangs - every once in a while it will load a few parts of the page with no CSS and then time out. If I change the URL to the http version of my site url, chrome loads just fine. 

 

 

Hi friends,

i have a problem with Customer Portal.

could any one tell me that "can we track customer portal users in LMA?"

suppose i am developing an app and created managed package then deployed it in Appexchange and using LMA(Sales org) to control licenses(who is using our App)...

Now if My clients are using site..then can we track their customer portal users??

I am setting up a CNAME to map a custom domain I purchased with my Force.com Site (free Force.com).  Free Force.com doesn't let you set your Force.com domain so I am using a CNAME solution instead. I am able to get the CNAME and custom web address configuration working. So I can go to my domain: http://www.customdomain.com and it automatically masks and loads my free force.com site. 

 

My question is this: With CNAME enabled, should the robots.txt file be on the Force.com Site configuration? Or should it be stored within my custom domain folder structure and not within Force.com? I believe it should on Force.com since my custom domain will not have any actual HTML files - they are all Visualforce pages on Force.com. I just wanted to confirm my understanding is correct (or not).

 

 

I am trying to localize a date field in Visualforce and I can't apply the end-users locale. I know I can use the outputField component but I want to manipulate the positioning and output differently. So I am trying to use outputtext component. I am able to output it as I like, but I am not able to apply the end-users locale.

 

Here is a snippet of code:

 

 

<apex:page controller="controllertest" >
<apex:form>
 <apex:outputText value="The formatted time right now is: 
         {0,date, EEEEEEE, d MMM yyyy}">
       <apex:param value="{!d}" />
   </apex:outputText>

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

 

 

No matter what locale or language the user is logged in with, I get "The formatted time right now is: Wednesday, 27 Oct 2010".

 

Anyone know how I can apply locale to this VF snippet?

Is Custom Settings 10MB counted as part of the Org Size Limit or is it added on top of the Org Size Limit? The documentation does not state anything regarding it. Thanks
Message Edited by NinoJose on 02-05-2010 01:41 AM

The WSDL I am generating through WSDL2Apex does not include the necessary SOAP Headers. Is there anyway to modify the generated apex code to include the SOAP Header properties? If so, how do I do that? I see the inputHttpHeaders__x but I am looking for the equivalent for SOAP Headers (if they exist)? 

 

 

Message Edited by Drew1815 on 08-07-2009 02:48 PM

Can anyone post how to set the default landing page if you are using a namespace? Here is the example:

 

 

http://mysite-developer-edition.na6.force.com/namespace__mypage

 

Works just fine. But having the namespace just looks tacky, so I try to go to:

 

http://mysite-developer-edition.na6.force.com

 

and it blows up with the ever-popular page not found error.

 

Then I go to the sites configuration where you enter the Default Web Address. If I don't have a namespace, I can make the default page /mypage and it works fine. Once I turn on namespace, I tried to enter namespace__mypage but the sites config gives me this:

 

Error: The Default Web Address must be alphanumeric.

 

Is there any way to have:

 

http://mysite-developer-edition.na6.force.com/

 

actually serve up a real page if I'm using a namespace?

 

Thank you,

DSL

  • April 24, 2009
  • Like
  • 0
Hi,
In the Setup/Develop/Apex Classes page, there's a column called 'Is Valid'. Most of my classes have a check on that column, but some of them don't and I'm trying to figure out what makes a class valid.

I have tests for most of my code too. Is there a certain percent coverage that needs to be achieved for a class in order to become valid?

Any insight on this will be appreciated.

Thanks!


  • December 18, 2008
  • Like
  • 0
Hi,

I've done some data extraction from the API via .net, but never with java. My question is how to connect even though there is documentaion on that I was wondering if I can just add a web reference to my java project like in .net and start from there to make service calls, or do I need to use the ant stuff??? I guess I have a disconnect on this piece of it.

Help is appreciated.

Thanks in advance.
  • December 17, 2008
  • Like
  • 0
I am wondering if there is a way to get the 18-digit UI for an object via merge fields instead of the truncated 15-digit one.

For example, the {!Opportunity.Id} merge field might return 005700000014T5L, but if I access the same object via the APIs then it will be returned as 005700000014T5LAAU. I would like the full Id if possible.


  • December 17, 2008
  • Like
  • 0
Hi,

I am trying to integrate one of our applications with SalesForce. I am quite new with SaleForce and I have basic knowledge of Apex and Visualforce, so please have mercy.

My preference would be to push data to our application (either REST/SOAP). I've learned that REST has a limit of 100kB on message body. Here are my questions:

1) Is there similar limitation on SOAP?
2) What other options are there to integrate with external applications. I understand I could use SF WS API and pull data when we need. What discourages me is 2,000 record limit. There is instance when we would need to send 10,000 records and I want to keep it sweet and simple for now. I want to keep our system API agnostic from SF.
3) Is it possible to open TCP/IP connection from Apex?

Any suggestions are welcome. I searched Apex documentation but couldn't find anything about SOAP size limit (there was something about 52MB but that was for incoming SOAP from external system, I guess).

Thanks,

Tomas
hi
 
Can u please tell me how to convert a date value to datetime value.
 
I want to convert startdate(date value) value to datetime value.
 
 
We got one requirement for profiles and roles creation using the application UI  rather than using APEX UI
pls help me on that by providing valuable suggestions
 
 
 
 
 
 
 
  • December 17, 2008
  • Like
  • 0
Hi all:
   So I got my URL working finally picking up all the necessary fields I need to fill out a Page in edit mode...
The only issue I am having is my date/time field...
When I query it brings up this 2008-12-12T02:01:00.000Z
Of course when you have that in the URL, and it fills into the field as 2008-12-12T02:01:00.000Z I get an error immediately about date/time format...

How do I change that so when my query writes to the URL its writing the correct way it should be to write to the field on the page...

Thanks
Happy Holidays
Can non salesforce users be added to user lists for access to Visual Force pages?  And if so, how?  Don't see in documentation anywhere so maybe is not possible.

If not, is there a way to create low cost SF users who may not be full SF subscribers?  Or is Customer Portal required?

This is a followup to an earlier thread (http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=7598)  about cross organizational  sharing that was somehow deleted.

Thanks in advance.