• mattpick1
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 18
    Replies

Hi,

 

We had a problem with an Apex trigger that has now hopefully been fixed. However, it seems like some kind of buffer has filled up and now it is trying to bulk update all the records that it couldn't when the error was being thrown. This is causing a Too Many DML rows exception...

 

Does anyone know how this memory of updates to be performed can be cleared? Or is my thinking completely wrong...?

 

Thanks!

 

Matt 

Hi,

 

I am trying to convert an S-Control to a VF page but am having trouble working out the VF 'method' for a particular situation.

 

In my old S-Control an event is caught by a javascript function in the header of the HTML file, and then merge fields with values such as the User ID are used to call some apex class functions.

 

To get the javascript in the head of the VF page I use the <apex:includeScript> tag. However, merge fields don't appear to work when you are including a file. Will I have initialise a set of global variables by passing the merge fields into a function from the onLoad event?

 

This kind of seems like I'm bending VF around to replicate my old solution which seems a bit pointless, if people with more VF knowledge (so that is probably everyone!) can point out a different way of approaching the problem please let me know.

 

Thanks

 

Matt

Hi,

 

I have this javascript that automatically re-directs a user to the log a call page when an event happens:

 

window.parent.location.href = "/00T/e?title=Call&who_id={!Contact.Id}&followup=1&tsk5=Call&retURL=%2F{!Contact.Id}";

 


The 'retURL' portion of the url is set to return the user to the contact they were looking at's page.

 

Unfortunately this is not happening, instead when the call has been logged and the user clicks 'save' (which appears to be redirecting the user to '/00T/e') the user has to log in again.

 

This has to be done with javascript as other things are going on before the user is re-directed. Any ideas how I can get it to return to the contact page?

 

Thanks

 

Matt

Hi,

 

Is there a way to get a custom formula field to execute a javascript function (much in the same way a custom detail button would)? I've been trying to use the HYPERLINK() function pointing it to a dummy div with no real success...

 

Thanks

 

Matt

Hi,

 

I am writing an Apex trigger which contains code to match a phone number to a contact phone number. It should match numbers that contain different spaces between the digits (when people store them they may store them in different formats).

 

First I thought of pulling out all the contacts in a query, then cyling through them using the trim() function on a string to match them. This seems wasteful though and there might be more contacts than the maximum number of records you are allowed to return.

 

So I then thought of creating a new string from the phone number I am matching with a '%' before and after each digit. 

Eg. '07734654342' would become '%0%7%7%3%4%6%5%4%3%4%2%' then embedding that string in a query like:

//The phone string with the % chars is wildPhone Contact[] contact = SELECT Name FROM Contact WHERE Phone LIKE :wildPhone];

 I'm not sure if this will work, but more importantly how do I go about creating that string? I thought there would be a charAt() method on the string like in Java...I can't find one though.

 

Thank you for your help.

 

Matt

 

Hi,

 

I have a piece of javascript that I include in the head of the VF page using the <apex:includescript> tag and a static resource. It is listening for an event, which when detected causes a function to fire. In the old S-Control version there would then be some database operations using the connection.js library but from what I can gather this is the wrong way to go about it now with VF.

 

So my question is how can I hook in apex code to do my database operations? I want to completely stop using connection.js, but the trigger must be contained in the javascript in a static resource...

 

Thanks

 

Matt

Hi,

 

Once a custom object has been created is it possible to still add custom fields to it? I don't mind if data is lost...

 

At the moment if I click on 'Edit' next to the custom object it only gives me a very limited set of options, none of which allow me to add/change fields.

 

Thanks

 

Matt

Hi,

 

I have a VF page as a homepage component specifically so it loads some script each time the user changes page (this used to be done by an S-control but we are moving it over). 

 

My problem is I am no longer able to reference a variable within the iframe from a custom button (using the execute javascript on-click). With the S-control it was simply:

 

iframe.var

 

Unfortunately this isn't working for the VF page and iframe - I think it maybe because the script is embedded within the body of the apex page as opposed to in the head - is there a way of making the script in a visualforce page appear in the head?

 

 

Thanks

 

Matt

Hi,

 

I was wondering if anyone has had any joy with opening a popup window in salesforce using javascript which they can then communicate with (ie. call javascript functions on the popup from the main window)? At the moment I have a custom link that opens the popup window (a VF page) but then it cannot reference javascript functions on the popup. I think this is because the javascript on the custom link is embedded in the page weirdly...is there another way on the homepage of declaring some javascript in a neat way?

 

Thank you for your help.

Hi,

 

I am including a simple VF page (for now just the default 'Congratulations'example) in the left hand navigation section of the homepage (so it will be loaded each time a new page is navigated to).

 

To achieve this I have used the suggested IFRAME option:

 

<iframe src="/apex/test2" width="10" frameborder="0" height="10"></iframe>

 

