• bryano
  • NEWBIE
  • 5 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 39
    Questions
  • 35
    Replies
Hello, I'm wondering if there is a way to read in the contents of an Apex class and find all fields that are declared in the class.  For example, if I have method and in the method body I have a soql statement, is there a where to get the fields in the soql via a SymbolTable?

The methods field in the SymbolTable doesn't seem to give you the contents of what's inside of the method body and the externalReferences field in the SymbolTable seems to only give partial declarations within a method body.  It looks like there's no way to get the fields or soql statements that are used in a class.

I was hoping to get info with the Tooling API so that I could avoid having to build an Apex parser with Antlr.  Any guidance would be appreciated.
  • March 09, 2018
  • Like
  • 0

I'm trying to retreive the CustomObject type and I get the following message: 

 

unpackaged/package.xml: Metadata API received improper input. Please ensure file name and capitalization is correct. Load of metadata from db failed for metadata of type:CustomObject and file name:SiteChangelist.

 

What is the the SiteChangelist object?  I didn't see this object documented in any of the API docs.

  • November 08, 2013
  • Like
  • 0

Hello, after calling login() and try making a call, say query(), I get the following error:

 

exceptionMessage='Destination URL not reset. The URL returned from login must be set in the SforceService'

 

According to the SOAP API documentation for login() it says the following:

 

After logging in, a client application needs to perform these tasks:

  • Set the session ID in the SOAP header so that the API can validate subsequent requests for this session.
  • Specify the server URL as the target for subsequent service requests. You must change to the server URL, the login server only supports login calls.

How is this done when using the force.com WSC?  All the examples I've seen set the username and password in the ConnectorConfig.  I see there's a setSessionHeader() in PartnerConnection but I don't see any method to set the server url. 

 

Can someone point me in the right direction?

 

 

 

  • November 06, 2013
  • Like
  • 0

I have a simple query that works with API 27 but not in API 28.  

select Id from IdeaComment where CreatedDate <= 2013-08-12T15:23:00.000Z

In version 28, it throws the following error:

MALFORMED_QUERY: Implementation restriction. When querying the Idea Comment object, you must filter using the following syntax: CommunityId = [single ID], Id = [single ID], IdeaId = [single ID], Id IN [list of IDs], or IdeaId IN [list of IDs].

I didn't see any notes in the API docs regarding a change to this object except for 3 new fields being added.

Has anyone else come across this?

  • August 12, 2013
  • Like
  • 0
So I have an Apex class that is scheduled to run every hour.  In my class I have 2 class level variables:
 

public DateTime NOW = datetime.now();

public DateTime LAST_HOUR = NOW.addHours(-1);

 

I setup the scheduled job via execute anonymous on 11/30/2012 4:38 PM.  The class has been running every hour however, my 2 DateTime variables are never getting updated.  NOW is always 11/30/2012 4:38 and LAST_HOUR is 11/30/2012 3:38 PM.  I'm using these 2 variables to filter on CreatedDate.

 
Anyone know how I can get NOW to be the current time when the job runs?
  • December 06, 2012
  • Like
  • 0

I'm trying to test an apex class that scans a chatter group for posts.  I have a query in my class that queries on the CollaborationGroupFeed object.  In my test class I have the following code:

 

Test.startTest();
     CollaborationGroup cg = new CollaborationGroup(Name='Test Group', CollaborationType='Public');
     insert cg;
            
     // Create Chatter Post
     FeedItem testFeed1 = new FeedItem(Body='Test Feed 1 Post', ParentId = cg.Id, Type='TextPost');
     insert testFeed1;
            
     // Create Chatter Comment
     FeedComment testFeed1Comment = new FeedComment(CommentBody='Test Feed 1 Comment', FeedItemId=testFeed1.Id, CommentType='TextComment');
     insert testFeed1Comment;
            
     // Create Chatter Post
     FeedItem testFeed2 = new FeedItem(Body='Test Feed 2 Post', ParentId = cg.Id, Type='TextPost');
     insert testFeed2;
            
     // Create Chatter Comment
     FeedComment testFeed2Comment = new FeedComment(CommentBody='#answer Test Feed 2 Comment', FeedItemId=testFeed2.Id, CommentType='TextComment');
     insert testFeed2Comment;
            
     List<CollaborationGroupFeed> feeds = [Select Body from CollaborationGroupFeed];
     system.debug('-------------- ' + feeds);
