• the_wolf
  • NEWBIE
  • 175 Points
  • Member since 2009

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 24
    Replies

Hi..I have finished writting a trigger I need to write a test class

 

do i need to create a new apex class and write the test class or can i just write the test class in the trigger itself starting my code with @isTest

 

It was giving me an error when I am trying to start the test class where the trigger ended.

Hi all,

 

I have insert many google adsense in my force.com site.


When I am on force.com site domain, it shows all google advertising (this is the site http://esa.force.com/secondhandcampers)

 

But if I see the site under its custom web address, the google advertising does not appear ! (this is the custom web address http://www.secondhandcampers.com)

 

Why the custom web address "delete" the advertising?

 

Thanks in advance!

Hi all,

 

I have insert many google adsense in my force.com site.


When we are on force.com site domain, it shows all google advertising (this is the site http://esa.force.com/secondhandcampers)

 

But if we see the site under its custom web address, the google advertising does not appear ! (this is the custom web address http://www.secondhandcampers.com)

 

Why the custom web address "delete" the advertising?

 

Thanks in advance!

Hi all,

 

I have created a UrlRewriterClass for my force.com site. It works correctly properly for most of the web site pages.

But I do not understand why on some returns Unauhorized page.

 

It has already happened to someone?

 

Thanks in advance for reply!

Hi all,

 

I use in my Visualforce page (version 19.0 ) two picklist, one is master picklist and another is its dependent picklist.

 

I want to take their values in my controller extensions. As described in Summer '10 release, the dependence works correctly in the page.

 

But when i try to get this dependent value, it return null !

 

Here is my simple code:
 

public class DependentExtensions {

public People__c person {get; private set;}
public DependentExtensions(ApexPages.StandardController controller) {
             person = (People__c) controller.getRecord();                
    }
   
public getCountry() {return person.Country__c }
public getRegion() { return person.Region__c }

}   

 

In this example, after click a commandButton (it simply refresh the page),  only the COUNTRY value (the master picklist) it returned in picklist box and in the get text.

While the REGION dependent picklist it returned '-None-' in picklist box and return an empty text !!

 

This is a bug of this new feature or there is a way to fix it??

 

Thanks in advance!

 

Hi all,

 

I have an Apex trigger that send "N" mails, where n is the records of a custom object. If I insert more than 10 records, I receive the error "Too mail invocation: 11" .

 

I need to send 15 mails or more, but not necessary simultaneously ( for example sending remaining emails after 5 minutes).

 
 Can you give me a suggestion on how can I send more than 10 emails?

 

Thanks in advance!

Hi all,

 

I have a workflow that sends an email after 72 hours from activation date of the rule (a field value insert or update).

 

So, it works fine when I update this field throw user interface, or throw an Apex trigger insert. But it not fired when the field is updated throw an Apex trigger update.

 

I read in the Salesforce on line guide this consideration on time based workflow:

"Time-based workflow rules are not reevaluated if an Apex post trigger executed as a result of a workflow rule or approval process updates a field so its value no longer meets the time-based workflow rule criteria."

What does this mean exactly?


And how do I activate that rule anyway? I need it after an automatic update of the field by Apex trigger.

 

Thanks in advance!

Hi all,

 

in new feature URL rewriter to navigate correctly from one page to another, it need to use URLFOR function with $page variable. Example:

<apex:outputLink value="{!URLFOR($Page.myOtherPage)}" />

 

But i have this commandButton that not work with my site that have enabled URL rewriter ! It return "Site in Maintenence" after click this button, and not myPage!

 

This is the button:

<apex:commandButton action="{!search}" value=" " styleClass="trova" id="searchButton"/>

 

 

And here is the code in my controller:

public PageReference cerca() {
               
        PageReference acctPage = Page.myPage;
        acctPage.setRedirect(true);
                
        return acctPage;

     }

 

How to set good the apex:commandButton, as the outputLink with $Page variable?

 

Thanks in advance!

 

 

Hi all,

 

I tried in my sandbox the new feature of summer '10, the url rewriter, illustrated in the following blog:

http://blog.sforce.com/sforce/2010/05/url-rewriting-for-your-customizing-your-site-urls.html

 

Now I want to copy it on production, but needs testing.

 

So, I create a class similar to that shown in the blog, and my initial test code is:

 

 static testMethod void testURLrewriter(){
  
  // I try to create the internal saleforce pageReference

      pageReference myPage = new pageReference('/apex/myPage');
      Test.setCurrentPage(myPage);
      myPage.setRedirect(true);
  
  List<PageReference> res = new List<PageReference>();
      res.add(myPage);
      res.add(new PageReference('/apex/myPage2' ));         
             
      // now call the methods

  ClassUrlRewriter urlClass = new ClassUrlRewriter();

  urlClass.mapRequestUrl(myPage);
  urlClass.generateUrlFor(res);
  }
 

Calling methods, the code coverage stops at the first if (where it controls the site.getUrl) How can I test a getUrl of a site, knowing that this class will be moved to the production ?

 

 

Thanks in advance!

 

Hi all,

 

I have a site with a score of Visualforce pages. This site has 5 different languages and each page is set with custom labels as suggested in the guide in this link:


http://wiki.developerforce.com/index.php/An_Introduction_to_Force.com_Sites

under Multi Language Support section.

Each page contains many links and buttons that let you navigate from page to another. But how do I keep the same language parameter (example ?lang=fr) when this happens?

Thanks in advance

 

Hi all

 

Is it easy to insert a google map in my visualforce page? I think that to insert a map is sufficient to make a copy and paste the code (which contains an iframe) generated by Google.

 

But in the IFRAME box there is the entire page of google instead of the mini-map!

 

Here's the code:

 

<iframe width="300" height="100" scrolling="no" src="http://maps.google.com/maps?q=ADDRESS...;">
<iframe><br /><small><a href="http://maps.google.com/maps?q=ADDRESS..." style="color:#0000FF;text-align:left">
Visualizzazione ingrandita della mappa</a></small>

 

I'm tried also to substitute the iframe tag with <apex:iframe> tag , but I obtain the same result.

 

So how can I insert the Google map throw the generated "iframe" code?

 

Thanks in advance

Hi all, 

 

i'm trying to use Rich Text Field on a Salesforce site's page with a custom controller. 

I updated both the controller and Visualforce page version at 18.0 :

 

- the controller, after this save, works correctly 
- but when i try to saving the version of this visualforce page, the error will appear is: 
"Error: Invalid field Description__c for SObject Ospitalita__c" 
(Description__c is the Rich Text Field) 


For your info, if i insert this rich text field in a empty visualforce page, it works correctly. 
But i give the error in my site pages , which have the template tags (apex:composition and apex:insert) . 

Are "this tags" the problem? 

How can i fix it? 
I need apex:composition and apex:insert and i don't want to delete them or substitute with component.

 

Thanks in advance!! 

Hi all,

 

i have two custom objects. In first object there is a reference look up field to second object. 

 

When i try to click the look up icon , in the search window there aren't all record of second object (if i put * as search parameter), but only some of them (in my case it shows 4 records, but in the object there are 17 records!) 

 

What could be the reason?

 

Thanks in advance!! 

Hi all,

 

i have this tag, which should display an image (the id is stored in a custom field ):

 

<apex:image value="/servlet/servlet.FileDownload?file={!p.image_id__c}" width="113" height="86" align="left" />

 

I need, in my website, that the text is placed to the right of this picture, but the "align" parameter does not exist in tag <apex:image>.

 

How can i do?

 

Thanks in advance!! 

Message Edited by the_wolf on 02-03-2010 01:48 AM

Hi all,

 

i have a complete flash object (named main2.swf, which views 3 random pictures) in an html page (local host).

 

I want to copy this flash in a visualforce page in my sandbox org, but there are more problems.

 

I think the main problem is probably the different source, the file associated with the "main2.swf" (XML file , image folder and ActionScript files) is all in a zip Static Resource file.

 

There is the code in html:

 

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
     width="400" height="200" id="main2" align="middle">
   
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="{!URLFOR($Resource.Flash_sito,'Optimist/main2.swf')}" />
    <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
    <embed src="{!URLFOR($Resource.Flash_sito,'Optimist/main2.swf')}" quality="high" bgcolor="#ffffff" width="400" height="200"
     name="main2" align="middle" allowFullScreen="false" type="application/x-shockwave-flash"
     pluginspage="http://www.macromedia.com/go/getflashplayer" />

</object>

 

I also tryed to change the tag object into <apex:flash> but i don't see any results...

 

<apex:flash src="{!URLFOR($Resource.Flash_sito,'Optimist/main2.swf')}" width="400" height="200" />

 

What should I do more?

 

Thanks in andvance for help!

Message Edited by the_wolf on 08-25-2009 08:48 AM

Hi all,

 

I have insert many google adsense in my force.com site.


When I am on force.com site domain, it shows all google advertising (this is the site http://esa.force.com/secondhandcampers)

 

But if I see the site under its custom web address, the google advertising does not appear ! (this is the custom web address http://www.secondhandcampers.com)

 

Why the custom web address "delete" the advertising?

 

Thanks in advance!

Hi all,

 

I have created a UrlRewriterClass for my force.com site. It works correctly properly for most of the web site pages.

But I do not understand why on some returns Unauhorized page.

 

It has already happened to someone?

 

Thanks in advance for reply!

We are using Customer Portal with High Volume Customer Portal Licenses and Person Accounts (Winter11)  - we have enabled a custom object tab in the Customer Portal tab settings, the object is deployed and available for Customer Portal, the fields on the object are accessible by the High Volume Customer Portal User Profile and the Person Account has a valid license and can log in to the Customer Portal. The Custom Object has public read/write access and no relationshiops or dependencies to other objects. The Custom Object Tab does not show to the logged in user or to an admin using Login as Portal User - is there anything else needed to enable a custom object's Tab visibility in the Customer Portal? 

  • October 31, 2010
  • Like
  • 0

Hi all,

 

I use in my Visualforce page (version 19.0 ) two picklist, one is master picklist and another is its dependent picklist.

 

I want to take their values in my controller extensions. As described in Summer '10 release, the dependence works correctly in the page.

 

But when i try to get this dependent value, it return null !

 

Here is my simple code:
 

public class DependentExtensions {

public People__c person {get; private set;}
public DependentExtensions(ApexPages.StandardController controller) {
             person = (People__c) controller.getRecord();                
    }
   
public getCountry() {return person.Country__c }
public getRegion() { return person.Region__c }

}   

 

In this example, after click a commandButton (it simply refresh the page),  only the COUNTRY value (the master picklist) it returned in picklist box and in the get text.

While the REGION dependent picklist it returned '-None-' in picklist box and return an empty text !!

 

This is a bug of this new feature or there is a way to fix it??

 

Thanks in advance!

 

Hi all,

 

I have an Apex trigger that send "N" mails, where n is the records of a custom object. If I insert more than 10 records, I receive the error "Too mail invocation: 11" .

 

I need to send 15 mails or more, but not necessary simultaneously ( for example sending remaining emails after 5 minutes).

 
 Can you give me a suggestion on how can I send more than 10 emails?

 

Thanks in advance!

Hi all,

 

I have a workflow that sends an email after 72 hours from activation date of the rule (a field value insert or update).

 

So, it works fine when I update this field throw user interface, or throw an Apex trigger insert. But it not fired when the field is updated throw an Apex trigger update.

 

I read in the Salesforce on line guide this consideration on time based workflow:

"Time-based workflow rules are not reevaluated if an Apex post trigger executed as a result of a workflow rule or approval process updates a field so its value no longer meets the time-based workflow rule criteria."

What does this mean exactly?


And how do I activate that rule anyway? I need it after an automatic update of the field by Apex trigger.

 

Thanks in advance!

Hi..I have finished writting a trigger I need to write a test class

 

do i need to create a new apex class and write the test class or can i just write the test class in the trigger itself starting my code with @isTest

 

It was giving me an error when I am trying to start the test class where the trigger ended.

I'm Trying to write a trigger that I can call from multiple custom objects.  I would like the trigger to pass an id from the object which is currently in focus to a class.  

Resource contains the field hourly rate, which is needed on both the Resource Assignment, and Time objects. Both are related to the Resource object.Ultimately the hourly rate field from the Resource Assignment, and Time objects are used in calculations on another object so a Rollup field is not an option.  

Here is how I envision it going:

 

trigger RAHourlyRate on Resource_Assignment__c(before insert, before update) {
     HourlyRate.Rate(/*pass the resource ID from the Resource Assignment Ojbect*/);
}
trigger TimeHourlyRate on Time(before insert, before update) {
     HourlyRate.Rate(/*pass the resource ID from the Time Management Ojbect*/);
}

public class HourlyRate{ 
  

  public static void Rate() { 
	/*Variable to receive the Resource ID passed from either the Resource assignment or Time Objects*/
   
    
    for(Resource r:[SELECT id, Hourly_Rate__c FROM Resource__c
            WHERE id = :Variable passed in from trigger]) {
      Resource_Assignment__c.hourly_rate__c = r.hourly_rate__c;
    } 
    Update Resource_Assignment__c;
    
  } 
} 

 

How do I pass the resource ID from the trigger to the class?
Will this work how I envision it or is this completely incorrect?

Thank you in advance for your help.

 

Hi,

 

I need to run the following query in an apex trigger:

 

I need to select contact where Account.Name IN(myArrOfAccount)

 

How dow I run this in apex?

 

Here is a sample code that I am trying to run:

 

 

String[] accs = myObj.MyMultiSelectPickList__c.split(';');

								
				Contact[] contacts = [select c.Email from Contact c where c.Account.Name IN :accs and c.ActiveCustomUser__c = true];
				

 

 

The above code simply took all the values from the pick list intead of only the selected values.

 

Any ideas.

 

Thanks in advance.

Hi all,

 

I tried in my sandbox the new feature of summer '10, the url rewriter, illustrated in the following blog:

http://blog.sforce.com/sforce/2010/05/url-rewriting-for-your-customizing-your-site-urls.html

 

Now I want to copy it on production, but needs testing.

 

So, I create a class similar to that shown in the blog, and my initial test code is:

 

 static testMethod void testURLrewriter(){
  
  // I try to create the internal saleforce pageReference

      pageReference myPage = new pageReference('/apex/myPage');
      Test.setCurrentPage(myPage);
      myPage.setRedirect(true);
  
  List<PageReference> res = new List<PageReference>();
      res.add(myPage);
      res.add(new PageReference('/apex/myPage2' ));         
             
      // now call the methods

  ClassUrlRewriter urlClass = new ClassUrlRewriter();

  urlClass.mapRequestUrl(myPage);
  urlClass.generateUrlFor(res);
  }
 

Calling methods, the code coverage stops at the first if (where it controls the site.getUrl) How can I test a getUrl of a site, knowing that this class will be moved to the production ?

 

 

Thanks in advance!

 

Hi all,

 

I have a site with a score of Visualforce pages. This site has 5 different languages and each page is set with custom labels as suggested in the guide in this link:


http://wiki.developerforce.com/index.php/An_Introduction_to_Force.com_Sites

under Multi Language Support section.

Each page contains many links and buttons that let you navigate from page to another. But how do I keep the same language parameter (example ?lang=fr) when this happens?

Thanks in advance

 

Hi all

 

Is it easy to insert a google map in my visualforce page? I think that to insert a map is sufficient to make a copy and paste the code (which contains an iframe) generated by Google.

 

But in the IFRAME box there is the entire page of google instead of the mini-map!

 

Here's the code:

 

<iframe width="300" height="100" scrolling="no" src="http://maps.google.com/maps?q=ADDRESS...;">
<iframe><br /><small><a href="http://maps.google.com/maps?q=ADDRESS..." style="color:#0000FF;text-align:left">
Visualizzazione ingrandita della mappa</a></small>

 

I'm tried also to substitute the iframe tag with <apex:iframe> tag , but I obtain the same result.

 

So how can I insert the Google map throw the generated "iframe" code?

 

Thanks in advance

Hi all, 

 

i'm trying to use Rich Text Field on a Salesforce site's page with a custom controller. 

I updated both the controller and Visualforce page version at 18.0 :

 

- the controller, after this save, works correctly 
- but when i try to saving the version of this visualforce page, the error will appear is: 
"Error: Invalid field Description__c for SObject Ospitalita__c" 
(Description__c is the Rich Text Field) 


For your info, if i insert this rich text field in a empty visualforce page, it works correctly. 
But i give the error in my site pages , which have the template tags (apex:composition and apex:insert) . 

Are "this tags" the problem? 

How can i fix it? 
I need apex:composition and apex:insert and i don't want to delete them or substitute with component.

 

Thanks in advance!! 

Hi all,

 

i have two custom objects. In first object there is a reference look up field to second object. 

 

When i try to click the look up icon , in the search window there aren't all record of second object (if i put * as search parameter), but only some of them (in my case it shows 4 records, but in the object there are 17 records!) 

 

What could be the reason?

 

Thanks in advance!!