Unfortunately I keep getting the IE security warning that this page contains unsecure items, do I wish to load it.In Firefox it works fine.

 

If I navigate manually to the page there is no security issue (as you would expect as it is the very simple VF default page). So there must be something wrong with the way I'm using the iframe...can anyone immediately point out where I am being stupid?

 

Thank you!

 

 

Message Edited by mattpick1 on 10-20-2009 03:46 AM

Hi,

 

Once a custom object has been created is it possible to still add custom fields to it? I don't mind if data is lost...

 

At the moment if I click on 'Edit' next to the custom object it only gives me a very limited set of options, none of which allow me to add/change fields.

 

Thanks

 

Matt

Hi,

 

I have this javascript that automatically re-directs a user to the log a call page when an event happens:

 

window.parent.location.href = "/00T/e?title=Call&who_id={!Contact.Id}&followup=1&tsk5=Call&retURL=%2F{!Contact.Id}";

 


The 'retURL' portion of the url is set to return the user to the contact they were looking at's page.

 

Unfortunately this is not happening, instead when the call has been logged and the user clicks 'save' (which appears to be redirecting the user to '/00T/e') the user has to log in again.

 

This has to be done with javascript as other things are going on before the user is re-directed. Any ideas how I can get it to return to the contact page?

 

Thanks

 

Matt

Hi,

 

I am writing an Apex trigger which contains code to match a phone number to a contact phone number. It should match numbers that contain different spaces between the digits (when people store them they may store them in different formats).

 

First I thought of pulling out all the contacts in a query, then cyling through them using the trim() function on a string to match them. This seems wasteful though and there might be more contacts than the maximum number of records you are allowed to return.

 

So I then thought of creating a new string from the phone number I am matching with a '%' before and after each digit. 

Eg. '07734654342' would become '%0%7%7%3%4%6%5%4%3%4%2%' then embedding that string in a query like:

//The phone string with the % chars is wildPhone Contact[] contact = SELECT Name FROM Contact WHERE Phone LIKE :wildPhone];

 I'm not sure if this will work, but more importantly how do I go about creating that string? I thought there would be a charAt() method on the string like in Java...I can't find one though.

 

Thank you for your help.

 

Matt

 

Hi,

 

I have a piece of javascript that I include in the head of the VF page using the <apex:includescript> tag and a static resource. It is listening for an event, which when detected causes a function to fire. In the old S-Control version there would then be some database operations using the connection.js library but from what I can gather this is the wrong way to go about it now with VF.

 

So my question is how can I hook in apex code to do my database operations? I want to completely stop using connection.js, but the trigger must be contained in the javascript in a static resource...

 

Thanks

 

Matt

Hi,

 

Once a custom object has been created is it possible to still add custom fields to it? I don't mind if data is lost...

 

At the moment if I click on 'Edit' next to the custom object it only gives me a very limited set of options, none of which allow me to add/change fields.

 

Thanks

 

Matt

Hello All,

 

As new Scontrol is no longer supported in development.

Is there any risk to use of connection.js and  apex.js in visualforce pages?

 

Just want an expert thought and discussion on this.

 

 

Thanks

Hi,

 

I have a VF page as a homepage component specifically so it loads some script each time the user changes page (this used to be done by an S-control but we are moving it over). 

 

My problem is I am no longer able to reference a variable within the iframe from a custom button (using the execute javascript on-click). With the S-control it was simply:

 

iframe.var

 

Unfortunately this isn't working for the VF page and iframe - I think it maybe because the script is embedded within the body of the apex page as opposed to in the head - is there a way of making the script in a visualforce page appear in the head?

 

 

Thanks

 

Matt

Hi,

 

I was wondering if anyone has had any joy with opening a popup window in salesforce using javascript which they can then communicate with (ie. call javascript functions on the popup from the main window)? At the moment I have a custom link that opens the popup window (a VF page) but then it cannot reference javascript functions on the popup. I think this is because the javascript on the custom link is embedded in the page weirdly...is there another way on the homepage of declaring some javascript in a neat way?

 

Thank you for your help.

Hi,

 

I am including a simple VF page (for now just the default 'Congratulations'example) in the left hand navigation section of the homepage (so it will be loaded each time a new page is navigated to).

 

To achieve this I have used the suggested IFRAME option:

 

<iframe src="/apex/test2" width="10" frameborder="0" height="10"></iframe>

 

Unfortunately I keep getting the IE security warning that this page contains unsecure items, do I wish to load it.In Firefox it works fine.

 

If I navigate manually to the page there is no security issue (as you would expect as it is the very simple VF default page). So there must be something wrong with the way I'm using the iframe...can anyone immediately point out where I am being stupid?

 

Thank you!

 

 

Message Edited by mattpick1 on 10-20-2009 03:46 AM