• tinman44
  • NEWBIE
  • 5 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 36
    Replies

So here is my issue. I have some text fields that can store HTML formatted data in SFDC. For example "<strong>Test</strong>". What I need to do is get a character count of the non HTML characters in that field. So for our example I want to know that there is 5 char in it not 22 char.

 

I can do this in Javascript by using a regular expression:

 

var re= /<\S[^>]*>/g; var test = "<strong>Test</strong> test = test .replace(re,"");

 

But I woudl like to do it in APEX and store the char count in a field on that record. I am not Java guy so all the examples seem to drive me to have a beer. Can anyone point me in the right direction?  All I really need to know how to do is perform the above Javascript code in APEX...and I think I need to user the "replaceAll" method.

 

 

Thanks in advance!

 

Wondering if anyone else is having issues with the MapQuest for appexchange app? It used to work fine but earlier this year it started throwing a number of errors.

 

"mapquest for appexchange exception: error making SQL connection" is the latest.

 

Tried to contact their support but no one returns emails. Anybody have any insight into this? Thanks in advance!

Sorry to ask this question again but it seems that I cannot find a consistent/accurate answer on the boards. I am trying to find out two things:

 

1. It appears that Salesforce.com would like us to use the Customer portal as our authentication method for Sites. However, some form of authentication could be created using APEX/VF/Cookies/Etc. Is creating another form of authentication to display user specific information a violation of the terms of service? Or is it simply not supported?

 

2. If it is a "violation" what is the pricing model for customer portal? I have read per login, per seat, etc? I know the response to this will be "contact your sales rep". But as a partner our clients are different sizes and deal with multiple sales reps. I am just looking for the overall model and some off the shelf ballpark pricing so I can share that with our clients. 

 

Any feedback/direction/help would be greatly appreciated!

Okay...so I have been trying for a couple of hours now to create a nested list that contains three sobjects...and cannot get it working. At this point I think I am simply running into a syntax issue. Checked in the docs but they were not very helpful. Any insight would be greatly appreciated.

 

Essentially what I need to create is a nested List that has the following structure (Forgive me for bad syntax):

 

LIST<Accounts List<Contacts List<Tasks associated with those contacts>>>

 

Or in English:

 

Accounts with all contacts and all tasks associated with those contacts.

 

It would be a simple task in Javascript/S-Control...but I cannot seem to make the conceptual leap to APEX on this one

 

Any help/insight/samples would be greatly appreciated.

 

Hello all-
 
I am trying to display HTML stored in a field on a Visualforce page. But not sure it is possible. For example:
 
I have a custom object "HTML_Object__c" with a field called "". I want to call a custom component in a page that calls a custom controller that queries SFDC for this fields data:
 
Code:
public HTML_Object__c getHTMLText() {
      
        HTML_Object__c HTMLText= [select  from HTML_Object__c Where SOME CONDITION IS TRUE]; 
   
  return HTMLText;
    }     

 Then in the controller I want to display it in the VF page:
 
Code:
{!HTMLText.HTML_output__c}

The problem is it displays the HTML as HTML. So if I had "<strong>Test</strong>" stored in the field it would display exactly that and not "test".

Any one know if I can do this?? Thanks in advance


 

 
All-
 
I searched the boards for this one with no luck. I have a trigger that is throwing an error in certian cases. I have not been able to identify the exact use case that is throwing the error...but I thought I would throw it out here to see if anyone has seen this.
 
I have a trigger that is on the event that figures the next activty data for all accounts it is associated with. Basically every time an event is saved I go out and figure out all contacts and accounts associated with it then grab all events assocaited with them then figure out when the next event is. Then I stick that date on the accounts. This way the reps know when there next event is on the list views.
 
So every so often I get this error sent to me.
 
Code:
"ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, entity failed ifModifiedBefore "
 
I looked in the documentation and found this def of the error:
 
Code:
"You cannot update a record if the date inLastModifiedDate is later than the current date. "

 
However I am not setting/touching the last modified date. Very wierd. Not sure what is going on. Items to note...this is in a international org and the error only seems to be being triggered by users in Japan.
 
Any help/insight would be greatly appreciated!
 


Message Edited by tinman44 on 12-29-2008 07:37 AM

