• success22
  • NEWBIE
  • 30 Points
  • Member since 2012

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

Please find my VF code below:

<apex:page controller="ContestDisplayController" id="page" showHeader="false" sidebar="false">
<apex:pageBlock title="Contest Images" id="block">
<apex:repeat value="{!contstPicList}" var="contnt" id="blckTable">
<apex:outputPanel layout="block" style="float:left;height:110px;margin:5px">
<a href="{!contnt.Document_URL__c}" target="_top">
<apex:outputField value="{!contnt.Picture__c}"/>
</a>
</apex:outputPanel>
</apex:repeat>
</apex:pageBlock>

</apex:page>

 

I have an inline style in ouputPanel tag but this is not working in IE browsers. And working in Chrome and Mozilla. 

Can anyone suggest me where I have done wrong?

Anyone has used Demo CTI Adapter??

 

I have installed it and configured my Development Org also. I am able to see Connect CTI Adapter but when I am clicking on this button, nothing is happening.

Can any one tell me what I have done wrong.

Hi,

 

I have written one controller extension for search one custom object records along with pagination using StandardSet Controller. I have created one wrapper class also to select some of the records from search result. The problem is either of 2 functionality is working. Either search function OR selecting the records and performing action on selected record is working but not both the functionality is working at same time..

 

Does any one else faceed same problem? Please help me

 

My apex code and VF code is below:

public with sharing class SMSController {
public Integer size = 20;
public Integer totalPageNo;
public Search__c condition = new Search__c();
public SMS_Template__c SmsTemplte = new SMS_Template__c();
public String qry = 'SELECT LastName,AccountId,Customer_Mobile_No__c,Birthdate,RecordTypeName__c, NotCorpRecordType__c FROM Contact WHERE NotCorpRecordType__c = 1 LIMIT 500';
private final SMS__c smsObj {get;set;}
public List<SMS__c> smsObjList = new List<SMS__c>();
public String SenderName {get;set;}
public String SenderMobile {get;set;}
//Collection of the class/wrapper objects cContact
public List<cContact> contactList {get;set;}

public SMSController(ApexPages.StandardController controller){
this.smsObj = (SMS__c)controller.getRecord();
}

public List<cContact> getContacts() {

if(contactList == null){
contactList = new List<cContact>();
for(Contact c : (list<Contact>)contct.getRecords()) {
contactList.add(new cContact(c));
}
}
return contactList;
}
public PageReference processSelected() {
List<Contact> selectedContacts = new List<Contact>();


for(cContact cCon : getContacts()){
if(cCon.selected == true){
selectedContacts.add(cCon.con);
System.debug('+++++++++++++++++++++++++++++++++'+selectedContacts.size());
}
}




for(Contact con : selectedContacts){
SMS__c smsInstance = new SMS__c();
smsInstance.Field_1__c = con.LastName;
smsInstance.Field_2__c = con.RecordTypeName__c;
smsInstance.Account__c = con.AccountId;
smsInstance.Sender_Name__c = smsObj.Sender_Name__c;
smsInstance.Sender_Phone__c = smsObj.Sender_Phone__c;
smsInstance.SMS_Template__c = smsObj.SMS_Template__c;
smsObjList.add(smsInstance);

}


if(smsObjList != null && smsObjList.size() > 0){
insert smsObjList;
}
return null;
}


public PageReference reset() {
PageReference newpage = new PageReference(System.currentPageReference().getURL());
newpage.setRedirect(true);
return newpage;
}

public ApexPages.StandardSetController contct {

get {
if(contct == null){

contct= new ApexPages.StandardSetController(Database.getQueryLocator(qry));
contct.setPageSize(size);}
return contct;
}
set;
}


public void queryContracts(){
qry = 'SELECT LastName,Customer_Mobile_No__c,Birthdate,RecordTypeName__c,AccountId FROM Contact WHERE NotCorpRecordType__c = 1 ';
qry = qry + getWhereClause() + ' LIMIT 500';
System.debug('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'+qry);

try{
contct = new ApexPages.StandardSetController(Database.getQueryLocator(qry));
contct.setPageSize(size);


}catch(Exception e){
ApexPages.addMessages(e);
}
}
public void search(){
queryContracts();

}


public String getWhereClause(){
String whereClause = 'AND LastName != null ';

if(condition.Last_Name__c != '' && condition.Last_Name__c != null){
whereClause +='AND LastName LIKE \''+ String.escapeSingleQuotes(condition.Last_Name__c) +'%\' ';
}
if(condition.Mobile__c != '' && condition.Mobile__c != null){
whereClause +='AND Customer_Mobile_No__c LIKE \''+String.escapeSingleQuotes(condition.Mobile__c) +'%\' ';
}
if(condition.Customer_Type__c != '' && condition.Customer_Type__c != null && condition.Customer_Type__c == 'Corporate Contact'){
whereClause +='AND RecordTypeName__c LIKE \''+String.escapeSingleQuotes(condition.Customer_Type__c) +'%\' ';
}
if(condition.Customer_Type__c != '' && condition.Customer_Type__c != null && condition.Customer_Type__c == 'Individual Customer'){
whereClause +='AND IsPersonAccount = true ';
}
if(condition.Birthday_Range__c != '' && condition.Birthday_Range__c != null && condition.Birthday_Range__c == 'This Month'){
whereClause +='AND Birthdate = THIS_MONTH';
}
if(condition.Birthday_Range__c != '' && condition.Birthday_Range__c != null && condition.Birthday_Range__c == 'This Week'){
whereClause +='AND Birthdate = THIS_WEEK';
}
if(condition.Birthday_Range__c != '' && condition.Birthday_Range__c != null && condition.Birthday_Range__c == 'Today'){

whereClause +='AND Birthdate = TODAY';
}
System.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+whereClause);
return whereClause;
}

