-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
24Questions
-
14Replies
very urgent issue on customer portal
HI
I am new to Customer portal .
my requirement is to login into website which i have used Visualforce page so i am using default logincontroller but problem is it is redirecting again login page.
But i want to redirect to other visualforce page.
can any one help on this issue.
here i am posting my Controller:
global with sharing class SiteLoginController {
global String username {get; set;}
global String password {get; set;}
global PageReference login() {
String startUrl = System.currentPageReference().getParameters().get('startURL');
return Site.login(username, password, startUrl );
}
-
- DivyaReddy
- October 24, 2011
- Like
- 0
- Continue reading or reply
very urgent issue on customer portal
How can i redirect to other visualforce page when the login credential is true.
Here i am posting my code :
global with sharing class SiteLoginController {
global String username {get; set;}
global String password {get; set;}
global PageReference login() {
String startUrl = System.currentPageReference().getParameters().get('startURL');
return Site.login(username, password, startUrl);
// return null;
//return.page.Account;
}
if return null is giving it is returing nothing as usally.
if return page.Account; is giving then it is redirecting with out validating login credential is true.
Can any one help on this issue.
-
- DivyaReddy
- October 21, 2011
- Like
- 0
- Continue reading or reply
very urgent issue on customer portal
How can i redirect to other visualforce page when the login credential is true.
Here i am posting my code :
global with sharing class SiteLoginController {
global String username {get; set;}
global String password {get; set;}
global PageReference login() {
String startUrl = System.currentPageReference().getParameters().get('startURL');
return Site.login(username, password, startUrl);
// return null;
//return.page.Account;
}
if return null is giving it is returing nothing as usally.
if return page.Account; is giving then it is redirecting with out validating login credential is true.
Can any one help on this issue.
-
- DivyaReddy
- October 21, 2011
- Like
- 0
- Continue reading or reply
very urgent issue.....
hi
my requirement is to add the rows & column values like
1 2 3 = 6
2 3 1 = 6
1 1 1 = 3
4 6 5
so i wrote code like this but will saving
Error: Compile Error: Invalid type: objBudClass at line 19 column 40 .
Can any one help on this issue.
Thank q .
public class GroupedQuery123
{
public list<AggregateResult> lstAr = new list<AggregateResult>();
public GroupedQuery123()
{
lstar = [SELECT Product_Service_Category_Poc__c, Case_Type_Poc__c ,
GROUPING(Product_Service_Category_Poc__c ) p1 , GROUPING(Case_Type_Poc__c ) p2,
COUNT(casenumber) tot1
FROM Case
where CreatedDate = THIS_WEEK and Status = 'open'
GROUP BY CUBE(Product_Service_Category_Poc__c , Case_Type_Poc__c )
order by GROUPING(Product_Service_Category_Poc__c ) , GROUPING(Case_Type_Poc__c )];
}
public list<BudClass> getResults(){
list<BudClass> lstResult = new list<BudClass>();
for(AggregateResult ar : lstAr){
BudClass objBudClass = new objBudClass(ar);
lstResult.add(objBudClass);
}
return lstResult;
}
class BudClass{
public Double tot1{get;set;}
public String p1 {get;set;}
public String p2 {get;set;}
public BudClass(AggregateResult ar){
tot1 = (Double) ar.get('tot1');
p1= (Double) ar.get('p1');
p2= (String) ar.get('p2');
}
}
}
-
- DivyaReddy
- October 19, 2011
- Like
- 0
- Continue reading or reply
Group By example
HI
Can any one post Group By cube & gruop by roll up code (Apex Class & Visualforce Page).
It may help to me very much ....
Thank q in Advance.....
-
- DivyaReddy
- October 17, 2011
- Like
- 0
- Continue reading or reply
Addition of values in visualforce page level
hi
i am facing trouble while i want to add the values of displayed items .
For example :
1 2 3 == 6
2 3 1 == 6
3 1 2 == 6
-----------------------------------------
6 6 6
I am using group by clause for getting values.
my query :
Select Count(CaseNumber) tot1 , Product_Service_Category_Poc__c p1,Case_Type_Poc__c p2 from Case where CreatedDate = THIS_WEEK and Status = 'open' group by Product_Service_Category_Poc__c,Case_Type_Poc__c
-
- DivyaReddy
- October 14, 2011
- Like
- 0
- Continue reading or reply
Grouping By One Rollup Field example
HI can any one post controller & its vf page which works for Grouping By One Rollup Field , Grouping By
it may help to me.
-
- DivyaReddy
- October 14, 2011
- Like
- 0
- Continue reading or reply
Chatter Plus Problem.
Hi,
I am having Enterprice Edition and now i am using Chatter plus user .
When i am login througt Chatter plus user then Save Button is becoming disable.
-
- DivyaReddy
- October 10, 2011
- Like
- 0
- Continue reading or reply
Help in Query string parameters...
hi
AM 08:00
i have to divide it as AM 08 00 and i have to save them in fields
Appt_am_pm__c = am
Appt_hour__c = 08
Appt_minute__c = 00.
After that i have to use query string parameters to pass it to other page
can any one help on this ...
-
- DivyaReddy
- September 26, 2011
- Like
- 0
- Continue reading or reply
Dispalying more than 1000 records in to pdf.
hi
i am one requirement , i have to display all values in accounts. I am posting my controller & visualforce page.
public class Raja_Test{
public Raja_Test(ApexPages.StandardController controller)
{ }
public String[] states {get;set;}
public Account[] ac {get;set;}
public Raja_Test()
{
ac = [Select id,name,Bill_To__c,Bill_To__r.Name from account where Bill_To__c != NULL ];
Set<String> stateSet = new Set<String>();
for(Account a : ac)
stateSet.add(a.Bill_To__r.Name);
states = new String[stateSet.size()];
Integer i = 0;
for (String state : stateSet) {
states[i] = state;
i++;
}
states.sort();
}
}
Visulforce Page :
<apex:page Controller="Raja_Test"> <table border = '1'> <apex:repeat value="{!states}" var="a"> <tr> <td>{!a}</td> <tr> <td> <apex:repeat value="{!ac}" var="a1"> <apex:outputPanel rendered="{!IF((a1.Bill_To__r.Name = a) ,true,false)}" > <td>{!a1.name}</td> </apex:outputPanel> </apex:repeat> </td></tr> </tr> </apex:repeat> </table> </apex:page>
Can any one help on this
-
- DivyaReddy
- September 23, 2011
- Like
- 0
- Continue reading or reply
Exporting image on Excel Sheet from visualforce page..
hi to all,
i have a requirement that to covert data from vf page to excel sheet . I am able to export all record & etc... except image field .
Can any one help on this issue..
Here my code :
<apex:page controller="cases_ctrl" contentType="application/msWord" >
<apex:pageBlock title="Cases">
<apex:pageBlockTable value="{!c}" var="c1">
<apex:column value="{!c1.CaseNumber}"/>
<apex:column value="{!c1.Date__c}"/>
<apex:column><apex:image value="{!c1.Images__c}"/></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
-
- DivyaReddy
- September 19, 2011
- Like
- 0
- Continue reading or reply
Help on Converting leads to account & contact ..
HI
i have a requirement to convert account & contact when a lead is created and in lead lead count > 20 .
Can any one help on this issue...
-
- DivyaReddy
- September 17, 2011
- Like
- 0
- Continue reading or reply
Exporting image on Excel Sheet
HI
I want to export image from visualforce page to Excel Sheet................
My code :
<apex:page controller="cases_ctrl" contenttype="application/vnd.ms-excel">
<apex:pageBlock title="Cases">
<apex:pageBlockTable value="{!c}" var="c1">
<apex:column value="{!c1.CaseNumber}"/>
<apex:column value="{!c1.date__c}"/>
<apex:column value="{!c1.image__c}"/>
<apex:image value="{!c1.image__c}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Can any one help on this issue................
-
- DivyaReddy
- September 16, 2011
- Like
- 0
- Continue reading or reply
FIELD_INTEGRITY_EXCEPTION exception
Hi to all ,
I am stuck well writting testcase . i am getting error as :
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Converted Account empty for a Converted Lead.: [ConvertedAccountId].
Here i am posting my triiger & associate test cases.
trigger counsellingNote_Required on Lead (before Update)
{
If(Trigger.New.size()==1)
{
for(Lead newLead: Trigger.new)
{
If(Trigger.new[0].IsConverted == true && Trigger.old[0].IsConverted == false) // Code not covering from here
{
List<Counselling_Note_c__c> counsellingNoteList = new List<Counselling_Note_c__c>
([SELECT Prospect_Name__c FROM Counselling_Note_c__c WHERE Prospect_Name__c = :newLead.Id]);
String errorMsg='';
Boolean flag = false;
if(counsellingNoteList.size()==0)
{
flag = true;
errorMsg += 'Counselling Note - ';
}
if(flag && !Test.isRunningTest())
newLead.addError('Following fields are empty--'+ errorMsg);
}
}
==============
@isTest
private class counsellingNote_Required_TESTS
{
static testMethod void mytestclass()
{
Account a = new Account();
a.Name = 'Test Account';
a.PersonLeadSource = '';
insert a;
Lead l = new Lead ();
l.LastName = 'raja';
l.Status = 'Open';
l.LeadSource = 'Sms';
l.YRN_Branch__c = 'Andheri West, Mumbai - W10';
l.YRN_Country__c = 'India';
l.Type_of_Enquiry__c = 'Telephone';
l.MobilePhone = '9440736154' ;
l.Mobile__c = '9550412970';
l.Phone = '9550412970';
l.IsConverted = true;
// l.ConvertedAccountId = a.id;
insert l;
Lead l1 = new Lead ();
l1.LastName = 'raja';
l1.Status = 'Open';
l1.LeadSource = 'Sms';
l1.YRN_Branch__c = 'Andheri West, Mumbai - W10';
l1.YRN_Country__c = 'India';
l1.Type_of_Enquiry__c = 'Telephone';
l1.MobilePhone = '9440736154' ;
l1.Mobile__c = '9550412971';
l1.Phone = '9550412971';
l1.IsConverted = false;
insert l1;
Counselling_Note_c__c cn = new Counselling_Note_c__c();
cn.Prospect_Name__c = l.id;
cn.Occupation__c = 'Accountant';
cn.Your_Opportunities_exist_in__c = 'USA';
cn.Option__c = 'Migrate';
cn.Country__c = 'Australia';
cn.Services__c = 'Premium Membership';
cn.Recommended_Service_And_Process_Flow__c = 'Test';
cn.Critical_Documents_English_Requirement__c = 'test';
cn.Funds_Requirements__c = 'raja';
cn.Y_Axis_Process_Time__c= '10';
cn.Immigration_Visa_Process_Time__c = 'true';
cn.Y_Axis_Fee__c = '2500';
cn.Migration_Visa_Fee__c = '2500';
cn.Miscellaneous_Cost__c = '2500';
cn.Rejection_Percentage__c = 9;
cn.Immigration_Rules_Change_Percentage__c = 9;
cn.Next_Action_Item__c = 'Pay for Technical Evaluation';
cn.Date__c = system.today();
insert cn;
cn.Prospect_Name__c = l1.id;
update cn;
}
}
-
- DivyaReddy
- September 16, 2011
- Like
- 0
- Continue reading or reply
Help on test case ..
Can any one sugesst me to cover this part
Else If(Trigger.IsUpdate)
{
String ProfileName = [SELECT Profile.Name FROM User where Id = :Trigger.New[0].OwnerId].Profile.Name;
If(Trigger.New[0].OwnerId != Trigger.Old[0].OwnerId)
{
If(ProfileName.contains('Sales'))
{
Trigger.New[0].Sales_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Sales_Consultant__c != null)
{
Trigger.New[0].Sales_Consultan__c = Trigger.New[0].OwnerId;
}
}
if(ProfileName.contains('Process'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Process_Consultant__c != null)
{
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
}
-
- DivyaReddy
- September 15, 2011
- Like
- 0
- Continue reading or reply
Help on test case ..
Hi
I got 21 % can any one help to make me code coverage in between 80 % to 100 %.
trigger trgCaptureConsultants on Opportunity (before Insert, before Update) {
If(Trigger.New.Size() == 1)
{
If(Trigger.IsInsert)
{
String ProfileName = [SELECT Profile.Name FROM User where Id = :Trigger.New[0].OwnerId].Profile.Name;
If(ProfileName.contains('Sales'))//&& (Trigger.New[0].Sales_Consultant__c == Null || Trigger.New[0].Sales_Consultant__c == '')
{
Trigger.New[0].Sales_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Sales_Consultan__c == null)
{
Trigger.New[0].Sales_Consultan__c = Trigger.New[0].OwnerId;
}
}
if(ProfileName.contains('Process') ) //&& (Trigger.New[0].Process_Consultant__c == Null || Trigger.New[0].Process_Consultant__c == ''))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Process_Consultant_User__c == null)
{
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
if( ProfileName.contains('Evaluation'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
Else If(Trigger.IsUpdate)
{
String ProfileName = [SELECT Profile.Name FROM User where Id = :Trigger.New[0].OwnerId].Profile.Name;
If(Trigger.New[0].OwnerId != Trigger.Old[0].OwnerId)
{
If(ProfileName.contains('Sales'))
{
Trigger.New[0].Sales_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Sales_Consultant__c != null)
{
Trigger.New[0].Sales_Consultan__c = Trigger.New[0].OwnerId;
}
}
if(ProfileName.contains('Process'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Process_Consultant__c != null)
{
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
}
if(ProfileName.contains('Evaluation'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
}
/* The below section of code checks whether the Product associated with the opportunity
contains some specific set of characters. if they are found then the record type of the
Opportunity is updated accordingly*/
OpportunityLineItem[] OppLineItems = [SELECT PricebookEntry.Product2Id, PricebookEntry.Product2.Name FROM OpportunityLineItem where Opportunity.Id In :Trigger.New];
If(OppLineItems.Size()==1)
{
String ProductName = OppLineItems[0].PricebookEntry.Product2.Name;
Map<String,Id> RecordTypeMap = New Map<String,Id>();
For(RecordType RecType : [SELECT Id, Name, SobjectType FROM RecordType Where SobjectType = 'Opportunity'])// and Name in ('CAN','AUS','HSW','DEN','JAS','VISA','Evaluation')])
{
RecordTypeMap.put(RecType.Name , RecType.Id);
}
/* Record Type should change only when the Opportunity is moving to Process*/
If (Trigger.New[0].StageName == 'Evaluation Sale Made' && Trigger.New[0].Apply_For_Exception_Withdrawal_Refund__c != TRUE )
{
Trigger.New[0].RecordTypeId = RecordTypeMap.get('Evaluation');
}
Else If (Trigger.New[0].StageName == 'Send to Process Consultant'&& Trigger.New[0].Apply_For_Exception_Withdrawal_Refund__c != TRUE )
{
For(String RecTypeString: RecordTypeMap.KeySet())
{
If(ProductName.startsWith(RecTypeString))
Trigger.New[0].RecordTypeId = RecordTypeMap.get(RecTypeString);
}
}
}
}
Mine test class :
@isTest
private class trgCaptureConsultants_TESTS{
static testMethod void mytestclass(){
Account a = [Select id, name from account limit 1 ];
//Opportunity o = [Select id ,name,Process_Consultant__c from opportunity where accountid =: a.id and Process_Consultant__c != ''];
User u = [Select Profile.Name,id FROM User where Profile.Name != 'Sales' limit 1 ];
Opportunity o = new Opportunity();
o.name = 'raja';
o.Accountid = a.id;
o.StageName = 'Opened';
o.CloseDate = system.today();
o.Process_Consultant__c = '0053000000203VvAAI';
o.Sales_Consultan__c = null ;
o.StageName = 'Evaluation Sale Made';
o.Apply_For_Exception_Withdrawal_Refund__c = False ;
insert o;
Case c = new Case ();
c.accountid = a.id;
c.OwnerId = o.Process_Consultant__c;
c.Opportunity_Name__c = o.id;
c.Status = 'New';
c.Origin = 'Email';
c.Case_Reason__c = 'Process';
c.Type = 'Suggestions';
try{
Insert c;
Update c;
}
catch (Exception e)
{}
}
}
-
- DivyaReddy
- September 15, 2011
- Like
- 0
- Continue reading or reply
Regarding test case
Hi
This is my trigger and can any one help me with the test case
trigger trgPopulateProcessConsultant on Case (before Insert, before Update) {
If(Trigger.New.Size() == 1)
{
If(Trigger.New[0].AccountId != Null)
{
Opportunity[] Opp = [Select Id, Sales_Consultant__c, Process_Consultant__c from Opportunity where AccountId = :Trigger.New[0].AccountId Order By CreatedDate Desc];
If(Opp.Size() > 0)
{
Trigger.New[0].Opportunity_Name__c = Opp[0].Id;
If((Opp[0].Process_Consultant__c != Null) && (Opp[0].Process_Consultant__c != '')&& (Trigger.New[0].Type.contains('Suggestions')) && (Trigger.New[0].Case_Reason__c.contains('Process')))
Trigger.New[0].OwnerId = Opp[0].Process_Consultant__c;
else if((Opp[0].Sales_Consultant__c != Null) && (Opp[0].Sales_Consultant__c != '') && (Trigger.New[0].Type.contains('Suggestions')) && (Trigger.New[0].Case_Reason__c.contains('Sales')))
Trigger.New[0].OwnerId = Opp[0].Sales_Consultant__c;
}
}
}
I am getting 75 % code coverage . i want to made it 100% , Red lines r not covered
My test case,
@isTest
private class trgPopulateProcessConsultant_TESTS{
static testMethod void mytestclass(){
//Case c = [Select id from Case limit 1];
Account a = [Select id, name from account limit 1 ];
Opportunity o = [Select id ,name from opportunity where Process_Consultant__c = '' limit 1 ];
Case c = new Case ();
c.accountid = a.id;
c.Opportunity_Name__c = o.id;
c.CurrencyIsoCode = '';
c.Status = 'New';
c.Origin = 'Email';
c.Case_Reason__c = 'Process';
c.Type = 'Suggestions';
Insert c;
}
}
}
-
- DivyaReddy
- September 14, 2011
- Like
- 0
- Continue reading or reply
Regarding test case
Hi
This is my trigger and can any one help me with the test case
trigger trgDeleteTaskDisabled on Task (before Delete) { String ProfileName = [SELECT Profile.Name FROM User where Id = :Trigger.old[0].OwnerId].Profile.Name; If(ProfileName != 'System Administrator') Trigger.old[0].addError('Task once created cannot be deleted'); }
plz help me with the test case to get 100 percent this is the test case i have written
@isTest private class trgDeleteEventDisabled_TESTS { static testMethod void mytestclass() { User u = new User(); u.LastName = 'test'; u.Alias = 't'; u.Email = 'r@gmail.com'; u.Username = 'name'; u.CommunityNickname = 'mane'; u.UserRoleid = 'CRO'; u.Profileid = 'Accounts'; u.EmailEncodingKey = 'Unicode (UTF-8)'; u.Profile.Name = 'tset'; insert u ; Task t = new Task(); t.ownerid = u.id; t.Subject = 'test'; t.Task_Type__c = 'Cold Call'; t.Status = 'In Progress'; t.Priority = 'High'; insert t; delete t ; } }
-
- DivyaReddy
- September 13, 2011
- Like
- 0
- Continue reading or reply
Remove Minus Symbol in visulaforce email template.
HI
I have two field 1 of Currency & other of amount field .
In it we i am getting Negative values , but i want to remove that Minus Symbol in visulaforce email template
Now i am using {!RIGHT(time,LEN(time)-3)} but this is only for text field.
And we can sort by date
Can any one help on this...
-
- DivyaReddy
- September 06, 2011
- Like
- 0
- Continue reading or reply
semi join sub selects can only query id fields
HI,
I wrote a controller for generating Mail for that i used query in query concept but error is hitting to that .
Error : semi join sub selects can only query id fields, cannot use: 'name' at line 10 column 3
public class Controller { public List<Account> ac {get; set;} public List<Point__c> p {get; set;} public string id {get; set;} public Controller() { p=[Select id,name,E_Mail_Id__c,Account__r.name from Point__c where id IN (Select name from Account where id=:id)]; } }
Can u please help on this.
-
- DivyaReddy
- August 26, 2011
- Like
- 0
- Continue reading or reply
very urgent issue.....
- sekhara
- October 19, 2011
- Like
- 0
- Continue reading or reply
very urgent issue.....
hi
my requirement is to add the rows & column values like
1 2 3 = 6
2 3 1 = 6
1 1 1 = 3
4 6 5
so i wrote code like this but will saving
Error: Compile Error: Invalid type: objBudClass at line 19 column 40 .
Can any one help on this issue.
Thank q .
public class GroupedQuery123
{
public list<AggregateResult> lstAr = new list<AggregateResult>();
public GroupedQuery123()
{
lstar = [SELECT Product_Service_Category_Poc__c, Case_Type_Poc__c ,
GROUPING(Product_Service_Category_Poc__c ) p1 , GROUPING(Case_Type_Poc__c ) p2,
COUNT(casenumber) tot1
FROM Case
where CreatedDate = THIS_WEEK and Status = 'open'
GROUP BY CUBE(Product_Service_Category_Poc__c , Case_Type_Poc__c )
order by GROUPING(Product_Service_Category_Poc__c ) , GROUPING(Case_Type_Poc__c )];
}
public list<BudClass> getResults(){
list<BudClass> lstResult = new list<BudClass>();
for(AggregateResult ar : lstAr){
BudClass objBudClass = new objBudClass(ar);
lstResult.add(objBudClass);
}
return lstResult;
}
class BudClass{
public Double tot1{get;set;}
public String p1 {get;set;}
public String p2 {get;set;}
public BudClass(AggregateResult ar){
tot1 = (Double) ar.get('tot1');
p1= (Double) ar.get('p1');
p2= (String) ar.get('p2');
}
}
}
- DivyaReddy
- October 19, 2011
- Like
- 0
- Continue reading or reply
Group By example
HI
Can any one post Group By cube & gruop by roll up code (Apex Class & Visualforce Page).
It may help to me very much ....
Thank q in Advance.....
- DivyaReddy
- October 17, 2011
- Like
- 0
- Continue reading or reply
Help in Query string parameters...
hi
AM 08:00
i have to divide it as AM 08 00 and i have to save them in fields
Appt_am_pm__c = am
Appt_hour__c = 08
Appt_minute__c = 00.
After that i have to use query string parameters to pass it to other page
can any one help on this ...
- DivyaReddy
- September 26, 2011
- Like
- 0
- Continue reading or reply
Dispalying more than 1000 records in to pdf.
hi
i am one requirement , i have to display all values in accounts. I am posting my controller & visualforce page.
public class Raja_Test{
public Raja_Test(ApexPages.StandardController controller)
{ }
public String[] states {get;set;}
public Account[] ac {get;set;}
public Raja_Test()
{
ac = [Select id,name,Bill_To__c,Bill_To__r.Name from account where Bill_To__c != NULL ];
Set<String> stateSet = new Set<String>();
for(Account a : ac)
stateSet.add(a.Bill_To__r.Name);
states = new String[stateSet.size()];
Integer i = 0;
for (String state : stateSet) {
states[i] = state;
i++;
}
states.sort();
}
}
Visulforce Page :
<apex:page Controller="Raja_Test"> <table border = '1'> <apex:repeat value="{!states}" var="a"> <tr> <td>{!a}</td> <tr> <td> <apex:repeat value="{!ac}" var="a1"> <apex:outputPanel rendered="{!IF((a1.Bill_To__r.Name = a) ,true,false)}" > <td>{!a1.name}</td> </apex:outputPanel> </apex:repeat> </td></tr> </tr> </apex:repeat> </table> </apex:page>
Can any one help on this
- DivyaReddy
- September 23, 2011
- Like
- 0
- Continue reading or reply
Urgent:get the longitude and latitude
Hi all ,
i wrote this page for displaying google map
<apex:page standardController="Account">
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript">
$(document).ready(function() { var myOptions = { zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false } var map; var marker; var geocoder = new google.maps.Geocoder(); var address = "{!Account.BillingStreet}, " + "{!Account.BillingCity}, " + "{!Account.BillingPostalCode}, " + "{!Account.BillingCountry}"; var infowindow = new google.maps.InfoWindow({ content: "<b>{!Account.Name}</b><br>{!Account.BillingStreet}<br>{!Account.BillingCity}, {!Account.BillingPostalCode}<br>{!Account.BillingCountry}" });
geocoder.geocode( { address: address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK && results.length) { if (status != google.maps.GeocoderStatus.ZERO_RESULTS) { //create map map = new google.maps.Map(document.getElementById("map"), myOptions); //center map map.setCenter(results[0].geometry.location); //create marker marker = new google.maps.Marker({ position: results[0].geometry.location, map: map, title: "{!Account.Name}" }); //add listeners google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addListener(infowindow, 'closeclick', function() { map.setCenter(marker.getPosition()); }); } } else { $('#map').css({'height' : '15px'}); $('#map').html("Oops! {!Account.Name}'s billing address could not be found, please make sure the address is correct."); resizeIframe(); } }); function resizeIframe() { var me = window.name; if (me) { var iframes = parent.document.getElementsByName(me); if (iframes && iframes.length == 1) { height = document.body.offsetHeight; iframes[0].style.height = height + "px"; } } } });</script>
<style>#map { font-family: Arial; font-size:12px; line-height:normal !important; height:250px; background:transparent;}</style>
</head> <body><div id="map"></div> </body> </apex:page>
Any one can u please help me.
Thanks in advance.
anu
- anu123
- September 21, 2011
- Like
- 0
- Continue reading or reply
Exporting image on Excel Sheet from visualforce page..
hi to all,
i have a requirement that to covert data from vf page to excel sheet . I am able to export all record & etc... except image field .
Can any one help on this issue..
Here my code :
<apex:page controller="cases_ctrl" contentType="application/msWord" >
<apex:pageBlock title="Cases">
<apex:pageBlockTable value="{!c}" var="c1">
<apex:column value="{!c1.CaseNumber}"/>
<apex:column value="{!c1.Date__c}"/>
<apex:column><apex:image value="{!c1.Images__c}"/></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
- DivyaReddy
- September 19, 2011
- Like
- 0
- Continue reading or reply
FIELD_INTEGRITY_EXCEPTION exception
Hi to all ,
I am stuck well writting testcase . i am getting error as :
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Converted Account empty for a Converted Lead.: [ConvertedAccountId].
Here i am posting my triiger & associate test cases.
trigger counsellingNote_Required on Lead (before Update)
{
If(Trigger.New.size()==1)
{
for(Lead newLead: Trigger.new)
{
If(Trigger.new[0].IsConverted == true && Trigger.old[0].IsConverted == false) // Code not covering from here
{
List<Counselling_Note_c__c> counsellingNoteList = new List<Counselling_Note_c__c>
([SELECT Prospect_Name__c FROM Counselling_Note_c__c WHERE Prospect_Name__c = :newLead.Id]);
String errorMsg='';
Boolean flag = false;
if(counsellingNoteList.size()==0)
{
flag = true;
errorMsg += 'Counselling Note - ';
}
if(flag && !Test.isRunningTest())
newLead.addError('Following fields are empty--'+ errorMsg);
}
}
==============
@isTest
private class counsellingNote_Required_TESTS
{
static testMethod void mytestclass()
{
Account a = new Account();
a.Name = 'Test Account';
a.PersonLeadSource = '';
insert a;
Lead l = new Lead ();
l.LastName = 'raja';
l.Status = 'Open';
l.LeadSource = 'Sms';
l.YRN_Branch__c = 'Andheri West, Mumbai - W10';
l.YRN_Country__c = 'India';
l.Type_of_Enquiry__c = 'Telephone';
l.MobilePhone = '9440736154' ;
l.Mobile__c = '9550412970';
l.Phone = '9550412970';
l.IsConverted = true;
// l.ConvertedAccountId = a.id;
insert l;
Lead l1 = new Lead ();
l1.LastName = 'raja';
l1.Status = 'Open';
l1.LeadSource = 'Sms';
l1.YRN_Branch__c = 'Andheri West, Mumbai - W10';
l1.YRN_Country__c = 'India';
l1.Type_of_Enquiry__c = 'Telephone';
l1.MobilePhone = '9440736154' ;
l1.Mobile__c = '9550412971';
l1.Phone = '9550412971';
l1.IsConverted = false;
insert l1;
Counselling_Note_c__c cn = new Counselling_Note_c__c();
cn.Prospect_Name__c = l.id;
cn.Occupation__c = 'Accountant';
cn.Your_Opportunities_exist_in__c = 'USA';
cn.Option__c = 'Migrate';
cn.Country__c = 'Australia';
cn.Services__c = 'Premium Membership';
cn.Recommended_Service_And_Process_Flow__c = 'Test';
cn.Critical_Documents_English_Requirement__c = 'test';
cn.Funds_Requirements__c = 'raja';
cn.Y_Axis_Process_Time__c= '10';
cn.Immigration_Visa_Process_Time__c = 'true';
cn.Y_Axis_Fee__c = '2500';
cn.Migration_Visa_Fee__c = '2500';
cn.Miscellaneous_Cost__c = '2500';
cn.Rejection_Percentage__c = 9;
cn.Immigration_Rules_Change_Percentage__c = 9;
cn.Next_Action_Item__c = 'Pay for Technical Evaluation';
cn.Date__c = system.today();
insert cn;
cn.Prospect_Name__c = l1.id;
update cn;
}
}
- DivyaReddy
- September 16, 2011
- Like
- 0
- Continue reading or reply
Help on test case ..
Hi
I got 21 % can any one help to make me code coverage in between 80 % to 100 %.
trigger trgCaptureConsultants on Opportunity (before Insert, before Update) {
If(Trigger.New.Size() == 1)
{
If(Trigger.IsInsert)
{
String ProfileName = [SELECT Profile.Name FROM User where Id = :Trigger.New[0].OwnerId].Profile.Name;
If(ProfileName.contains('Sales'))//&& (Trigger.New[0].Sales_Consultant__c == Null || Trigger.New[0].Sales_Consultant__c == '')
{
Trigger.New[0].Sales_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Sales_Consultan__c == null)
{
Trigger.New[0].Sales_Consultan__c = Trigger.New[0].OwnerId;
}
}
if(ProfileName.contains('Process') ) //&& (Trigger.New[0].Process_Consultant__c == Null || Trigger.New[0].Process_Consultant__c == ''))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Process_Consultant_User__c == null)
{
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
if( ProfileName.contains('Evaluation'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
Else If(Trigger.IsUpdate)
{
String ProfileName = [SELECT Profile.Name FROM User where Id = :Trigger.New[0].OwnerId].Profile.Name;
If(Trigger.New[0].OwnerId != Trigger.Old[0].OwnerId)
{
If(ProfileName.contains('Sales'))
{
Trigger.New[0].Sales_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Sales_Consultant__c != null)
{
Trigger.New[0].Sales_Consultan__c = Trigger.New[0].OwnerId;
}
}
if(ProfileName.contains('Process'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
If(Trigger.New[0].Process_Consultant__c != null)
{
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
}
if(ProfileName.contains('Evaluation'))
{
Trigger.New[0].Process_Consultant__c = Trigger.New[0].OwnerId;
Trigger.New[0].Process_Consultant_User__c = Trigger.New[0].OwnerId;
}
}
}
/* The below section of code checks whether the Product associated with the opportunity
contains some specific set of characters. if they are found then the record type of the
Opportunity is updated accordingly*/
OpportunityLineItem[] OppLineItems = [SELECT PricebookEntry.Product2Id, PricebookEntry.Product2.Name FROM OpportunityLineItem where Opportunity.Id In :Trigger.New];
If(OppLineItems.Size()==1)
{
String ProductName = OppLineItems[0].PricebookEntry.Product2.Name;
Map<String,Id> RecordTypeMap = New Map<String,Id>();
For(RecordType RecType : [SELECT Id, Name, SobjectType FROM RecordType Where SobjectType = 'Opportunity'])// and Name in ('CAN','AUS','HSW','DEN','JAS','VISA','Evaluation')])
{
RecordTypeMap.put(RecType.Name , RecType.Id);
}
/* Record Type should change only when the Opportunity is moving to Process*/
If (Trigger.New[0].StageName == 'Evaluation Sale Made' && Trigger.New[0].Apply_For_Exception_Withdrawal_Refund__c != TRUE )
{
Trigger.New[0].RecordTypeId = RecordTypeMap.get('Evaluation');
}
Else If (Trigger.New[0].StageName == 'Send to Process Consultant'&& Trigger.New[0].Apply_For_Exception_Withdrawal_Refund__c != TRUE )
{
For(String RecTypeString: RecordTypeMap.KeySet())
{
If(ProductName.startsWith(RecTypeString))
Trigger.New[0].RecordTypeId = RecordTypeMap.get(RecTypeString);
}
}
}
}
Mine test class :
@isTest
private class trgCaptureConsultants_TESTS{
static testMethod void mytestclass(){
Account a = [Select id, name from account limit 1 ];
//Opportunity o = [Select id ,name,Process_Consultant__c from opportunity where accountid =: a.id and Process_Consultant__c != ''];
User u = [Select Profile.Name,id FROM User where Profile.Name != 'Sales' limit 1 ];
Opportunity o = new Opportunity();
o.name = 'raja';
o.Accountid = a.id;
o.StageName = 'Opened';
o.CloseDate = system.today();
o.Process_Consultant__c = '0053000000203VvAAI';
o.Sales_Consultan__c = null ;
o.StageName = 'Evaluation Sale Made';
o.Apply_For_Exception_Withdrawal_Refund__c = False ;
insert o;
Case c = new Case ();
c.accountid = a.id;
c.OwnerId = o.Process_Consultant__c;
c.Opportunity_Name__c = o.id;
c.Status = 'New';
c.Origin = 'Email';
c.Case_Reason__c = 'Process';
c.Type = 'Suggestions';
try{
Insert c;
Update c;
}
catch (Exception e)
{}
}
}
- DivyaReddy
- September 15, 2011
- Like
- 0
- Continue reading or reply
Regarding test case
Hi
This is my trigger and can any one help me with the test case
trigger trgPopulateProcessConsultant on Case (before Insert, before Update) {
If(Trigger.New.Size() == 1)
{
If(Trigger.New[0].AccountId != Null)
{
Opportunity[] Opp = [Select Id, Sales_Consultant__c, Process_Consultant__c from Opportunity where AccountId = :Trigger.New[0].AccountId Order By CreatedDate Desc];
If(Opp.Size() > 0)
{
Trigger.New[0].Opportunity_Name__c = Opp[0].Id;
If((Opp[0].Process_Consultant__c != Null) && (Opp[0].Process_Consultant__c != '')&& (Trigger.New[0].Type.contains('Suggestions')) && (Trigger.New[0].Case_Reason__c.contains('Process')))
Trigger.New[0].OwnerId = Opp[0].Process_Consultant__c;
else if((Opp[0].Sales_Consultant__c != Null) && (Opp[0].Sales_Consultant__c != '') && (Trigger.New[0].Type.contains('Suggestions')) && (Trigger.New[0].Case_Reason__c.contains('Sales')))
Trigger.New[0].OwnerId = Opp[0].Sales_Consultant__c;
}
}
}
I am getting 75 % code coverage . i want to made it 100% , Red lines r not covered
My test case,
@isTest
private class trgPopulateProcessConsultant_TESTS{
static testMethod void mytestclass(){
//Case c = [Select id from Case limit 1];
Account a = [Select id, name from account limit 1 ];
Opportunity o = [Select id ,name from opportunity where Process_Consultant__c = '' limit 1 ];
Case c = new Case ();
c.accountid = a.id;
c.Opportunity_Name__c = o.id;
c.CurrencyIsoCode = '';
c.Status = 'New';
c.Origin = 'Email';
c.Case_Reason__c = 'Process';
c.Type = 'Suggestions';
Insert c;
}
}
}
- DivyaReddy
- September 14, 2011
- Like
- 0
- Continue reading or reply
semi join sub selects can only query id fields
HI,
I wrote a controller for generating Mail for that i used query in query concept but error is hitting to that .
Error : semi join sub selects can only query id fields, cannot use: 'name' at line 10 column 3
public class Controller { public List<Account> ac {get; set;} public List<Point__c> p {get; set;} public string id {get; set;} public Controller() { p=[Select id,name,E_Mail_Id__c,Account__r.name from Point__c where id IN (Select name from Account where id=:id)]; } }
Can u please help on this.
- DivyaReddy
- August 26, 2011
- Like
- 0
- Continue reading or reply
Regarding Displaying String after Hyphon
Hi to all ,
I have one string that has been divided and i have to display the string after Hyphon.
Can any one help om this issue .
- DivyaReddy
- August 18, 2011
- Like
- 0
- Continue reading or reply