Message Edited by tinman44 on 12-29-2008 07:37 AM
Hey all-
 
I thought I had done this before but I seem to be banging my head against a wall. I need to do a mass update on a set of accounts (And do not want to do this one via a trigger). So I get all my accounts and then I want to insert them in groups of 190 (I rember reading somwhere that the limit was 200). It feels like a syntax issue. Here is what I have right now:
 
This is the function that gets the list of Accounts from an Async query. I have reduced it to the most simple logic and cannot even get this to function.
 
Code:
function success(qResult) {

  var accountsReturned = qResult.getArray("records"); 
  var accountsForUpdate = [];
  
  if(qResult.size > 0) { 

   for (var i=0; i<qResult.size; i++) {
   
    
    var curAccount = accountsReturned[i];
    
    /// MAKE SOME CHANGES TO ACCOUNTS HERE
                                
                  accountsForUpdate.push(curAccount); 

   }
            
            try {
    
              var result = sforce.connection.update([accountsForUpdate]);
  if (result[0].getBoolean("success") == false) { alert(result[0]);}
          
  } catch(e) {
     
   alert(e);
         
  }
    
  }
}

 It returns this error:
 
"{errors:[fields:null, message:'sObject type 'sObject' is not supported. If you are attempting to use a custom object..."
 
Please o please can someone point me in the right direction or let me know if what I am doing is out of bounds....
 
Thanks in advance for any help!
All-
 
Wondering if it is possible to reference a Visualforce custom component that I hve build in my dev org in a production org without moving the code/component to the production org?
 
Thanks!
 
I have recently started getting this error when I try to use Force.com Offline edition:
 
"Unable to send request to server. The server name or address could not be resolved"
 
Any ideas? Help? Thanks in advance!
Hey-
 
I am trying to write a simple method to call an APEX script from JavaScript...to learn how it functions (so my code does not do anything). I feel like I have followed the instructions...but I keep getting this error:
 
Code:
{faultcode:'soapenv:Client', faultstring:'No service available for class 'webserviceTest'', }

 Here is my class:
 
Code:
global class webserviceTest {

 webservice static String getAccounts(Id userId) {
 
  String Name = 'TEST';
  return Name;
 }
}

Here is my s-control:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/11.0/connection.js"></script>
    <script src="/soap/ajax/11.0/apex.js"></script>
<script type="text/javascript">

function init() {


try {

 var accts = sforce.apex.execute("webserviceTest","getAccounts",{userId:"{!$User.Id}"});

} catch (e) {

 document.getElementById('test').innerHTML = e.toString();

}
 alert(accts);

}


</script>

</head>
<body onload="init()" id='test'>
</body>
</html>

 
Am I missing something? Thanks in advance for any help!



Message Edited by tinman44 on 06-02-2008 12:21 PM
All-
 
So I am getting this error on some of my Apex scripts "Apex heap size too large: 216581". I am trying to update a object that is linked to many accounts in a trigger/class. It proccesses about 14 of the 100+ accounts and then fails. At this point the documentation is not that straight forward about this error. I see the limit is 100,000 but that is about it.
 
Anybody have any insight about this error? How to clear the heap? How you have gotten around it?
 
Thanks in aadvance for any help/direction!
Hello all-
 
Trying to decide which solution fo go with Lotus Notes Connector for Lotus Notes version or Link Point 360? Wondering if any of you have any insight on which product is more usable/functional/etc?
 
Any feedback/advice would me much appreciated!
Is there any limitiation to the number of times you cna refresh your APEX sanbox? Could not find this in the documentation.
 
Thanks!
In the documentation about Apex it states:
 
"To best take advantage of Apex, all Unlimited and Enterprise Edition customers will receive a new Apex Sandbox that they can use for development and testing of Apex code"
 
Does anyone know how we would get this turned on for one of our Enterprise customers? Thanks in advance for any insight!

Hello all-

i am trying to write my first Apex trigger and deploy it to a production org and am missing something. I have written the Trigger to do what I want but cannot see m to figure out how to write the unit tests for this and then deploy it to an org. I have gone over the documentation all day and still am hitting my head against a wall. Wondering if anyone would be so kind as to help me understand what the unit tests for a simple script like this would look like? I would be very greatful...or at least point me in the direction of a simple hello world example?