Test.stopTest();

 When I do a query on CollaborationGroupFeed to confirm the records, it returns 0 records.  What am I doing wrong?

  • November 29, 2012
  • Like
  • 0

I have a Flex application that is hosted on our server and is accessed by clicking on a web tab.  The web tab points to the .html file which in turn loads the .swf.

I have a client who can't load the application.  When he clicks on the web tab he gets the following error:

(mx.messaging.messages::ErrorMessage)#0
  body = (null)
  clientId = "DirectHTTPChannel0"
  correlationId = "326CBB94-1327-9170-3836-DFD447FED461"
  destination = ""
  extendedData = (null)
  faultCode = "Channel.Security.Error"
  faultDetail = "Destination: DefaultHTTPS"
  faultString = "Security error accessing url"
  headers = (Object)#1
    DSStatusCode = 0
  messageId = "00F9E634-16FD-BADE-8F6B-DFD448BA55C1"
  rootCause = (flash.events::SecurityErrorEvent)#2
    bubbles = false
    cancelable = false
    currentTarget = (flash.net::URLLoader)#3
      bytesLoaded = 0
      bytesTotal = 0
      data = (null)
      dataFormat = "text"
    eventPhase = 2
    target = (flash.net::URLLoader)#3
    text = "Error #2170"
    type = "securityError"
  timestamp = 0
  timeToLive = 0

Client is seeing this error in both IE 8 and Firefox 4 with the latest version of Flash player installed.
 
Now, if I log into his instance, click on the web tab, I'm able to load the application just fine in both IE and Firefox and with the same exact version of Flash installed.

I can also access the application in every other salesforce instance where our applicaiton is installed.

Anybody have an idea why he's the only one getting this security error?

 

I'm trying to use dynamic binding on the OpportunityLineItem based on some fields the user can specify, however, the binding does not seem to work when saving.  Below is some code snippets.  Was wondering if anyone can tell me what I'm doing wrong.

Controller Extension

 

public class MyControllerExt {
  public List<MyModel> modelList {get; set;}
  public List<String> oliFieldsList {get; set;}

  public MyControllerExt(ApexPages.StandardController controller) {
    modelList = new List<MyModel>();
    
    oliFieldsList.add('Quantity');
    oliFieldsList.add('UnitPrice');
  }

  public void addToModel() {
    modelList.add( new MyModel() );
  }
}

 

Model

 

 

public class MyModel {
  public OpportunityLineItem oli {get; set;}

  public MyModel() {
    oli = new OpportunityLineItem();
  }
}

 

VF Page

 

 

<apex:form>
  <table cellpadding="2px" width="100%">
    <apex:repeat value="{!modelList}" var="model">
    <tr>
      <apex:repeat value="{!oliFieldsList}" var="field">
        <td>
          <apex:inputField value="{!model.oli[field]}"/>
        </td>    
      </apex:repeat>
    </tr>              
  </table>
</apex:form>

 

 

The VF page will properly display two text input fields, one for Quantity and one for Price.  The Quantity has a red line next to it to signal that it's required so at least I know it's binding correctly to the page on load.  When I enter some values in the text inputs and go to save by clicking on a button, the values that I enter do not get recoginzed.

This is what my save looks like:

 

public PageReference save() {
  List<OpportunityLineItem> olisToUpsert = new List<OpportunityLineItem>();

  for (MyModel m : modelList) {
    m.oli.PricebookEntryId = [some price book entry id];
    m.oli.OpportunityId = [some opportunity id];
    olisToUpsert(m.oli);
  }

upsert olisToUpsert;
 
return new PageReference ('/' + opportunityId); }

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • February 24, 2011
  • Like
  • 0