public Search__c getCondition(){
return this.condition;
}
public void setCondition(Search__c val){
this.condition = val;
}
public SMS_Template__c getSmsTemplte(){
return this.SmsTemplte;
}
public void setSmsTemplte(SMS_Template__c val){
this.SmsTemplte = val;
}

public SMS__c getsmsObj(){
return this.smsObj;
}

public class cContact {
public Contact con {get; set;}
public SMS__c smsObject {get;set;}
public Boolean selected {get; set;}

public cContact(Contact c) {
con = c;
selected = false;

}

public cContact (SMS__c s){
smsObject = s;
}
}

public void first() {
contct.first();
}

// returns the last page of records
public void last() {
contct.last();
}
public void previous() {
contct.previous();
}

// returns the next page of records
public void next() {
contct.next();
}

public Boolean hasNext {
get {
return contct.getHasNext();
}
set;
}

// indicates whether there are more records before the current page set.
public Boolean hasPrevious {
get {
return contct.getHasPrevious();
}
set;
}
///calculate page number and total number of records fetched by SOQL
public Integer pageNumber {
get {
return contct.getPageNumber();
}
set;
}
public Integer count {
get {
return contct.getResultSize();
}
set;
}
//Sorting of data in columns
public integer getSize() {
return size;
}

public void setSize(integer size) {
this.size = size;
}

public Integer getTotalPageNo() {
totalPageNo = contct.getResultSize()/ size;
Integer mod = contactList.size() - (totalPageNo * size);

if(mod > 0){
totalPageNo++;
}

return totalPageNo;
}
}

 

<apex:page standardController="SMS__c" id="pages" tabStyle="SMS__c" extensions="SMSController">
<apex:form id="form">
<table width="100%" border="0">
<tr>
<td width="100%">
<apex:sectionHeader title="Search Customers"/>
<apex:pageBlock id="block">

<apex:actionFunction name="searchServer" action="{!queryContracts}">
<apex:param name="firstParam" assignTo="{!PicklistSize}" value=""/>
</apex:actionFunction>

<apex:pageBlockSection collapsible="true" title="Customer Information">
<apex:inputField value="{!condition.Last_Name__c}"/>
<apex:inputField value="{!condition.Birthday_Range__c}"/>
<apex:inputField value="{!condition.Mobile__c}"/>
<apex:inputField value="{!condition.Customer_Type__c}"/>

</apex:pageBlockSection>

<apex:pageBlockSection collapsible="true" title="SMS Section">
<apex:inputField value="{!smsObj.SMS_Template__c}" required="true"/>

</apex:pageBlockSection><br/>

<apex:pageBlockSection collapsible="true" title="Sender Information. Please Enter value" columns="2">
<apex:inputField value="{!smsObj.Sender_Name__c}" id="name"/>
<apex:inputField value="{!smsObj.Sender_Phone__c}" id="mobile"/>
</apex:pageBlockSection><br/>

<apex:commandButton value="Search" action="{!search}" /> &nbsp;&nbsp;
<apex:commandButton value="Reset" action="{!reset}"/> &nbsp;&nbsp;
<apex:commandButton value="Send SMS" action="{!processSelected}"/> &nbsp;&nbsp;