Code:
Code:
trigger UpdateOpportunityLastActivityDate on Event (before insert, before update) {

for (Event e : Trigger.new) {
 
     Opportunity[] opp = [select id from opportunity where id= :e.WhatId];
     opp[0].Next_Activity_Date__c = e.ActivityDate;
     update opp;
     
    }

}


 
Thanks in advance for any help/direction.

Thanks in advance for any insight. I keep getting this error on some data I am trying to import into SFDC. It kicks back around 50 records with this error. Not sure what it means.
 
Error, row is larger than header
 
Wondering if anyone has seen this or has any idea what it means.
So I signed up to get APEX code enabled in my dev org and it told me that all was good and that I could now practice with the new code. However when I go to my dev org I do not have SETUP > BUILD > CODE. I only have the normal options under BUILD.
 
Am I missing something? Or can you only create packages in Eclipse? Any help/direction would be appreciated. Thanks!
I just started playing with inserting an s-control inline in the detail view of a page. It appears to load the s-control onto a 200px high iframe. Is there anyway to control this height? Make it bigger/smaller?
 
Thanks in andvance for any advice.
Let me first say that this sounds like a great addition to SFDC. My question is where do I begin in testing this new language? I have access to a SFDC preview org. Am I missing something? Do I save it as an s-control? I have read through the documentation but seemed to have missed this starting point.
 
Thanks!
Thanks in advance for any thoughts/replies...
 
I am wondering if it is possible to force some of the "Drill Down" values in a report via the URL? For example. Lets say I have a report that gives me some data on all accounts I own. I want to be able to put a link on the acocunt screen that will bring up that report drilled down to the account from where I clicked the link. It would save the reps an extra click and get them only the information they want.
 
Any ideas on how to accomplish this? Am I missing something very simple/basic? Again any advice would be greatly appreciated.
 
 

Sorry to ask this question again but it seems that I cannot find a consistent/accurate answer on the boards. I am trying to find out two things:

 

1. It appears that Salesforce.com would like us to use the Customer portal as our authentication method for Sites. However, some form of authentication could be created using APEX/VF/Cookies/Etc. Is creating another form of authentication to display user specific information a violation of the terms of service? Or is it simply not supported?

 

2. If it is a "violation" what is the pricing model for customer portal? I have read per login, per seat, etc? I know the response to this will be "contact your sales rep". But as a partner our clients are different sizes and deal with multiple sales reps. I am just looking for the overall model and some off the shelf ballpark pricing so I can share that with our clients. 

 

Any feedback/direction/help would be greatly appreciated!

Hello all-
 
I am trying to display HTML stored in a field on a Visualforce page. But not sure it is possible. For example:
 
I have a custom object "HTML_Object__c" with a field called "". I want to call a custom component in a page that calls a custom controller that queries SFDC for this fields data:
 
Code:
public HTML_Object__c getHTMLText() {
      
        HTML_Object__c HTMLText= [select  from HTML_Object__c Where SOME CONDITION IS TRUE]; 
   
  return HTMLText;
    }     

 Then in the controller I want to display it in the VF page:
 
Code:
{!HTMLText.HTML_output__c}

The problem is it displays the HTML as HTML. So if I had "<strong>Test</strong>" stored in the field it would display exactly that and not "test".

Any one know if I can do this?? Thanks in advance


 

 
i found an interesting piece of code recently.  through the use of a couple of HTML Snippet SControls, a custom lookup button was added beside a field on an Edit page.  what's the trick?  where do i put what so that the javascript is written into the Edit page?
thanks
chris
  • June 11, 2008
  • Like
  • 0
Hi all:
   How do I update the answer I recvd from an S-Control to a field on the object????
Does anyone know how to do this? Pleaseee
Thanks
Shan
Hi,
 
I'm tyring to override the New button(using an s-control) of a custom object2which is in the related list of another custom object1
 
This   s-control auto populates some of the fieds of Custom object2 with the values from custom object1.
 
This S-control is working fine. But when im trying to pass a field of type Text Area(which has multiple lines), the value is getting trimmed and im getting all the lines clubbed into a single line.
 