When using the migration tool and calling deploy and running all tests, I was wondering if there is any way to generate a report summary of all the tests that have been run.  Ideally, it would be nice to get the same information I get in the UI when I click the Run All Tests button.

So I merged 3 lead records through Salesforce.

When I use the following soql to extract leads:
Select IsDeleted, Name, Id, MasterRecordId from Lead

I see 2 records where the IsDeleted is 1 and MasterRecordId is NULL, and I see 1 record where the IsDeleted is 1 and the MasterRecordId has a salesforce id in it, which is what I would expect from running the query above.

However, if I run the following soql:
Select LeadId, CampaignId, IsDeleted, Lead.IsDeleted, Lead.Name, Lead.Id, Lead.MasterRecordId, Id from CampaignMember

I only get back 2 records where the IsDeleted is 1 and the MasterRecordId is NULL. I'm not getting back the record where the MasterRecordId has a salesforce id in it.

Can someone explain why that would be?

Thanks.
  • December 10, 2008
  • Like
  • 0
So I have an opportunity with some line items. If I delete a line item from the opportunity and then use queryAll(), I would expect to see this record with its isDeleted field as 1. However, the queryAll() is not picking up the deleted line item. I looked in the recycle bin for the deleted line item and it's not in there.

Has anyone else come across this?

Thanks.
  • December 04, 2008
  • Like
  • 0
I have a client who is interested in pulling Contact records along with its related CampaignHistory records. I wasn't even aware there was a CampaignHistory related list but it is there in Salesforce. When I looked for it in the API there is no CampaignHistory object. Can someone shed some light on this object?

Thanks much.
  • November 18, 2008
  • Like
  • 0
Hi.  I was wondering if it's at all possible to use the Ajax toolkit outside of an s-control to unit test functions (with jsunit) that make calls to the salesforce web services API.  Ideally, I would like to do the following:

1. Launch my browser
2. Open my test page
3. Login to salesforce
4. Run my unit tests


Any feedback would be apprecitated.

Thanks much.


  • March 22, 2008
  • Like
  • 0
Does anyone know when the Flex toolkit will support file attachments in the sendEmail() call?

Thanks.
  • November 19, 2007
  • Like
  • 0
I've seen some odd behavior with the Flex Toolkit.  I'm using Release 3.11.  I've looked at Connection.as and the server url is pointing to 10.0.  However, if I pass in Application.application.parameters.server_url to my login call, it's pointing to 9.0.

The weird thing is that if I hit na4, it points to 10.0.  If I hit na5, it sometimes points to 9.0 and 10.0.  Can anyone explain this?

Thanks.
  • November 13, 2007
  • Like
  • 0
Hi, I was wondering if there is a way to send an attachment using the sendEmail() of a SingleEmailMessage object.  I've looked over the API and it doesn't seem like there is support for this.

Thanks.
  • October 12, 2007
  • Like
  • 0
I'm trying to send email to muliple addresses using the Flex toolkit and I can't seem to get it to work.  I'm able to send to a single email addresses.

I've tried passing the following to the "toAddresses" property of the SingleEmailMessage object:
    1. a comma seperated string i.e. "foo@bar.com,abc@xyz.com"
    2. an array

When I try to pass an array, Flex gives a compliation error, stating "toAddresses" is expecting a String.

Any ideas?
  • October 11, 2007
  • Like
  • 0
Hey guys, I'm using the beta toolkit and I'm trying to get a value of a field (Long TextArea) from a QueryResult object in Firefox.  The value is about 12,000 characters long.  However, when I call .get(<field name>) it's only returning the first 4,096 characters.  If I look at the soap response and inspect that field, the correct value is there.  Does anyone know how to get the entire value?

Thanks in advance.

Message Edited by bryano on 09-27-2007 01:55 PM

  • September 27, 2007
  • Like
  • 0
I'm using the Apex Flex Toolkit.  I call a function and within that function I make a query.  I have the query's callback function return a string.  Is there a way for the original function to return that string?

For example, I'm trying to do something like this:

Code:
var soql:String = "Select Id from document where Name = 'imageName'";
var pathToImage:String = getPath(soql);

private function getPath(soql:String):String {
    apex.query(soql, new AsyncResponder(function (qr:QueryResult):String {
        // Work with QueryResult and return a string
        return <some string>;    
    }));
    
    return <same string from callback>
}

 

  • August 08, 2007
  • Like
  • 0
So I'm trying to populate a combobox with the results of a describeGlobal call but I keep getting the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.utils::URLUtil$/getProtocol()
    at com.salesforce::Connection/::_invoke()
    at com.salesforce::Connection/::invoke()
    at com.salesforce::Connection/describeGlobal()
    at panea/::describeGlobal()
    at panea/::init()
    at panea/___Application1_applicationComplete()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.managers::SystemManager/::preloader_preloaderDoneHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/::displayClassCompleteHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::DownloadProgressBar/::timerHandler()
    at mx.preloaders::DownloadProgressBar/::initCompleteHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/::dispatchAppEndEvent()
    at mx.preloaders::Preloader/::appCreationCompleteHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.core::UIComponent/set initialized()
    at mx.managers::LayoutManager/::doPhasedInstantiation()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/::callLaterDispatcher2()
    at mx.core::UIComponent/::callLaterDispatcher()


What am I doing wrong?

Here is my code snippet:
Code:
private function describeGlobal():void {
    apex.describeGlobal(new AsyncResponder(describeGCallback, genericFault));
}

private function describeGCallback(result:Object):void {
    var entities:Array = new Array();
   
    for (var i:int=0; i<result.types.list.length; i++) {
        entities.push(result.types.list.source[i]);
    }

    // sfEntities is the id of my combobox
    sfEntities.dataProvider = objectList;                       
}

 

  • August 07, 2007
  • Like
  • 0

Hello, after calling login() and try making a call, say query(), I get the following error:

 

exceptionMessage='Destination URL not reset. The URL returned from login must be set in the SforceService'

 

According to the SOAP API documentation for login() it says the following:

 

After logging in, a client application needs to perform these tasks:

  • Set the session ID in the SOAP header so that the API can validate subsequent requests for this session.
  • Specify the server URL as the target for subsequent service requests. You must change to the server URL, the login server only supports login calls.

How is this done when using the force.com WSC?  All the examples I've seen set the username and password in the ConnectorConfig.  I see there's a setSessionHeader() in PartnerConnection but I don't see any method to set the server url. 

 

Can someone point me in the right direction?

 

 

 

  • November 06, 2013
  • Like
  • 0

I'm trying to test an apex class that scans a chatter group for posts.  I have a query in my class that queries on the CollaborationGroupFeed object.  In my test class I have the following code:

 

Test.startTest();
     CollaborationGroup cg = new CollaborationGroup(Name='Test Group', CollaborationType='Public');
     insert cg;
            
     // Create Chatter Post
     FeedItem testFeed1 = new FeedItem(Body='Test Feed 1 Post', ParentId = cg.Id, Type='TextPost');
     insert testFeed1;
            
     // Create Chatter Comment
     FeedComment testFeed1Comment = new FeedComment(CommentBody='Test Feed 1 Comment', FeedItemId=testFeed1.Id, CommentType='TextComment');
     insert testFeed1Comment;
            
     // Create Chatter Post
     FeedItem testFeed2 = new FeedItem(Body='Test Feed 2 Post', ParentId = cg.Id, Type='TextPost');
     insert testFeed2;
            
     // Create Chatter Comment
     FeedComment testFeed2Comment = new FeedComment(CommentBody='#answer Test Feed 2 Comment', FeedItemId=testFeed2.Id, CommentType='TextComment');
     insert testFeed2Comment;
            
     List<CollaborationGroupFeed> feeds = [Select Body from CollaborationGroupFeed];
     system.debug('-------------- ' + feeds);
Test.stopTest();

 When I do a query on CollaborationGroupFeed to confirm the records, it returns 0 records.  What am I doing wrong?

  • November 29, 2012
  • Like
  • 0
