• sunny@99-chg
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 54
    Questions
  • 42
    Replies

Hi,

 

    I have a small doubt on Related List Hover Links.

 

In the Hover links , it show the Number of records like    Contact Roles[0] | Contacts[5+] 

 

See in the above for Contacts it is showing [5+]. Here I want to show Total number like if i have contacts 15.it should show as Contacts[15] instead of Contacts[5+].

 

Can any one suggest me how to do this.

 

Hai,

 

  Can Any one please help me about Single sign on in salesforce.

 

As up to now i Configured some part through SAML.For this to enable SAML, I created one domain,then I deployed that domain to all users.Then i Enabled Salesforce as Identity provider and downloaded the certificate.Now i Enabled the SAML with the details in Identity provider.   Up to here i done.Now How to proceed next I am not understanding.Can any one suggest me how to proceed next.  Or Is there any other ways to configure Single sign on in Salesforce.

 

Please suggest me what to do..

Hai,

           I have created one site in sites.

In sites,omn one page i have inputfields with action support.After completion of action .the content of some page and font is reducing. How to avoid this reducing action perform on sites.please tell me why it happen like this.

Hai ,

 

I have a small doubt,regarding Query....

Here in string soql query I used IN operator according to Setids,but it is not working properly.

I think I am fail how to write IN operator in SOQL String.Can anyone help me how to write IN operator in String SOQl.

Below is my code.

 

set<id> setids=new set<id>(); // To this set I have ids.

string soql='select id,o2bc__Sell_Price__c,o2bc__Item_Code__c,name,Qty__c,(SELECT ContentType,attachment.id FROM o2bc__Item__c.attachments) from o2bc__Item__c where Id IN :setids '; // here I think it is wrong with IN operator
soql+=' order by o2bc__Sell_Price__c ';
con2 = new ApexPages.StandardSetController(Database.query(soql));
con2.setPageSize(18);

Hai,

 

   I have problem with SubQuery,which is Marked Below.

Here I want to Query According to Owner,Which is User Accountid.

I am getting Error.

Can you please help me how to write that Query.

 

user use=[select id,accountid from user where id=:userinfo.getuserid()];
string UserAccount=use.accountid;