I tried replacing the line feed(\n) with its equivalent but it doesn't seems to be working. For the time being I replaced '\n' with Comma(,).
 
If any one has any idea how to implement this, please help me to resolve this issue.
 
Any pointers will be of great help.
 
Thanks in Advance
  • April 10, 2008
  • Like
  • 0
I am new to writing s-controls, and I have one which displays a value on the detail tab of an object row.   I would like to give the value a label and have it look just like any of the other values on the detail layout, but so far no luck.  I can get the fonts to match, but the field doesn't line up in the table with the other values.  Also my s-control seems to take up a lot of vertical space, pushing everything below it way down the page for no apparent reason. No doubt this is pretty simple stuff I'm asking, but I haven't found the answer anywhere.  There must be an example somewhere.  In case it makes it clearer, here is my code thus far.  Thanks!

<html>
<script language="javascript"  src="/soap/ajax/8.0/connection.js">
    type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var conn;
function jsmain() {
    conn = sforce.connection;
    var EmployeeId = "{!Employee__c.SupervisorId__c}";
    var queryResult = conn.query("select Name, Phone_Number__c from Employee__c where Id = '" + EmployeeId + "'");
    if (queryResult.size > 0) {
        var records = queryResult.getArray('records');
        document.getElementById("PutDataHere").innerHTML = "Supervisor Phone: " + records[0].Phone_Number__c;
    }
}
</script>
<body onload="jsmain();">
<p id="PutDataHere" style="font-family: 'Arial','Helvetica',sans-serif; font-size: 75%">
</p>
</body>
</html>
Is there any limitiation to the number of times you cna refresh your APEX sanbox? Could not find this in the documentation.
 
Thanks!
In the documentation about Apex it states:
 
"To best take advantage of Apex, all Unlimited and Enterprise Edition customers will receive a new Apex Sandbox that they can use for development and testing of Apex code"
 
Does anyone know how we would get this turned on for one of our Enterprise customers? Thanks in advance for any insight!

Hello all-

i am trying to write my first Apex trigger and deploy it to a production org and am missing something. I have written the Trigger to do what I want but cannot see m to figure out how to write the unit tests for this and then deploy it to an org. I have gone over the documentation all day and still am hitting my head against a wall. Wondering if anyone would be so kind as to help me understand what the unit tests for a simple script like this would look like? I would be very greatful...or at least point me in the direction of a simple hello world example?

Code:
Code:
trigger UpdateOpportunityLastActivityDate on Event (before insert, before update) {

for (Event e : Trigger.new) {
 
     Opportunity[] opp = [select id from opportunity where id= :e.WhatId];
     opp[0].Next_Activity_Date__c = e.ActivityDate;
     update opp;
     
    }

}


 
Thanks in advance for any help/direction.

When I connect Eclipse 3.0 to our sandbox I get the following error message :

AxisFault: null: Duplicate retrieve names specified for package 'Mass Update Contact Address 1%2E0'

null: Duplicate retrieve

I have deleted the custom S control “Mass update Contact address” and I still get the same error message .

The salesforce Schema seems to be partially loaded I can only see one s-control

I get the same error when I connect my Production box.

Eclipse work correctly with my developer login.

any idea ?




  • January 13, 2008
  • Like
  • 0
Thanks in advance for any insight. I keep getting this error on some data I am trying to import into SFDC. It kicks back around 50 records with this error. Not sure what it means.
 
Error, row is larger than header
 
Wondering if anyone has seen this or has any idea what it means.
Is it possible from a workflow to send and automated email (via alerts) but have it also show up in activity history - similar to manually sending email from activity history.
We need to audit emails - even if automatically generated
Thanks in advance for any help
So I signed up to get APEX code enabled in my dev org and it told me that all was good and that I could now practice with the new code. However when I go to my dev org I do not have SETUP > BUILD > CODE. I only have the normal options under BUILD.
 
Am I missing something? Or can you only create packages in Eclipse? Any help/direction would be appreciated. Thanks!
I just started playing with inserting an s-control inline in the detail view of a page. It appears to load the s-control onto a 200px high iframe. Is there anyway to control this height? Make it bigger/smaller?
 
Thanks in andvance for any advice.