Number of Records Per Page &nbsp;: &nbsp;
<apex:selectList id="PicklistSize" value="{!size}" onchange="
var pagesize = document.getElementById('{!$Component.pages:form:block:PicklistSize}').value;
searchServer(pagesize);" size="1">
<apex:selectOption itemValue="20" itemLabel="20"/>
<apex:selectOption itemValue="30" itemLabel="30"/>
<apex:selectOption itemValue="40" itemLabel="40"/>
<apex:selectOption itemValue="50" itemLabel="50"/>
</apex:selectList>
</apex:pageBlock>
</td>
</tr>
<tr>
<td>
<apex:pageBlock id="block1">
<apex:pageBlockSection title="Customer Seach - {!pageNumber} / {!totalPageNo} Pages" collapsible="true" />
<apex:panelGrid columns="6">
<apex:commandLink action="{!first}" value="<<First" rerender="block1"></apex:commandlink>...
<apex:commandLink action="{!previous}" rendered="{!hasPrevious}" value="<Previous" rerender="block1"></apex:commandlink>
<apex:commandLink action="{!next}" rendered="{!hasNext}" value="Next>" rerender="block1"></apex:commandlink>...
<apex:commandLink action="{!last}" value="Last>>" rerender="block1"></apex:commandlink>
</apex:panelGrid>
<apex:pageBlockTable width="100%" value="{!Contacts}" var="c" rendered="{!NOT(ISNULL(Contacts))}" frame="below" id="table">
<apex:column width="5%">
<!-- This is our selected Boolean property in our wrapper class -->
<apex:inputCheckbox value="{!c.selected}"/>

</apex:column>
<apex:column width="14.28%" headerValue="Customer Name">
<a href="/{!c.con.Id}">
<apex:outputField value="{!c.con.LastName}"/></a>
</apex:column>
<apex:column width="14.28%" value="{!c.con.Customer_Mobile_No__c}" headerValue="Mobile Number"/>
<apex:column width="14.28%" value="{!c.con.Birthdate}" headerValue="Birth Date"/>
<apex:column width="14.28%" value="{!c.con.RecordTypeName__c}" headerValue="Customer Type"/>

</apex:pageBlockTable>
</apex:pageBlock>
</td>
</tr>
</table>
</apex:form>

</apex:page>

Please find my VF code below:

<apex:page controller="ContestDisplayController" id="page" showHeader="false" sidebar="false">
<apex:pageBlock title="Contest Images" id="block">
<apex:repeat value="{!contstPicList}" var="contnt" id="blckTable">
<apex:outputPanel layout="block" style="float:left;height:110px;margin:5px">
<a href="{!contnt.Document_URL__c}" target="_top">
<apex:outputField value="{!contnt.Picture__c}"/>
</a>
</apex:outputPanel>
</apex:repeat>
</apex:pageBlock>

</apex:page>

 

I have an inline style in ouputPanel tag but this is not working in IE browsers. And working in Chrome and Mozilla. 

Can anyone suggest me where I have done wrong?

In my web-to-case form, I want to specify a record type.  See html line below.  However, when I submit the form, the case record type is still set to the default record of the default case owner.  Do I have the correct syntax for the html line?  I checked the Support Settings and it is not set to override the type with the owner's default.

<input type=hidden name="RecordTypeId" value="01280000000G4N7AAK">

Hi,

 

Can someone help, I keep getting the error:

System.DmlException: Insert failed. First exception on row 0 with id 00oS0000000AOgYIAW; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

 

But I am pretty sure that there is no Id specified in my insert call.

Here is my code:

 

 

public PageReference save() { List<OpportunityLineItemSchedule> revenueSchedulesToUpdate = new List<OpportunityLineItemSchedule>(); List<OpportunityLineItemSchedule> revenueSchedulesToInsert = new List<OpportunityLineItemSchedule>(); for(revenueSchedulesDate revenueSchedulesDate:revenueSchedulesDates){ for(OpportunityLineItemSchedule revenueSchedule:revenueSchedulesDate.getRevenueSchedules()){ if(revenueSchedule.get('Id') == null) revenueSchedulesToInsert.add(revenueSchedule); else revenueSchedulesToUpdate.add(revenueSchedule); } if(revenueSchedulesToUpdate.size() > 0) update revenueSchedulesToUpdate; if(revenueSchedulesToInsert.size() > 0) insert revenueSchedulesToInsert; } return Page.revenueScheduleView2; }

 

 

 

Nomal behaviour in vf tables is to display one object per row of a table, with your desired fields as columns.

I'm trying to create a page where only one field per object is shown but they are displayed horizontally.

 

<apex:dataTable id="teamtable" value="{!MyTeam}" var="person">
  <apex:column > <apex:image url="{!person.Photo_URL__c}" height="150" width="200" /> </apex:column>
  <apex:column > <apex:outputText value="{!person.Name__c}" /> </apex:column>
</apex:dataTable>

 

So this is displaying all the team members vertically with a lot of white space on the right. Ideally I'd like to have 4 or 5 team members photos on a line each with their name underneath. Is this possible in VF ?

 

This makes absolutely no sense to me. I am trying to insert two OpportunityLineItems that are exactly the same but I get this exception. What good reason is there to stop the insertion of two Records that are the same?

I understand if this was an upsert operation as you can't insert and update and the same time but I am inserting two brand new OpportuntiyLineItem records.

Thanks,
Jason


Message Edited by TehNrd on 09-24-2008 04:48 PM
  • September 24, 2008
  • Like
  • 0
I can use the listViews tag to show the list views in a VF page

Is there any way of getting the records similar to GetRecordIds?

How would I link a VF button to these records?