• enrydev
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

How can test this class?

global class CustomerPortalRevokeSchedulable implements Schedulable {

    global void execute(SchedulableContext c)
    {   
        CustomerPortalRevokeBatch theC = new CustomerPortalRevokeBatch();
        Database.executeBatch(theC);                 
    }
}

Thanks in advantage for any advice.

I'm creating a custom VF page for the registration of new users.

Page: simple form to get the user's email.

Controller:

 

public with sharing class SiteRegisterController {

    public SiteRegisterController () {
    }


public String username {get; set;}
public String email {get; set;}
public String password {get; set;}

    public PageReference registerUser() {
       user u = [select id,username from User where username = :email];
           if (u!=null) {
                  //ADD HERE CODE FOR ERROR MESSAGE IN THE PAGE FORGOTPASSWORD
                  PageReference page = System.Page.ForgotPassword;
                page.setRedirect(true);
                return page;
            }
            else {
                PageReference page = new PageReference('http://registration.com/');
                page.setRedirect(true);
                return page;
            }

        return null;
    }
}

 If the user is already registered i would like also add a message "You are already registered, Did you forget your password?" on the new page System.Page.ForgotPassword;. I know how to add an eror message in the current page

 

 

ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Error Message.');
ApexPages.addMessage(myMsg); 

 

but is it also possible add it in a new page(forgotpassword) from the controller of the current page? Of course in the page forgot password there is a tag 

<apex:pageMessages id="error"/>

 

 

 

Thanks in advantage for any advice.

BR.

 

 

 

 

 

I'm trying to write a soql query to get all the content's ids of the related content on a custom object.

I would like to know which are the related content of a record. 

 

I have tried with Schema Explorer but have access to related content informations looks impossible.

Is it possible?

Thanks in advantage for any advice.

BR

I'm trying to write a soql query to get all the content's ids of the related content on a custom object.

I would like to know which are the related content of a record. 

 

I have tried with Schema Explorer but have access to related content informations looks impossible.

Is it possible?

Thanks in advantage for any advice.

BR