• sugandha
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies

Hi i have used iframe to display the report on a visual force page but the chart was not visible on it and also only a small part of report was visible. Following is the code i have used.

<apex:page >
<apex:iframe src="/00O90000003Od1l"/> ------> this is the iD of report generated
</apex:page>

 

Kindly help

Hi

    I have to code for a batch job which uploads a file from the computer on a given selected time.

Kindly help 

Hi, 

     i want to insert value  calculated in a controller into a custom object how can i do this??? kindly help its urget

Hi everyone ,

I am new to force.com. I am creating this risk calculating application. I want to save the value of username and role taken from user into a custom object .

My custom object has two fields :-

loginuser and 

 

 The controller is :_

 

 

**
* An apex class that creates a portal user
*/
public with sharing class SiteRegisterController1 {
// PORTAL_ACCOUNT_ID is the account on which the contact will be created on and then enabled as a portal user.
// you need to add the account owner into the role hierarchy before this will work - please see Customer Portal Setup help for more information.
private static Id PORTAL_ACCOUNT_ID = '0019000000PH5yx';
String[] Roles = new String[]{};

public SiteRegisterController1 () {
}
public String username {get; set;}
public String email {get; set;}
public String password {get; set {password = value == null ? value : value.trim(); } }
public String confirmPassword{get; set { confirmPassword = value == null ? value : value.trim(); } }
public String fullName{get;set{fullName = value == null ? value : value.trim(); } }
public String Rolees{get;set;}


public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Administrator','Administrator'));
options.add(new SelectOption('Supervisor','Supervisor'));
options.add(new SelectOption('Portfolio Manager','Portfolio Manager'));
return options;
}
public String[] getRoles() {
return roles;
}

public void setroles(String[] roles) {
this.roles = roles;
}

private boolean isValidPassword() {
return password == confirmPassword;
}

public PageReference registerUser() {
// it's okay if password is null - we'll send the user a random password in that case
if (!isValidPassword()) {
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match);
ApexPages.addMessage(msg);
return null;
}
User u = new User();
u.Username = username;
u.Email = email;
u.CommunityNickname = fullName;

role_redirect_table t=new role_redirect_table();

t. loginuser=username;

t.role_specified_in_login=rolees;



String accountId = PORTAL_ACCOUNT_ID;

// lastName is a required field on user, but if it isn't specified, we'll default it to the username
String userId = Site.createPortalUser(u, accountId, password);
if (userId != null) {
if (password != null && password.length() > 1) {
return Site.login(username, password, null);
}
else {
PageReference page = System.Page.SiteRegisterConfirm;
page.setRedirect(true);
return page;
}
}
return null;
}

// Test method to bring this class's test coverage over the required 75%
@IsTest(SeeAllData=true) static void testRegistration() {
SiteRegisterController1 controller = new SiteRegisterController1();
controller.username = 'test@force.com';
controller.email = 'test@force.com';
controller.fullName = 'test';
// registerUser will always return null when the page isn't accessed as a guest user
System.assert(controller.registerUser() == null);

controller.password = 'abcd1234';
controller.confirmPassword = 'abcd123';
System.assert(controller.registerUser() == null);
}
}

 

 

I want to save the roles and username into the custom object that i have created.. i have highlighted the code. Kindly help.

 i want the functionlaity of dropdown(select list) and a button to  browse file from computer both on the same page...

Hi everyone ,

I am new to force.com. I am creating this risk calculating application. I want to save the value of username and role taken from user into a custom object .

My custom object has two fields :-

loginuser and 

 

 The controller is :_

 

 

**
* An apex class that creates a portal user
*/
public with sharing class SiteRegisterController1 {
// PORTAL_ACCOUNT_ID is the account on which the contact will be created on and then enabled as a portal user.
// you need to add the account owner into the role hierarchy before this will work - please see Customer Portal Setup help for more information.
private static Id PORTAL_ACCOUNT_ID = '0019000000PH5yx';
String[] Roles = new String[]{};

public SiteRegisterController1 () {
}
public String username {get; set;}
public String email {get; set;}
public String password {get; set {password = value == null ? value : value.trim(); } }
public String confirmPassword{get; set { confirmPassword = value == null ? value : value.trim(); } }
public String fullName{get;set{fullName = value == null ? value : value.trim(); } }
public String Rolees{get;set;}


public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('Administrator','Administrator'));
options.add(new SelectOption('Supervisor','Supervisor'));
options.add(new SelectOption('Portfolio Manager','Portfolio Manager'));
return options;
}
public String[] getRoles() {
return roles;
}

public void setroles(String[] roles) {
this.roles = roles;
}

private boolean isValidPassword() {
return password == confirmPassword;
}

public PageReference registerUser() {
// it's okay if password is null - we'll send the user a random password in that case
if (!isValidPassword()) {
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match);
ApexPages.addMessage(msg);
return null;
}
User u = new User();
u.Username = username;
u.Email = email;
u.CommunityNickname = fullName;

role_redirect_table t=new role_redirect_table();

t. loginuser=username;

t.role_specified_in_login=rolees;



String accountId = PORTAL_ACCOUNT_ID;

// lastName is a required field on user, but if it isn't specified, we'll default it to the username
String userId = Site.createPortalUser(u, accountId, password);
if (userId != null) {
if (password != null && password.length() > 1) {
return Site.login(username, password, null);
}
else {
PageReference page = System.Page.SiteRegisterConfirm;
page.setRedirect(true);
return page;
}
}
return null;
}

// Test method to bring this class's test coverage over the required 75%
@IsTest(SeeAllData=true) static void testRegistration() {
SiteRegisterController1 controller = new SiteRegisterController1();
controller.username = 'test@force.com';
controller.email = 'test@force.com';
controller.fullName = 'test';
// registerUser will always return null when the page isn't accessed as a guest user
System.assert(controller.registerUser() == null);

controller.password = 'abcd1234';
controller.confirmPassword = 'abcd123';
System.assert(controller.registerUser() == null);
}
}

 

 

I want to save the roles and username into the custom object that i have created.. i have highlighted the code. Kindly help.

 i want the functionlaity of dropdown(select list) and a button to  browse file from computer both on the same page...