Our external Flex application has been in production for a number of months and according to our log files suddenly stopped working sometime between 8:10pm EST and 9:57pm EST last night.

I get the same error connecting to Production and our Sandbox. The error is:

Error: Ignoring policy file at http://cs1-api.salesforce.com/crossdomain.xml due to meta-policy 'by-content-type'.
Error: Ignoring policy file at http://cs1-api.salesforce.com/services/Soap/cross-domain.xml due to meta-policy 'by-content-type'.

*** Security Sandbox Violation ***
Connection to http://cs1-api.salesforce.com/services/Soap/u/13.0/4b3300DS0000000DC9o halted - not permitted from http://localhost:8500/site/swf/Profiel.swf

Flash Player 9,0,124
Flex 3.0.1

Thank you
Does anyone know when the Flex toolkit will support file attachments in the sendEmail() call?

Thanks.
  • November 19, 2007
  • Like
  • 0
I've seen some odd behavior with the Flex Toolkit.  I'm using Release 3.11.  I've looked at Connection.as and the server url is pointing to 10.0.  However, if I pass in Application.application.parameters.server_url to my login call, it's pointing to 9.0.

The weird thing is that if I hit na4, it points to 10.0.  If I hit na5, it sometimes points to 9.0 and 10.0.  Can anyone explain this?

Thanks.
  • November 13, 2007
  • Like
  • 0
I'm trying to get a simple HelloWorld application working on my local machine using the FlexBuilder v3 Beta and the most recent SFC Flex Toolkit. I've followed the code exactly as documented in the samples found online,  various screencasts, and even in downloaded the samples. Now matter what I do, I get the following error in the login step:

[FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="274B3986-6992-1A79-1276-D7DF53D645C3" type="fault" bubbles=false cancelable=true eventPhase=2]

The login function I'm using is below:
    private function doLogin():void
    {
     var lr:LoginRequest = new LoginRequest();
     lr.username = "devlogin@blablabla.com";
     lr.password = "devloginpassword";
     lr.server_url = "http://www.salesforce.com/services/Soap/u/9.0";
     lr.callback = new AsyncResponder(loginResult, loginFault);
     conn.login(lr);
    }
What am I doing wrong?

Thanks for any help,

Mike
I'm trying to send email to muliple addresses using the Flex toolkit and I can't seem to get it to work.  I'm able to send to a single email addresses.

I've tried passing the following to the "toAddresses" property of the SingleEmailMessage object:
    1. a comma seperated string i.e. "foo@bar.com,abc@xyz.com"
    2. an array

When I try to pass an array, Flex gives a compliation error, stating "toAddresses" is expecting a String.

Any ideas?
  • October 11, 2007
  • Like
  • 0
Hey guys, I'm using the beta toolkit and I'm trying to get a value of a field (Long TextArea) from a QueryResult object in Firefox.  The value is about 12,000 characters long.  However, when I call .get(<field name>) it's only returning the first 4,096 characters.  If I look at the soap response and inspect that field, the correct value is there.  Does anyone know how to get the entire value?

Thanks in advance.

Message Edited by bryano on 09-27-2007 01:55 PM

  • September 27, 2007
  • Like
  • 0
I'm using the Apex Flex Toolkit.  I call a function and within that function I make a query.  I have the query's callback function return a string.  Is there a way for the original function to return that string?

For example, I'm trying to do something like this:

Code:
var soql:String = "Select Id from document where Name = 'imageName'";
var pathToImage:String = getPath(soql);

private function getPath(soql:String):String {
    apex.query(soql, new AsyncResponder(function (qr:QueryResult):String {
        // Work with QueryResult and return a string
        return <some string>;    
    }));
    
    return <same string from callback>
}

 

  • August 08, 2007
  • Like
  • 0