public ApexPages.StandardSetController con {
get{
if(con == null) {

con = new ApexPages.StandardSetController(Database.getQueryLocator([select id,o2bc__Sell_Price__c,o2bc__Item_Code__c,name,Qty__c,(SELECT ContentType,attachment.id FROM o2bc__Item__c.attachments WHERE ContentType LIKE '%image%'),(select o2bc__item_serial__c.id,name,owner__c from o2bc__item_serials__r where o2bc__status__c='new'and Owner__c=\'+UserAccount+\') from o2bc__Item__c where o2bc__Type__c IN ('UpgradedPhones') and o2bc__Sell_Price__c!=0 order by o2bc__Sell_Price__c ]));
con.setPageSize(18);
}
return con;
}
set;
}

 

 

Please help me how to Query that value.

Hai,

 

Can Anyone please Explain me,

How to Create rollupsummaryfield on Filter criteria according to User.

Hai All,

 

Please Suggest me for my Task. I need TestCoverage on Apexpages.IdeaStandardSetController.

For my constructor like:

 

public class MyIdeaProfileExtension12 {
private final ApexPages.IdeaStandardSetController ideaSetController;
public MyIdeaProfileExtension12(ApexPages.IdeaStandardSetController controller) {
ideaSetController = (ApexPages.IdeaStandardSetController)controller;

==========================

==========================

==========================
}

public List<Idea> getModifiedIdeas() {

Idea[] ideas = ideaSetController.getIdeaList();
return ideas;
}

 

For my DEV Ideas and related to ideas are Enabled.

Need Urget, For the above Red color constructor.I tried in Many ways.but coudnt find Result

How to call that Constructor Through Constructor..

Hai,

 

I have a problem with IdeaStandardSetController TestCoverage.

 

Here is my Controller with TestCoverage

 

public class MyIdeaProfileExtension1 {
private final ApexPages.IdeaStandardSetController ideaSetController;

public MyIdeaProfileExtension1(ApexPages.IdeaStandardSetController controller)  // Here I am Unable to Pass the                    

                                                                                                                              Values,How to Pass the values to Constructor    

                                                                                                                           through Test Method.

{
ideaSetController = (ApexPages.IdeaStandardSetController)controller;
}

public List<Idea> getModifiedIdeas() {
Idea[] ideas = ideaSetController.getIdeaList();
// modify ideas here

return ideas;
}

 

static testmethod void MyIdeaProfileTest()
{
Community cm=[select id from community];
idea Testideas=new idea(CommunityId=Cm.id,title='hii');
list<idea> ideas=new list<idea>();
ideas.add(Testideas);
insert ideas;
Apexpages.ideaStandardsetController isc;
//isc=Apexpages.ideaStandardsetController.valueof(ideas);
// Apexpages.standardSetcontroller ssc =new Apexpages.standardSetcontroller(ideas);
//Apexpages.ideaStandardsetController isc= new apexpages.ideaStandardsetController(ideas);
MyIdeaProfileExtension1 mp = new MyIdeaProfileExtension1(isc);
mp.getModifiedIdeas();
}
}

 

Here above in test code I have Taken As variable as Apexpages.IdeaStandardSetController isc and Passing it.

Can anyone tell me how to do this

Through the Apexpages.IdeaStandardSetController isc, I have to pass the Ideas

Hai,

 

In my vfpage I have One Textbox and Two Commandbuttons as button1 ans button2.

 

Afetr entering the Text in Textbox And Click on Button1,My functionality is working Fine.

 

When I enter Text in textbox and press Enter key from Keyboard..The Button2 action is performing,Here I need to work the Button1 Functionality.

 

How to do this,Can Anyone Suggest me...

 

 

Hai ,

 

  In my page my client want to show an imge if the Image attachment is not there under a record.

 

 

 

My Page is

 

 <apex:pageblocksection title="Nexus Upgrade Phone Selection" columns="1"  collapsible="false"   id="pho" >
                 
                                            <apex:panelGrid captionClass="phoneDetails">
                                                <apex:repeat value="{!itemlist}" var="i" >
                                                    <div class="phoneBox">
                                                        <apex:repeat value="{!i.attachments}" var="l">
                                                            <apex:image url="/servlet/servlet.FileDownload?file={!l.id}" styleClass="phoneImage" rendered="{!if( l=='',false,true)}" />
                                                          <!--  <apex:image url="{!$Resource.Freephone}"   styleClass="phoneImage"  rendered="{!if(l=='',true,false)}"> </apex:image> ---> // Here I need the fake image if image attachment is not there

<br/> <br/>
                                                          
                                                              
                                                        </apex:repeat>
                                                         <p class="phoneDescription"> <!-- this may need reorganizing ?? -->
                                                                    <apex:commandLink value="Detail" action="{!ShowDetail}" styleClass="btn" style="padding:2px 5px 2px 5px; text-decoration:none; color:green;"  >      
                                                                         <!-- <apex:param name="PhID" value="{!l.id}"/>-->
                                                                          </apex:commandLink>
                                                                    <apex:commandLink value="Select" action="{!onphoneselect}" styleClass="btn" style="padding:2px 5px 2px 5px; text-decoration:none; color:green;"  >
                                                                        <apex:param assignTo="{!imageid}" name="PhID" value="{!i.id}"/>
                                                                    </apex:commandLink>
                                                                    
                                                                    <br/><br/>
                                                                 <apex:inputHidden rendered="{!IF(i.Qty__c == 0 ,true,false)}"> <font color='red' >  Out Of Stock  </font></apex:inputHidden>
                                                                
                                                                     <br></br>
                                                                    <apex:outputField value="{!i.Name}"/> <br/>
                                                                    PRICE: <apex:outputField value="{!i.o2bc__Sell_Price__c }"/>     
                                                                </p>
                                                    </div>
                                                </apex:repeat>
                                            </apex:panelGrid>                                 
                                                                               
                                        </apex:pageblocksection>

 

My controller

 

public ApexPages.

StandardSetController con {
     get{
            if(con == null) {
                con = new ApexPages.StandardSetController(Database.getQueryLocator([select id,o2bc__Sell_Price__c,o2bc__Item_Code__c,name,Qty__c,(SELECT ContentType,parentid, attachment.id FROM o2bc__Item__c.attachments WHERE ContentType LIKE '%image%') from o2bc__Item__c where o2bc__Type__c IN ('Freephones','Phones') and o2bc__Sell_Price__c!=0 order by o2bc__Sell_Price__c ]));
                con.setPageSize(18);
            }
            return con;
        }
        set;
    }



 public List<o2bc__Item__c> getitemlist()
    {
       itemlist = new List<o2bc__Item__c>();
       for(o2bc__Item__c oItem :(List<o2bc__Item__c>)con.getRecords())
        {
       
            system.debug('----ram---'+oItem.Attachments);
                   itemlist.add(oItem);  
          
       
        }
        return itemlist;
    }
 
Please do the needful,it is very urgent..

Hai,

 

  When i click on Pageblock button,After action status and action completed.The page block buttons are dissappearing.why it is like that,can anyone suggest me for not to dissappear the buttons..

Hai,

 

  Can anyone tell me which Event Is suitable for the inputtext,For the inputtext I wrote auto complete functionality,after selecting the value from auto complete,Whwt event I want to use Can anyone tell me.its Urgent..

Hai,

 

     I applied 'Like' Operator on number field in the SOQL query.But it Showing an error that Like operator will not work on Number field types.

 

 I had the Number type field in database and also i Dont want to change the type here.

 

Then how to aplly 'Like' operator on number field in SOQL.Is there any other way to check the number starting with,like the functionality of 'Like' Operator.

Hai,

 

    How to integrate Salesforce to Survey Monkey,Please send me any reference documents.

Hai,

 

     I have small issue regarding Test Coverage for a method,below is the code,

 

When I am calling this method through test coverage,it is covering partially. Remaining how to cover can any one tell me. see below comments

 

        public pagereference household(id leadid)

{
 
 pagereference pdfpage = new pagereference('https://c.cs9.visual.force.com/apex/household?leadid='+leadid);
attachment attpdf = new attachment();
 attpdf.parentid = leadid;                      // Upto here the code is covered.
 attpdf.body = pdfpage.getcontent();  // from here the code is getting struct and not covering the remaining code.
attpdf.name = 'household.pdf';
 attpdf.ContentType = '.pdf';
 insert attpdf;
 return null;

}

 

 

Thanxs,

Sunny.

Hai ,

 

   I need some help related to write Query as in string format using IN operator.

 

global class autoCompleteController1
{
@RemoteAction
global static SObject[] findSObjects(string obj, string qry, string addFields,string profilename)
{
/* More than one field can be passed in the addFields parameter
Split it into an array for later use */
List<String> fieldList=new List<String>();
if (addFields != '')
fieldList = addFields.split(',');
// list<o2bc__Item__c> oItem=new list<o2bc__Item__c>();
set<id> setId=new set<id>(); // Here i taken the ID's into set,and writing 'IN' operator in Query
for(o2bc__Item__c oitem:[select id from o2bc__Item__c where o2bc__Type__c=:'FreePhones'])
{
setId.add(oitem.id);

}
system.debug('@@@@@@@'+setId);
/* Check whether the object passed is valid */
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
Schema.SObjectType sot = gd.get(obj);
if (sot == null)
{
return null;
}

/* Creating the filter text */
String filter = ' like \'' + String.escapeSingleQuotes(qry) + '%\'';


/* Begin building the dynamic soql query */
String soql = 'SELECT Name';

/* If any additional field was passed, adding it to the soql */
if (fieldList.size()>0)
{
for (String s : fieldList)
{
soql += ', ' + s;
}
}

/* Adding the object and filter by name to the soql */
soql += ' from ' + obj + ' where name' + filter;
string pl='new';

if(profilename!='')
{
//profile name and the System Administrator are allowed
soql += ' and Profile.Name like \'%' + String.escapeSingleQuotes(profilename) + '%\'';
system.debug('Profile:'+profilename+' and SOQL:'+soql);
}

soql += ' and o2bc__Item__c IN (\''+setid+'\')' ; // here i used IN operator,I think it is wrong,can any one tell me how to                        

                                                                                write IN operator in query of string format..I want to retrive all the values  w        

                                                                                   with the Id's in the set.now i am not retriving the values.

soql += 'and o2bc__Status__c=\''+Pl+'\' ';

/* Adding the filter for additional fields to the soql */
/* if (fieldList != null)
{
for (String s : fieldList)
{
soql += ' or ' + s + filter;
}
} */

soql += ' order by Name limit 20';

system.debug('Qry: '+soql);

List<sObject> L = new List<sObject>();
try
{
L = Database.query(soql);
}
catch (QueryException e)
{
system.debug('Query Exception:'+e.getMessage());
return null;
}
return L;
}

}

Hai All,

      I have small Doubt,

How to display Error message Under a Custom field(not SObject field) or item in Visualforce through Apex.

Hai All,

 

I need Some suggestion to write test coverage for the below code

 

in my page i wrote component as 

 

<apex:inputText value="{!ESNnumber}" style="width:100px;" id="ESNnumber" >
<c:autocomplete autocomplete_textbox="{!$Component.ESNnumber}" objectname="o2bc__Item_Serial__c" parentName="{!$CurrentPage.parameters.PhoneId}" />
</apex:inputText>

Here is the Component for Auto search functionality

 

<apex:component controller="autoCompleteController">

 

<!-- JQuery Files -->

<apex:includeScript value="{!URLFOR($Resource.jqueryui18, 'js/jquery-1.8.0.min.js')}" />

<apex:includeScript value="{!URLFOR($Resource.jqueryui18, 'js/jquery-ui-1.8.23.custom.min.js')}" />

<apex:stylesheet value="{!URLFOR($Resource.jqueryui18,'css/ui-lightness/jquery-ui-1.8.23.custom.css')}"/>

<!-- Attributes Required For Component -->
<apex:attribute name="objectname" description="The object name you want to look for." type="String" required="true"/>
<apex:attribute name="ParentName" description="The object name you want to look for." type="String" required="false"/>
<apex:attribute name="additionalfield" description="Any additional fields you'd like to search and include in the display." type="String" required="false"/>
<apex:attribute name="profilename" description="To filter on the basis of profile name and include in the display." type="String" required="false"/>
<apex:attribute name="autocomplete_textbox" description="The ID for the Autocomplete List Textbox." type="String" required="true"/>

<!-- CSS Style -->
<style>
.ui-autocomplete-loading {background: white url({!$Resource.loadingIcon}) right center no-repeat;}
</style>

<!-- Javascript -->
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function()
{

var sObjects;
var queryTerm;

j$(esc('{!autocomplete_textbox}')).autocomplete({
minLength: 1,
source: function(request, response) {
queryTerm = request.term;
autoCompleteController.findSObjects("{!objectname}", request.term, "{!additionalfield}","{!ParentName}","{!profilename}", function(result, event){
if(event.type == 'exception')
{
alert(event.message);
} else
{
sObjects = result;
response(sObjects);
}
});
},
focus: function( event, ui ) {
j$(esc('{!autocomplete_textbox}')).val( ui.item.Name );
return false;
},
select: function( event, ui ) {
j$(esc('{!autocomplete_textbox}')).val( ui.item.Name );
j$(esc('{!autocomplete_textbox}_lkid')).val( ui.item.Id );
j$(esc('{!autocomplete_textbox}_lkold')).val( ui.item.Name );
if (event.keyCode == 13) {
event.preventDefault();
}
return false;
},
})
.data( "autocomplete" )._renderItem = function( ul, item ) {
var entry = item.Name;
if("{!additionalfield}" !='')
{
j$.each("{!additionalfield}".split(",") , function(key, value) {
entry = entry + " " + item[value];
});
}
//entry = entry + "</a>";
//entry = entry.replace(queryTerm, "<b>" + queryTerm + "</b>");
entry = entry.replace( new RegExp( "(" + queryTerm + ")" , "gi" ), "<strong>$1</strong>" );
return j$( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + entry + "</a>")
.appendTo( ul );
};
});

function esc(myid)
{
return '#' + myid.replace(/(:|\.)/g,'\\\\$1');
}

</script>
</apex:component>

 

==================================================

 

Here is my Ccontroller for the above component

 

global class autoCompleteController
{
@RemoteAction
global static SObject[] findSObjects(string obj, string qry, string addFields,string parent,string profilename)
{
/* More than one field can be passed in the addFields parameter
Split it into an array for later use */
List<String> fieldList=new List<String>();
if (addFields != '')
fieldList = addFields.split(',');
Attachment oAttachment = [SELECT ContentType,Id,ParentId,Parent.Name FROM Attachment WHERE ContentType LIKE '%image%' AND Id =:Parent];
o2bc__Item__c oItem =[select Id,o2bc__Sell_Price__c,Qty__c from o2bc__Item__c where ID =:oAttachment.ParentId];

/* Check whether the object passed is valid */
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
Schema.SObjectType sot = gd.get(obj);
if (sot == null)
{
return null;
}

/* Creating the filter text */
String filter = ' like \'' + String.escapeSingleQuotes(qry) + '%\'';


/* Begin building the dynamic soql query */
String soql = 'SELECT Name';

/* If any additional field was passed, adding it to the soql */
if (fieldList.size()>0)
{
for (String s : fieldList)
{
soql += ', ' + s;
}
}

/* Adding the object and filter by name to the soql */
soql += ' from ' + obj + ' where name' + filter;
string pl='new';

if(profilename!='')
{
//profile name and the System Administrator are allowed
soql += ' and Profile.Name like \'%' + String.escapeSingleQuotes(profilename) + '%\'';
system.debug('Profile:'+profilename+' and SOQL:'+soql);
}
if(Parent!='')
{
soql += ' and o2bc__Item__c =\''+oItem .id+'\'';
soql += 'and o2bc__Status__c=\''+Pl+'\' ';
}
/* Adding the filter for additional fields to the soql */
/* if (fieldList != null)
{
for (String s : fieldList)
{
soql += ' or ' + s + filter;
}
} */

soql += ' order by Name limit 20';

system.debug('Qry: '+soql);

List<sObject> L = new List<sObject>();
try
{
L = Database.query(soql);
}
catch (QueryException e)
{
system.debug('Query Exception:'+e.getMessage());
return null;
}
return L;
}
}

 

Then Anyone Suggest me How to write test Coverage for the above controller.

Hai,

 

I have a small doubt Regarding Browser Back button.

 

How to Disable Browser Back Button......

Can anyone suggest me how to do this in visualforce page...

Hai All,

      Now the Apex code is fine and working.

When iam modifying small change in apex code its showing an Error

 

Compile Error: Method does not exist or incorrect signature: [http].send(System.HttpRequest)

 


and my apex,what i wrote in my controller is

 

public string php(blob attpdf){


HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();

req.setEndpoint('https://sfarchive.com/generatePDF.php');
req.setMethod('POST');
req.setBodyasBlob(attpdf);
req.setCompressed(true); // otherwise we hit a limit of 32000

try {
res = http.send(req);       ------> here its showing error.
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
System.debug(res.toString());
}
return null;
}

 

 

Can anyone tell me the solution...

 

Hai,

 

   I have problem with SubQuery,which is Marked Below.

Here I want to Query According to Owner,Which is User Accountid.

I am getting Error.

Can you please help me how to write that Query.

 

user use=[select id,accountid from user where id=:userinfo.getuserid()];
string UserAccount=use.accountid;

public ApexPages.StandardSetController con {
get{
if(con == null) {

con = new ApexPages.StandardSetController(Database.getQueryLocator([select id,o2bc__Sell_Price__c,o2bc__Item_Code__c,name,Qty__c,(SELECT ContentType,attachment.id FROM o2bc__Item__c.attachments WHERE ContentType LIKE '%image%'),(select o2bc__item_serial__c.id,name,owner__c from o2bc__item_serials__r where o2bc__status__c='new'and Owner__c=\'+UserAccount+\') from o2bc__Item__c where o2bc__Type__c IN ('UpgradedPhones') and o2bc__Sell_Price__c!=0 order by o2bc__Sell_Price__c ]));
con.setPageSize(18);
}
return con;
}
set;
}

 

 

Please help me how to Query that value.

Hai All,

 

Please Suggest me for my Task. I need TestCoverage on Apexpages.IdeaStandardSetController.

For my constructor like:

 

public class MyIdeaProfileExtension12 {
private final ApexPages.IdeaStandardSetController ideaSetController;
public MyIdeaProfileExtension12(ApexPages.IdeaStandardSetController controller) {
ideaSetController = (ApexPages.IdeaStandardSetController)controller;

==========================

==========================

==========================
}

public List<Idea> getModifiedIdeas() {

Idea[] ideas = ideaSetController.getIdeaList();
return ideas;
}

 

For my DEV Ideas and related to ideas are Enabled.

Need Urget, For the above Red color constructor.I tried in Many ways.but coudnt find Result

How to call that Constructor Through Constructor..

Hai,

 

In my vfpage I have One Textbox and Two Commandbuttons as button1 ans button2.

 

Afetr entering the Text in Textbox And Click on Button1,My functionality is working Fine.

 

When I enter Text in textbox and press Enter key from Keyboard..The Button2 action is performing,Here I need to work the Button1 Functionality.

 

How to do this,Can Anyone Suggest me...

 

 

Hai,

 

  When i click on Pageblock button,After action status and action completed.The page block buttons are dissappearing.why it is like that,can anyone suggest me for not to dissappear the buttons..

Hai,

 

  Can anyone tell me which Event Is suitable for the inputtext,For the inputtext I wrote auto complete functionality,after selecting the value from auto complete,Whwt event I want to use Can anyone tell me.its Urgent..

Hai ,

 

   I need some help related to write Query as in string format using IN operator.

 

global class autoCompleteController1
{
@RemoteAction
global static SObject[] findSObjects(string obj, string qry, string addFields,string profilename)
{
/* More than one field can be passed in the addFields parameter
Split it into an array for later use */
List<String> fieldList=new List<String>();
if (addFields != '')
fieldList = addFields.split(',');
// list<o2bc__Item__c> oItem=new list<o2bc__Item__c>();
set<id> setId=new set<id>(); // Here i taken the ID's into set,and writing 'IN' operator in Query
for(o2bc__Item__c oitem:[select id from o2bc__Item__c where o2bc__Type__c=:'FreePhones'])
{
setId.add(oitem.id);

}
system.debug('@@@@@@@'+setId);
/* Check whether the object passed is valid */
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
Schema.SObjectType sot = gd.get(obj);
if (sot == null)
{
return null;
}

/* Creating the filter text */
String filter = ' like \'' + String.escapeSingleQuotes(qry) + '%\'';


/* Begin building the dynamic soql query */
String soql = 'SELECT Name';

/* If any additional field was passed, adding it to the soql */
if (fieldList.size()>0)
{
for (String s : fieldList)
{
soql += ', ' + s;
}
}

/* Adding the object and filter by name to the soql */
soql += ' from ' + obj + ' where name' + filter;
string pl='new';

if(profilename!='')
{
//profile name and the System Administrator are allowed
soql += ' and Profile.Name like \'%' + String.escapeSingleQuotes(profilename) + '%\'';
system.debug('Profile:'+profilename+' and SOQL:'+soql);
}

soql += ' and o2bc__Item__c IN (\''+setid+'\')' ; // here i used IN operator,I think it is wrong,can any one tell me how to                        

                                                                                write IN operator in query of string format..I want to retrive all the values  w        

                                                                                   with the Id's in the set.now i am not retriving the values.

soql += 'and o2bc__Status__c=\''+Pl+'\' ';

/* Adding the filter for additional fields to the soql */
/* if (fieldList != null)
{
for (String s : fieldList)
{
soql += ' or ' + s + filter;
}
} */

soql += ' order by Name limit 20';

system.debug('Qry: '+soql);

List<sObject> L = new List<sObject>();
try
{
L = Database.query(soql);
}
catch (QueryException e)
{
system.debug('Query Exception:'+e.getMessage());
return null;
}
return L;
}

}

Hai All,

      I have small Doubt,

How to display Error message Under a Custom field(not SObject field) or item in Visualforce through Apex.

Hai,

 

In my vfpage i have 2 pageblock sections

1st section contains two radio buttons

2nd section contains file upload with "Attach" command button to show the attached file.

 

Now i selected one radio button,then i uploaded one file and now when i am click on "Attach" the page refreshes and the selected radio in section 1 dissappears. I need to show the selected radio even after page refresh...

 

Can anyone suggest me how to do this one....

Hai All,

 

I have a problem with Radio Button.

I had Taken 2 HTML Radio buttons in apex page,Now i selected one Radio Button,Now i performed some action on the page and the page will get Refresh,After Refresh The Selected Radio button is not showing as selected.

How to make it as selected Even After Page Refresh....Suggest me...

Hai All,

 

When i was entered the data and saving to Lead,Through VisualForce Page..

It Raising Error...

 

AutomateLeadConversion: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Converted objects can only be owned by users. If the lead is not owned by a user, you must specify a user for the Owner field.: [] Trigger.AutomateLeadConversion: line 12, column 1

 

My Trigger :

 

trigger AutomateLeadConversion on Lead (After Update) {
system.debug('Enter to convert Lead');
Lead myLead = trigger.new[0];

if( mylead.Incomplete_Application__c == false && myLead.isconverted==false && myLead.SSN_Not_Eligible__c == false && myLead.No_Govt_Proof_Form__c ==false && myLead.No_Program_List__c == false){
//myLead.LeadSource == 'fax'
system.debug('Enter to convert Lead condition');
database.LeadConvert lc = new database.LeadConvert();
lc.setLeadID(myLead.ID);
lc.convertedstatus = 'Closed - Converted';
lc.setDoNotCreateOpportunity(true);
Database.LeadConvertResult lcr = Database.convertLead(lc); ---->Line 12
System.assert(lcr.isSuccess());

}

}

 

 

 Please suggest me What to do for this....

Thanks,

Hai,

 

I am getting Error Please Resolve it...

 

Error: System.DmlException: Update failed. First exception on row 0 with id 00QK0000003I8KhMAK; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadAfterUpdate: execution of AfterUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, o2bc.SetOrderLineItemPrice: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object (o2bc): [] Trigger.LeadAfterUpdate: line 64, column 1: [] (System Code) 

 

My Trigger is below:

 

trigger LeadAfterUpdate on Lead (after update)
{
    System.debug('******AfterUpdate********' );
    Set<Id> leadIdsSet = new Set<Id>();
    List<Customer_Certification_Line__c> Progrms = new List<Customer_Certification_Line__c>();
    for(Integer i=0;i<Trigger.old.size();i++)
        leadIdsSet.add(Trigger.old[i].id);
    System.debug('******leadIdsSet*******'+leadIdsSet);    
    System.debug('******Trigger.old[0].IsConverted*******'+Trigger.old[0].IsConverted);
    List<Lead> leadList = [Select id,Credit_Card_Number_Enc__c,mailing_city__c,mailing_address_1__c,mailing_address_2__c,mailing_state__c,mailing_zip_code__c,(SELECT Account__c,Certification_Name__c FROM Customer_Certification_Lines__r),ConvertedAccountId,(Select id,Item__c,Lead__c,Quantity__c from Lead_Line_Items__r) from Lead where IsConverted = true and id in :leadIdsSet];
    System.debug('******leadList*******'+leadList);
    if(leadList.size()>0)
    {
        if (lead.ConvertedAccountId != null) {
            
            for(Lead lead:leadList){
                system.debug(lead.ConvertedAccountId);
                Account a = [Select a.id,a.shippingstreet,a.shippingcountry,a.shippingstate,a.shippingPostalCode,a.shippingcity From Account a Where a.Id = :lead.ConvertedAccountId];
                System.debug('******account fields*******'+a);
                a.shippingcity = lead.mailing_city__c;
                if(lead.mailing_address_2__c!=null)
                    a.ShippingStreet = lead.mailing_address_1__c+' '+lead.mailing_address_2__c;
                else
                    a.ShippingStreet = lead.mailing_address_1__c;
                    a.shippingstate = lead.mailing_state__c;
                    a.ShippingPostalCode = lead.Mailing_Zip_Code__c;
                    a.o2bc__Credit_Card_Number__c = lead.Credit_Card_Number_Enc__c;
                update a;
            }
 
        }
        Map<Id,o2bc__Sales_Order__c> accountIdSalesOrderMap = new Map<Id,o2bc__Sales_Order__c>();
        for(Lead lead:leadList)
        {
            o2bc__Sales_Order__c salesOrder = new o2bc__Sales_Order__c();
            salesOrder.o2bc__Account__c = lead.ConvertedAccountId;
            accountIdSalesOrderMap.put(lead.ConvertedAccountId,salesOrder);
        }
        system.debug('Size is--------->' + accountIdSalesOrderMap.size());
        insert accountIdSalesOrderMap.values();
        System.debug('******accountIdSalesOrderMap*******'+accountIdSalesOrderMap);
        List<o2bc__Order_Line__c> orderLineList = new List<o2bc__Order_Line__c>();
        for(Lead lead:leadList)
        {
            for(Lead_Line_Item__c leadProductLineItem:lead.Lead_Line_Items__r)
            {
                o2bc__Order_Line__c orderLine = new o2bc__Order_Line__c();
                orderLine.o2bc__Item__c = leadProductLineItem.Item__c;
                orderLine.o2bc__Sales_Order__c = accountIdSalesOrderMap.get(lead.ConvertedAccountId).id;
                orderLine.o2bc__Quantity__c = leadProductLineItem.Quantity__c;
                orderLineList.add(orderLine);
            }
            if(lead.Customer_Certification_Lines__r.size()>0){
                
                for(Customer_Certification_Line__c oProgram : lead.Customer_Certification_Lines__r){
                    
                    Customer_Certification_Line__c oProgramList = new Customer_Certification_Line__c(id = oProgram.Id);
                    oProgramList.Account__c = lead.ConvertedAccountId;
                    Progrms.add(oProgramList);
                }
            }
        }
        System.debug('******orderLineList*******'+orderLineList);
        insert orderLineList; // ----->Line 64
        if(!Progrms.isEmpty()){
            update Progrms;
        }
    }
}

Hai All,

 

How to display a visualforce page as popup whenever we click on a standard button,

For Ex: whenever we click on "Convert" Button in a lead,I need to Display a vfpage As popup..

 

Please can anyone suggest me how to do

 

Hi ,
Can any one help to write a test case for the following Apex Classes.
Apex Class:

public class Tva_ExportContactsExtension {
  public Tva_ExportContactsExtension(ApexPages.StandardSetController controller)
   {
     controller.setPageSize(controller.getResultSize());
  }
}