So I'm trying to populate a combobox with the results of a describeGlobal call but I keep getting the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.utils::URLUtil$/getProtocol()
    at com.salesforce::Connection/::_invoke()
    at com.salesforce::Connection/::invoke()
    at com.salesforce::Connection/describeGlobal()
    at panea/::describeGlobal()
    at panea/::init()
    at panea/___Application1_applicationComplete()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.managers::SystemManager/::preloader_preloaderDoneHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/::displayClassCompleteHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::DownloadProgressBar/::timerHandler()
    at mx.preloaders::DownloadProgressBar/::initCompleteHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/::dispatchAppEndEvent()
    at mx.preloaders::Preloader/::appCreationCompleteHandler()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.core::UIComponent/set initialized()
    at mx.managers::LayoutManager/::doPhasedInstantiation()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/::callLaterDispatcher2()
    at mx.core::UIComponent/::callLaterDispatcher()


What am I doing wrong?

Here is my code snippet:
Code:
private function describeGlobal():void {
    apex.describeGlobal(new AsyncResponder(describeGCallback, genericFault));
}

private function describeGCallback(result:Object):void {
    var entities:Array = new Array();
   
    for (var i:int=0; i<result.types.list.length; i++) {
        entities.push(result.types.list.source[i]);
    }

    // sfEntities is the id of my combobox
    sfEntities.dataProvider = objectList;                       
}

 

  • August 07, 2007
  • Like
  • 0
I've downloaded the Apex Flex Toolkit and looked at the supplied API but I was wondering if there's a document that contains examples for calls other than doing a query.

Thanks!
  • August 07, 2007
  • Like
  • 0
I do apologize if this has been brought up in the past.  I've searched the boards but this topic only seems to apply to the beta toolkit.  I'm using the productized toolkit, using the 9.0 API.  On an update, I'm trying to set a field that had a previous value to null or an empty string.  When I go back to the record after the update, the field still has the old value in it.

Any ideas?  I know in the beta version there was a fieldsToNull array where you could push fields to this array.

- Thanks much.
I've been using the Eclipse plugin for Eclipse 3.2.1 and there seems to be an odd behavior.  Whenever I make changes to an scontrol in Eclipse and save it, it changes the name of the scontrol, therefore breaking the mergefields that are including other scontrols.

For example, I have one scontrol named Main.  In that I include other scontrol snippets.  If I make changes to the snippet in Eclipse and save it and go and save Main, I get an error about an incorrect merge field name.  When I look in salesforce, I'll see that the snippet scontrol has been appended with a "1" or a "2".

Anyone else experience this?

Message Edited by bryano on 03-30-2007 03:25 PM

  • March 30, 2007
  • Like
  • 0
Does anyone know if the AJAX toolkit allows for the encryption and decryption of strings?  Or do we have to include encryption algorithms in our s-controls?

Thanks much.
  • March 29, 2007
  • Like
  • 0
In developing an S-Control I'm trying to do a combination of the following:
 
1) output certain Date values to the web page, formatting them according to the user's SF.com locale settings
 
2) fill in AND accept back Date values from editable Text Boxes (within HTML forms), again formatting these dates according to the user's SF.com locale settings
 
Questions are:
 
1) how can my S-Control (i.e. my javascript code) determine what the user's locale settings are?
 
2) having determined these, how can I convert date values to/from the user-visible format in a sensible way? i.e. is some kind of callable function available rather than just coding stuff like
 
if (locale == "English (United Kingdom)") {
  dateSeparator = "/";
  dateFormat = "dmy";
}
else if (locale == "English (United States)") {
  dateSeparator = "/";
  dateFormat = "mdy";
}
 
etc. etc.
 
Seems to me I'd be 'reinventing the wheel' if I did stuff like that - and it would also be a headache regarding testing and future maintainability.
 
Is there a better way to do this?
 
Regards
 
John Lewis
 
  • March 28, 2007
  • Like
  • 0
Hi,
 
I have a problem:
I have two date/time fields for when a service issue begins until it is resolved:

ServiceIssuesStartDate__c
ServiceIssuesEndDate__c
 
How do I create a new S-control that calculates only the number of minutes between the begin and end times and have this field in the case page layout?
Everything I do is giving me errors due to incompatible fields date and date/time don't go together.
 
Signed,
At a loss...
:)