-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
1Likes Given
-
8Questions
-
5Replies
ApexPagesHandledException on Opportunity list view
I am getting 'core.apexpages.exceptions.ApexPagesHandledException: Object type not accessible. Please check permissions and make sure the object is not in development mode: Opportunity WHERE ( ((Fiscal = Q3)) ) ORDER BY Name ASC LIMIT ^ ERROR at Row:1:Column:306 Bind variables only allowed in Apex code ' exception when I used StandardSetController. I have not used any SOQL query still getting this error, getting this error only for one list view (Q3 opps where Fiscal period is Q3), but for the other list views its working great.Please suggest how to resolve this error. Below is my class:
public with sharing class OppRecordSetVarController { private final Integer pageSize = 10; public integer pageNumber = 1; public boolean lastPage = false; private final String Could_Not_Save_Modified_Records = 'You have changed some values of the below records but did not save, please review the changes and "Save" the records then proceed.Otherwise “Cancel” to discard all pending changes.'; public transient Map<String, Decimal> probabilityStageNameMap; ApexPages.StandardSetController controller; public List<Opportunity> oppList{get;set;} PageReference pg; public OppRecordSetVarController(ApexPages.StandardSetController controller) { try{ this.controller = controller; controller.setPageSize(pageSize); oppList = new List<Opportunity>(); Id id = controller.getFilterId(); controller.setFilterId(Id); }catch(Exception e){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Sorry this list view is not Accessible from this page, Please select All Opportunities from Standard Opportunity view and the try reloading this page')); } } public void doNext(){ try{ controller.Next(); pageNumber++; lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doPrevious(){ try{ controller.Previous(); pageNumber--; lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doFirst(){ try{ controller.First(); pageNumber = 1; lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doLast(){ try{ controller.Last(); lastPage = true; pageNumber++; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public Boolean getHasPrevious(){ return this.controller.getHasPrevious(); } public Boolean getHasNext(){ return this.controller.getHasNext(); } public List<Opportunity> getOpportunities() { oppList = (List<Opportunity>) controller.getRecords(); System.debug('==oppList.size=='+oppList.size()); return (List<Opportunity>) controller.getRecords(); } public PageReference changeStageName(){ if (probabilityStageNameMap == null) { probabilityStageNameMap = new Map<String, Decimal>(); for (OpportunityStage oppStage : [Select MasterLabel, DefaultProbability From OpportunityStage]) { probabilityStageNameMap.put(oppStage.MasterLabel, oppStage.DefaultProbability); } } for(Opportunity op : oppList){ if (probabilityStageNameMap.containsKey(op.StageName)) { op.Probability = probabilityStageNameMap.get(op.StageName); } } return null; } public void changeListView(){ //controller.save(); } public PageReference doSave(){ PageReference p; try{ p = this.controller.save(); if(p != null){ //if(pageNumber != 1){ //pg = ApexPages.currentPage(); //pg.setRedirect(false); pg = new PageReference('/apex/OppListViewVF'); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, 'Records saved successfully!!')); //} } }catch(Exception exx){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'An error occured on the page.Please try again reloading the page.')); } return pg; } public PageReference doCancel(){ PageReference pgc; PageReference p = this.controller.cancel(); if(p != null){ pgc = new PageReference('/apex/OppListViewVF'); } return pgc; } }
- bappa
- November 12, 2014
- Like
- 0
sort by column header on vf for list view controller
I would like to implement sorting in VF column header for list views of Opportunity.I have used StandardSetController for this, the getRecords() method working very fine while changing the list views.But list returned from getRecords() is immmutable and i am not able to change or sort while clicking on any column header.Thought of using SOQL queries for each List view and sort using order by clause, but there the problem is for every users' list views may differ.So generating dynamic SOQL according to logged in users list view on Opportunity : if you have any idea in this please help.
Please also share any idea/thought related to sort a vf page by column header for list view controller.
MY Page is :
<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" sidebar="false" extensions="OppRecordSetVarController4" > <style> div.hideCurrDate span.dateInput span.dateFormat{ display:none; } </style> <apex:stylesheet value="{!URLFOR($Resource.Spinner, 'spinner.css')}"/> <apex:includeScript value="{!URLFOR($Resource.Spinner, 'jquery.min.js')}"/> <apex:includeScript value="{!URLFOR($Resource.Spinner, 'spinner.js')}"/> <div class="splashStatus" id="splashDiv"> <div class="circle"><img src="{!URLFOR($Resource.Spinner, 'spinner.gif')}"/></div> <div class="txt">Please Wait. Loading...</div> </div> <body> <apex:form id="theForm"> <apex:pageBlock id="thePageblock" > <apex:pageMessages /> <apex:pageBlockButtons location="bottom" id="paginationButtons"> <apex:commandButton value="First" action="{!doFirst}" disabled="{!!HasPrevious}" /> <apex:commandButton value="Previous" action="{!doPrevious}" disabled="{!!HasPrevious}" /> <apex:commandButton value="Next" action="{!doNext}" disabled="{!!hasnext}" /> <apex:commandButton value="Last" action="{!doLast}" disabled="{!!hasnext}" /> </apex:pageBlockButtons> <apex:pageBlockButtons location="top" > <apex:outputLabel value="Select View:" id="theOutputLabel"/> <apex:actionStatus id="splashStatus" onstart="startSplash();" onstop="endSplash();" /> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="thePageblock" status="splashStatus" /> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> <apex:commandButton value="Save" action="{!doSave}"/> <apex:commandButton value="Cancel" action="{!doCancel}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!opportunities}" var="opp" id="list1" > <td><apex:column headerValue="Account Name"> <apex:outputLink value="/{!opp.Account.Id}">{!opp.Account.Name}</apex:outputLink> </apex:column></td> <td><apex:column headerValue="Opportunity Name"> <apex:facet name="header"> <apex:commandLink action="{!ViewData}" value="Opportunity Name{!IF(sortExpression=='Name',IF(sortDirection='ASC','▲','▼'),'')}" reRender="thePageblock" > <apex:param value="Name" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <apex:outputLink value="/{!opp.id}">{!opp.Name}</apex:outputLink> </apex:column></td> <apex:column headerValue="Stage" > <apex:actionRegion > <apex:inputField value="{!opp.stageName}" style="width:90px"> <apex:actionSupport event="onchange" action="{!changeStageName}" reRender="probabilityInput" status="PStatus" /> <!-- <apex:param value="{!opp.stageName}" assignTo="{!selectedOppStage}"/> --> </apex:inputfield> </apex:actionRegion> </apex:column> <td ><apex:column headerValue="P(%)" id="probability"> <apex:actionStatus startText="Loading.." id="PStatus" /> <apex:inputField value="{!opp.Probability}" style="text-align:center;width:50px" id="probabilityInput"/> </apex:column> </td> <td><apex:column headerValue="Excl." > <apex:inputField value="{!opp.Exclude_From_Forecast__c}" style="width:30px"/> </apex:column></td> <td ><apex:column headerValue="W/Amount" > <apex:inputField value="{!opp.ExpectedRevenue}" style="text-align:right;width:60px" /> </apex:column> </td> <apex:column headerValue="PO Date"> <apex:facet name="header"> <apex:commandLink action="{!ViewData}" value="PO Date{!IF(sortExpression=='PO Date',IF(sortDirection='ASC','▲','▼'),'')}" reRender="thePageblock"> <apex:param value="PO Date" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <div class="hideCurrDate"> <apex:inputField value="{!opp.closeDate}" /> </div> </apex:column> <apex:column headerValue="D2Inv"> <apex:inputField value="{!opp.Days_to_Invoice__c}" style="text-align:center;width:30px"/> </apex:column> <apex:column headerValue="Invoice date"> <div class="hideCurrDate"> <apex:inputField value="{!opp.Invoice_Date__c}" style="width:70px"/> </div> </apex:column> <apex:column headerValue="Access"> <apex:inputField value="{!opp.Access__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Video"> <apex:inputField value="{!opp.Video__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Fire"> <apex:inputField value="{!opp.Fire__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Intrusion"> <apex:inputField value="{!opp.Intrusion__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Fiber"> <apex:inputField value="{!opp.Fiber__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Key Mgmt"> <apex:inputField value="{!opp.Key_Management__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Services"> <apex:inputField value="{!opp.Services__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Other"> <apex:inputField value="{!opp.Other__c}" style="text-align:right;width:60px"/> </apex:column> <!-- <apex:column headerValue="Fire D&A"> <apex:inputField value="{!opp.Fire_D_A__c}" style="width:60px"/> </apex:column> --> <!-- <apex:column headerValue="FireD&A HighHazards"> <apex:inputField value="{!opp.Fire_D_A_High_Hazards__c}" style="width:60px"/> </apex:column> --> <!-- <apex:column headerValue="Suppression"> <apex:inputField value="{!opp.Suppression__c}" style="width:60px"/> </apex:column> --> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </body> <div class="lightbox"></div> </apex:page>
My class is ;
public with sharing class OppRecordSetVarController4 { private final Integer pageSize = 5; public integer pageNumber = 1; public boolean lastPage = false; private final String Could_Not_Save_Modified_Records = 'You have changed some values of the below records but did not save, please review the changes and "Save" the records then proceed.Otherwise “Cancel” to discard all pending changes.'; public transient Map<String, Decimal> probabilityStageNameMap; ApexPages.StandardSetController controller; ApexPages.StandardSetController controller2; public List<Opportunity> oppList{get;set;} PageReference pg; public boolean pbt1{get;set;} public boolean pbt2{get;set;} private String sortDirection = 'ASC'; private String sortExp = 'name'; public List<Opportunity> sortedOppList{get;set;} public Set<Opportunity> sortedOppSet {get;set;} public OppRecordSetVarController4(ApexPages.StandardSetController controller) { this.controller = controller; controller.setPageSize(pageSize); oppList = new List<Opportunity>(); //oppList = controller.getRecords(); // pbt1 = true; //pbt2= false; //while(controller.getHasNext()){ // for(Opportunity o: (List<Opportunity>) controller.getRecords()){ //oppList.add(o); //} //controller.next(); //} getoppList(); } //**** Sorting Properties Starts****// public String sortExpression { get { return sortExp; } set { //if the column is clicked on then switch between Ascending and Descending modes if (value == sortExp) sortDirection = (sortDirection == 'ASC')? 'DESC' : 'ASC'; else sortDirection = 'ASC'; sortExp = value; } } public String getSortDirection() { //if not column is selected if (sortExpression == null || sortExpression == '') return 'ASC'; else return sortDirection; } public void setSortDirection(String value) { sortDirection = value; } public void doNext(){ try{ controller.Next(); //pageNumber++; //lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doPrevious(){ try{ controller.Previous(); // pageNumber--; //lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doFirst(){ try{ controller.First(); //pageNumber = 1; //lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doLast(){ try{ controller.Last(); //lastPage = true; //pageNumber++; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public Boolean getHasPrevious(){ return this.controller.getHasPrevious(); } public Boolean getHasNext(){ return this.controller.getHasNext(); } public List<Opportunity> getOpportunities() { //oppList = (List<Opportunity>) controller.getRecords(); //System.debug('==oppList.size=='+oppList.size()); return (List<Opportunity>) controller.getRecords(); } public List<Opportunity> getOppList() { oppList = (List<Opportunity>) controller.getRecords(); System.debug('==oppList=='+oppList); return oppList; } public PageReference changeStageName(){ if (probabilityStageNameMap == null) { probabilityStageNameMap = new Map<String, Decimal>(); for (OpportunityStage oppStage : [Select MasterLabel, DefaultProbability From OpportunityStage]) { probabilityStageNameMap.put(oppStage.MasterLabel, oppStage.DefaultProbability); } } for(Opportunity op : oppList){ if (probabilityStageNameMap.containsKey(op.StageName)) { op.Probability = probabilityStageNameMap.get(op.StageName); } } return null; } public void changeListView(){ controller.save(); } public void ViewData() { pageNumber = controller.getPageNumber(); while(controller.getHasNext()){ for(Opportunity o: (List<Opportunity>) controller.getRecords()){ oppList.add(o); } controller.next(); } controller.setPageNumber(pageNumber); //controller2 = new ApexPages.StandardSetController(oppList); } public PageReference doSave(){ PageReference p; try{ pageNumber = controller.getPageNumber(); p = this.controller.save(); //pageNumber = controller.getPageNumber(); if(p != null){ if(pageNumber != 1){ controller.setPageNumber(pageNumber -1); controller.next(); } //pg = ApexPages.currentPage(); //pg.setRedirect(false); pg = new PageReference('/apex/OppListViewVFv3'); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, 'Records saved successfully!!')); //} } }catch(Exception exx){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'An error occured on the page.Please try again reloading the page.')); } return null; } public PageReference doCancel(){ PageReference pgc; PageReference p = this.controller.cancel(); if(p != null){ pgc = new PageReference('/apex/OppListViewVF'); } return pgc; } }
Thanks,
Bappa
- bappa
- October 30, 2014
- Like
- 0
how to return to next set of records from standardSet Controller save method?
public PageReference doSave(){ PageReference p; try{ p = this.controller.save(); if(p != null){ if(controller.getPageNumber() == 1){ pg = new PageReference('/apex/OppListViewSorted'); } else if(controller.getPageNumber() == 2){ } ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, 'Records saved successfully!!')); //} } }catch(Exception exx){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'An error occured on the page.Please try again reloading the page.')); } return pg; }and VF is :
<apex:page standardController="Opportunity" recordSetVar="Opportunities" tabStyle="Opportunity" sidebar="false" extensions="OppListControllerSorting" > <style> div.hideCurrDate span.dateInput span.dateFormat{ display:none; } </style> <apex:stylesheet value="{!URLFOR($Resource.Spinner, 'spinner.css')}"/> <apex:includeScript value="{!URLFOR($Resource.Spinner, 'jquery.min.js')}"/> <apex:includeScript value="{!URLFOR($Resource.Spinner, 'spinner.js')}"/> <div class="splashStatus" id="splashDiv"> <div class="circle"><img src="{!URLFOR($Resource.Spinner, 'spinner.gif')}"/></div> <div class="txt">Please Wait. Loading...</div> </div> <body> <apex:form id="theForm" > <apex:pageBlock id="thePageblock" > <apex:pageMessages /> <apex:pageBlockButtons location="bottom" id="paginationButtons" > <apex:commandButton value="First" action="{!doFirst}" disabled="{!!HasPrevious}" /> <apex:commandButton value="Previous" action="{!doPrevious}" disabled="{!!HasPrevious}" /> <apex:commandButton value="Next" action="{!doNext}" disabled="{!!hasnext}" /> <apex:commandButton value="Last" action="{!doLast}" disabled="{!!hasnext}" /> </apex:pageBlockButtons> <apex:pageBlockButtons location="top" > <apex:outputLabel value="Select View:" id="theOutputLabel"/> <apex:actionStatus id="splashStatus" onstart="startSplash();" onstop="endSplash();" /> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="thePageblock" status="splashStatus" action="{!changeListView}"/> <apex:selectOptions value="{!OpportunityExistingViews}"/> </apex:selectList> <apex:commandButton value="Save" action="{!doSave}"/> <apex:commandButton value="Cancel" action="{!doCancel}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!Opportunities}" var="opp" id="list" > <td><apex:column headerValue="Account Name"> <apex:outputLink value="/{!opp.Account.Id}">{!opp.Account.Name}</apex:outputLink> </apex:column></td> <td><apex:column headerValue="Opportunity Name"> <apex:facet name="header"> <apex:commandLink action="{!ViewData}" value="Opportunity Name{!IF(sortExpression=='Name',IF(sortDirection='ASC','▲','▼'),'')}" status="splashStatus" onmouseover="showHelp()"> <apex:param value="Name" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <apex:outputLink value="/{!opp.id}">{!opp.Name}</apex:outputLink> </apex:column></td> <apex:column headerValue="Stage" > <apex:actionRegion > <apex:inputField value="{!opp.stageName}" style="width:90px"> <apex:actionSupport event="onchange" action="{!changeStageName}" reRender="probabilityInput" status="PStatus" /> <!-- <apex:param value="{!opp.stageName}" assignTo="{!selectedOppStage}"/> --> </apex:inputfield> </apex:actionRegion> </apex:column> <td ><apex:column headerValue="P(%)" id="probability"> <apex:actionStatus startText="Loading.." id="PStatus" /> <apex:inputField value="{!opp.Probability}" style="text-align:center;width:50px" id="probabilityInput"/> </apex:column> </td> <td><apex:column headerValue="Excl." > <apex:inputField value="{!opp.Exclude_From_Forecast__c}" style="width:30px"/> </apex:column></td> <td ><apex:column headerValue="W/Amount" > <apex:inputField value="{!opp.ExpectedRevenue}" style="text-align:right;width:60px" /> </apex:column> </td> <apex:column headerValue="PO Date"> <apex:facet name="header"> <apex:commandLink action="{!ViewData}" value="PO Date{!IF(sortExpression=='PO Date',IF(sortDirection='ASC','▲','▼'),'')}" status="splashStatus" onmouseover="showHelp()" > <apex:param value="PO Date" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <div class="hideCurrDate"> <apex:inputField value="{!opp.closeDate}" /> </div> </apex:column> <apex:column headerValue="D2Inv"> <apex:inputField value="{!opp.Days_to_Invoice__c}" style="text-align:center;width:30px"/> </apex:column> <apex:column headerValue="Invoice date"> <div class="hideCurrDate"> <apex:inputField value="{!opp.Invoice_Date__c}" style="width:70px"/> </div> </apex:column> <apex:column headerValue="Access"> <apex:inputField value="{!opp.Access__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Video"> <apex:inputField value="{!opp.Video__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Fire"> <apex:inputField value="{!opp.Fire__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Intrusion"> <apex:inputField value="{!opp.Intrusion__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Fiber"> <apex:inputField value="{!opp.Fiber__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Key Mgmt"> <apex:inputField value="{!opp.Key_Management__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Services"> <apex:inputField value="{!opp.Services__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Other"> <apex:inputField value="{!opp.Other__c}" style="text-align:right;width:60px"/> </apex:column> <!-- <apex:column headerValue="Fire D&A"> <apex:inputField value="{!opp.Fire_D_A__c}" style="width:60px"/> </apex:column> --> <!-- <apex:column headerValue="FireD&A HighHazards"> <apex:inputField value="{!opp.Fire_D_A_High_Hazards__c}" style="width:60px"/> </apex:column> --> <!-- <apex:column headerValue="Suppression"> <apex:inputField value="{!opp.Suppression__c}" style="width:60px"/> </apex:column> --> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </body> <div class="lightbox"></div> </apex:page>
- bappa
- October 21, 2014
- Like
- 0
Salesforce for outlook side panel '+' icon not appearing
I am not able to see the '+' icon in my Salesforce for outlook sidepanel.Email to case is configured in my org.
Outlook configuration:
I would tlike to get '+' icon in SFO side panel like in the red circle in below picture:
Please help.
Thanks,
Sagar
- bappa
- June 28, 2014
- Like
- 0
User deactivation : email alert
We would like to deactivate one user and want to assign another active user in all the email alerts,assignment rules associated with him.
1.We want to achieve it in a custom way.Because if there are 100 email alerts associated with the user we want to deactivate, manually it will take a lot of time.
2.Do we have any object from which we can get the data of email alerts,assignment rules related to a user?
Overall any idea related to deactivating a user succesfully and assign all its assignment rules and email alerts to other active users are welcome.
Thanks,
- bappa
- June 03, 2014
- Like
- 1
How would I populate Opportunity Stage values against record type in a visualforce page?
- bappa
- December 28, 2013
- Like
- 0
Account : Add Default Team
Hi All,
I have a small question,
In case of Opportunity team, if I dont have any Default Opportunity Team , I click 'Add Default Team' , a pop up will come 'The record owner does not have a default opportunity team.You can define default Opportunity team in User setup.'
If I do not have any default account team, then also I click 'Add Default Team' its refreshing the current Account Detail page.No pop up message is coming up.Is this an expected behaviour? Why the same type of pop up its coming in this case?
Please reply.
Thanks.
- bappa
- December 09, 2013
- Like
- 0
System.LimitException: Apex CPU time limit exceeded
Hi All,
I am getting 'System.LimitException: Apex CPU time limit exceeded' error while reading and parsing XML as web service response.Debug log jhas reached its maximum size.
Below is my class:
public class readXMLResponseAndMapXMLDom{
public List<SiteSolutionProperty> getMap(){
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('URL'); // did not include the actual URL; conncetion is successful.
req.setMethod('GET');
HttpResponse res = http.send(req);
List<XmlDom.Element> result1 = new List<XmlDom.Element>();
List<SiteSolutionProperty> result2 = new List<SiteSolutionProperty>();
SiteSolutionProperty ssp;
List<SiteSolutionPropertyDetails> finalResult = new List<SiteSolutionPropertyDetails>();
Integer counter = 0;
// create the xml doc that will contain the results of the REST operation
/********* USING XMLDOM ******/
XmlDom doc = new XmlDom(res.getBody());
// process the results
//System.debug('Total Collection size ---'+doc.getElementsByTagName('ClassBrokerAvailabilities').size());
system.debug('Limits.getHeapSize()'+Limits.getHeapSize());
for (XmlDom.Element element: doc.getElementsByTagName('ClassBrokerAvailabilities')){
ssp = new SiteSolutionProperty();
//element.textContent()
if(element.getElementsByTagName('BuildingKey') !=null){
//System.out.println("IF child name "+element.getElementsByTagName("BuildingKey").item(0).getTextContent());
ssp.setBuildingKey(element.getElementsByTagName('BuildingKey').get(0).textContent());
}
if(element.getElementsByTagName('AddressLine2') !=null){
ssp.setAddressLine2(element.getElementsByTagName('AddressLine2').get(0).textContent());
}
if(element.getElementsByTagName('BuildingName') !=null){
ssp.setBuildingName(element.getElementsByTagName('BuildingName').get(0).textContent());
}
/*if(element.getElementsByTagName('BuildingOwner') !=null){
ssp.setBuildingOwner(element.getElementsByTagName('BuildingOwner').get(0).textContent());
}*/
/*if(element.getElementsByTagName('BuildingStatus') !=null){
ssp.setBuildingStatus(element.getElementsByTagName('BuildingStatus').get(0).textContent());
}*/
if(element.getElementsByTagName('City_State') !=null){
ssp.setCity_State(element.getElementsByTagName('City_State').get(0).textContent());
}
/*if(element.getElementsByTagName('DateBuilt') !=null){
ssp.setDateBuilt(element.getElementsByTagName('DateBuilt').get(0).textContent());
}*/
/*if(element.getElementsByTagName('ForSale') !=null){
ssp.setForSale(element.getElementsByTagName('ForSale').get(0).textContent());
}*/
if(element.getElementsByTagName('LeasingAgent') !=null){
ssp.setLeasingAgent(element.getElementsByTagName('LeasingAgent').get(0).textContent());
}
if(element.getElementsByTagName('MarketName') !=null){
ssp.setMarketName(element.getElementsByTagName('MarketName').get(0).textContent());
}
/*if(element.getElementsByTagName('PropertyClass') !=null){
ssp.setPropertyClass(element.getElementsByTagName('PropertyClass').get(0).textContent());
}*/
if(element.getElementsByTagName('Recordnumber') !=null){
ssp.setRecordnumber(element.getElementsByTagName('Recordnumber').get(0).textContent());
}
if(element.getElementsByTagName('Rent') !=null){
ssp.setRent(element.getElementsByTagName('Rent').get(0).textContent());
}
if(element.getElementsByTagName('Rentable') !=null){
ssp.setRentable(element.getElementsByTagName('Rentable').get(0).textContent());
}
/*if(element.getElementsByTagName('SubMarket') !=null){
ssp.setSubMarket(element.getElementsByTagName('SubMarket').get(0).textContent());
}*/
/*if(element.getElementsByTagName('Vacant') !=null){
ssp.setVacant(element.getElementsByTagName('Vacant').get(0).textContent());
}*/
result2.add(ssp);
}
return result2;
}
}
and the Vf page is below:
<apex:page controller="readXMLResponseAndMapXMLDom" standardStylesheets="false" sidebar="false"> <apex:form > <apex:pageBlock > <!-- section for button Add Property --> <apex:pageBlockButtons > <apex:commandButton value="Add Selected Property" action="{!propertySelected}" rerender="table"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!MAP}" var="propdetails" id="table"> <apex:column > <!-- This is our select checkbox to select Properties data --> <apex:inputCheckbox value="{!propdetails.selected}"/> </apex:column> <!-- Site Property Solution Details --> <!-- <apex:column headerValue="Recordnumber" value="{!propdetails.Recordnumber}" /> --> <apex:column headerValue="BuildingKey" value="{!propdetails.BuildingKey}" /> <!-- <apex:column headerValue="BuildingName" value="{!propdetails.BuildingName}" /> <apex:column headerValue="AddressLine2" value="{!propdetails.AddressLine2}" /> <apex:column headerValue="City_State" value="{!propdetails.City_State}" /> <apex:column headerValue="MarketName" value="{!propdetails.MarketName}" /> <apex:column headerValue="Rentable" value="{!propdetails.Rentable}" /> <apex:column headerValue="Vacant" value="{!propdetails.Vacant}" /> <apex:column headerValue="PropertyClass" value="{!propdetails.PropertyClass}" /> <apex:column headerValue="Rent" value="{!propdetails.Rent}" /> <apex:column headerValue="LeasingAgent" value="{!propdetails.LeasingAgent}" /> <apex:column headerValue="SubMarket" value="{!propdetails.SubMarket}" /> <apex:column headerValue="BuildingType" value="{!propdetails.BuildingType}" /> <apex:column headerValue="BuildingStatus" value="{!propdetails.BuildingStatus}" /> <apex:column headerValue="DateBuilt" value="{!propdetails.DateBuilt}" /> <apex:column headerValue="ForSale" value="{!propdetails.ForSale}" /> <apex:column headerValue="BuildingOwner" value="{!propdetails.BuildingOwner}" /> --> </apex:pageBlockTable> </apex:pageBlock> <apex:panelGrid columns="4"> <apex:commandLink action="{!first}">First</apex:commandlink> <apex:commandLink action="{!previous}" rendered="{!hasPrevious}">Previous</apex:commandlink> <apex:commandLink action="{!next}" rendered="{!hasNext}">Next</apex:commandlink> <apex:commandLink action="{!last}">Last</apex:commandlink> </apex:panelGrid> </apex:form> </apex:page>
- bappa
- November 07, 2013
- Like
- 0
User deactivation : email alert
We would like to deactivate one user and want to assign another active user in all the email alerts,assignment rules associated with him.
1.We want to achieve it in a custom way.Because if there are 100 email alerts associated with the user we want to deactivate, manually it will take a lot of time.
2.Do we have any object from which we can get the data of email alerts,assignment rules related to a user?
Overall any idea related to deactivating a user succesfully and assign all its assignment rules and email alerts to other active users are welcome.
Thanks,
- bappa
- June 03, 2014
- Like
- 1
ApexPagesHandledException on Opportunity list view
I am getting 'core.apexpages.exceptions.ApexPagesHandledException: Object type not accessible. Please check permissions and make sure the object is not in development mode: Opportunity WHERE ( ((Fiscal = Q3)) ) ORDER BY Name ASC LIMIT ^ ERROR at Row:1:Column:306 Bind variables only allowed in Apex code ' exception when I used StandardSetController. I have not used any SOQL query still getting this error, getting this error only for one list view (Q3 opps where Fiscal period is Q3), but for the other list views its working great.Please suggest how to resolve this error. Below is my class:
public with sharing class OppRecordSetVarController { private final Integer pageSize = 10; public integer pageNumber = 1; public boolean lastPage = false; private final String Could_Not_Save_Modified_Records = 'You have changed some values of the below records but did not save, please review the changes and "Save" the records then proceed.Otherwise “Cancel” to discard all pending changes.'; public transient Map<String, Decimal> probabilityStageNameMap; ApexPages.StandardSetController controller; public List<Opportunity> oppList{get;set;} PageReference pg; public OppRecordSetVarController(ApexPages.StandardSetController controller) { try{ this.controller = controller; controller.setPageSize(pageSize); oppList = new List<Opportunity>(); Id id = controller.getFilterId(); controller.setFilterId(Id); }catch(Exception e){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'Sorry this list view is not Accessible from this page, Please select All Opportunities from Standard Opportunity view and the try reloading this page')); } } public void doNext(){ try{ controller.Next(); pageNumber++; lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doPrevious(){ try{ controller.Previous(); pageNumber--; lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doFirst(){ try{ controller.First(); pageNumber = 1; lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doLast(){ try{ controller.Last(); lastPage = true; pageNumber++; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public Boolean getHasPrevious(){ return this.controller.getHasPrevious(); } public Boolean getHasNext(){ return this.controller.getHasNext(); } public List<Opportunity> getOpportunities() { oppList = (List<Opportunity>) controller.getRecords(); System.debug('==oppList.size=='+oppList.size()); return (List<Opportunity>) controller.getRecords(); } public PageReference changeStageName(){ if (probabilityStageNameMap == null) { probabilityStageNameMap = new Map<String, Decimal>(); for (OpportunityStage oppStage : [Select MasterLabel, DefaultProbability From OpportunityStage]) { probabilityStageNameMap.put(oppStage.MasterLabel, oppStage.DefaultProbability); } } for(Opportunity op : oppList){ if (probabilityStageNameMap.containsKey(op.StageName)) { op.Probability = probabilityStageNameMap.get(op.StageName); } } return null; } public void changeListView(){ //controller.save(); } public PageReference doSave(){ PageReference p; try{ p = this.controller.save(); if(p != null){ //if(pageNumber != 1){ //pg = ApexPages.currentPage(); //pg.setRedirect(false); pg = new PageReference('/apex/OppListViewVF'); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, 'Records saved successfully!!')); //} } }catch(Exception exx){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'An error occured on the page.Please try again reloading the page.')); } return pg; } public PageReference doCancel(){ PageReference pgc; PageReference p = this.controller.cancel(); if(p != null){ pgc = new PageReference('/apex/OppListViewVF'); } return pgc; } }
- bappa
- November 12, 2014
- Like
- 0
sort by column header on vf for list view controller
I would like to implement sorting in VF column header for list views of Opportunity.I have used StandardSetController for this, the getRecords() method working very fine while changing the list views.But list returned from getRecords() is immmutable and i am not able to change or sort while clicking on any column header.Thought of using SOQL queries for each List view and sort using order by clause, but there the problem is for every users' list views may differ.So generating dynamic SOQL according to logged in users list view on Opportunity : if you have any idea in this please help.
Please also share any idea/thought related to sort a vf page by column header for list view controller.
MY Page is :
<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" sidebar="false" extensions="OppRecordSetVarController4" > <style> div.hideCurrDate span.dateInput span.dateFormat{ display:none; } </style> <apex:stylesheet value="{!URLFOR($Resource.Spinner, 'spinner.css')}"/> <apex:includeScript value="{!URLFOR($Resource.Spinner, 'jquery.min.js')}"/> <apex:includeScript value="{!URLFOR($Resource.Spinner, 'spinner.js')}"/> <div class="splashStatus" id="splashDiv"> <div class="circle"><img src="{!URLFOR($Resource.Spinner, 'spinner.gif')}"/></div> <div class="txt">Please Wait. Loading...</div> </div> <body> <apex:form id="theForm"> <apex:pageBlock id="thePageblock" > <apex:pageMessages /> <apex:pageBlockButtons location="bottom" id="paginationButtons"> <apex:commandButton value="First" action="{!doFirst}" disabled="{!!HasPrevious}" /> <apex:commandButton value="Previous" action="{!doPrevious}" disabled="{!!HasPrevious}" /> <apex:commandButton value="Next" action="{!doNext}" disabled="{!!hasnext}" /> <apex:commandButton value="Last" action="{!doLast}" disabled="{!!hasnext}" /> </apex:pageBlockButtons> <apex:pageBlockButtons location="top" > <apex:outputLabel value="Select View:" id="theOutputLabel"/> <apex:actionStatus id="splashStatus" onstart="startSplash();" onstop="endSplash();" /> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="thePageblock" status="splashStatus" /> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> <apex:commandButton value="Save" action="{!doSave}"/> <apex:commandButton value="Cancel" action="{!doCancel}"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!opportunities}" var="opp" id="list1" > <td><apex:column headerValue="Account Name"> <apex:outputLink value="/{!opp.Account.Id}">{!opp.Account.Name}</apex:outputLink> </apex:column></td> <td><apex:column headerValue="Opportunity Name"> <apex:facet name="header"> <apex:commandLink action="{!ViewData}" value="Opportunity Name{!IF(sortExpression=='Name',IF(sortDirection='ASC','▲','▼'),'')}" reRender="thePageblock" > <apex:param value="Name" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <apex:outputLink value="/{!opp.id}">{!opp.Name}</apex:outputLink> </apex:column></td> <apex:column headerValue="Stage" > <apex:actionRegion > <apex:inputField value="{!opp.stageName}" style="width:90px"> <apex:actionSupport event="onchange" action="{!changeStageName}" reRender="probabilityInput" status="PStatus" /> <!-- <apex:param value="{!opp.stageName}" assignTo="{!selectedOppStage}"/> --> </apex:inputfield> </apex:actionRegion> </apex:column> <td ><apex:column headerValue="P(%)" id="probability"> <apex:actionStatus startText="Loading.." id="PStatus" /> <apex:inputField value="{!opp.Probability}" style="text-align:center;width:50px" id="probabilityInput"/> </apex:column> </td> <td><apex:column headerValue="Excl." > <apex:inputField value="{!opp.Exclude_From_Forecast__c}" style="width:30px"/> </apex:column></td> <td ><apex:column headerValue="W/Amount" > <apex:inputField value="{!opp.ExpectedRevenue}" style="text-align:right;width:60px" /> </apex:column> </td> <apex:column headerValue="PO Date"> <apex:facet name="header"> <apex:commandLink action="{!ViewData}" value="PO Date{!IF(sortExpression=='PO Date',IF(sortDirection='ASC','▲','▼'),'')}" reRender="thePageblock"> <apex:param value="PO Date" name="column" assignTo="{!sortExpression}" ></apex:param> </apex:commandLink> </apex:facet> <div class="hideCurrDate"> <apex:inputField value="{!opp.closeDate}" /> </div> </apex:column> <apex:column headerValue="D2Inv"> <apex:inputField value="{!opp.Days_to_Invoice__c}" style="text-align:center;width:30px"/> </apex:column> <apex:column headerValue="Invoice date"> <div class="hideCurrDate"> <apex:inputField value="{!opp.Invoice_Date__c}" style="width:70px"/> </div> </apex:column> <apex:column headerValue="Access"> <apex:inputField value="{!opp.Access__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Video"> <apex:inputField value="{!opp.Video__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Fire"> <apex:inputField value="{!opp.Fire__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Intrusion"> <apex:inputField value="{!opp.Intrusion__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Fiber"> <apex:inputField value="{!opp.Fiber__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Key Mgmt"> <apex:inputField value="{!opp.Key_Management__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Services"> <apex:inputField value="{!opp.Services__c}" style="text-align:right;width:60px"/> </apex:column> <apex:column headerValue="Other"> <apex:inputField value="{!opp.Other__c}" style="text-align:right;width:60px"/> </apex:column> <!-- <apex:column headerValue="Fire D&A"> <apex:inputField value="{!opp.Fire_D_A__c}" style="width:60px"/> </apex:column> --> <!-- <apex:column headerValue="FireD&A HighHazards"> <apex:inputField value="{!opp.Fire_D_A_High_Hazards__c}" style="width:60px"/> </apex:column> --> <!-- <apex:column headerValue="Suppression"> <apex:inputField value="{!opp.Suppression__c}" style="width:60px"/> </apex:column> --> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </body> <div class="lightbox"></div> </apex:page>
My class is ;
public with sharing class OppRecordSetVarController4 { private final Integer pageSize = 5; public integer pageNumber = 1; public boolean lastPage = false; private final String Could_Not_Save_Modified_Records = 'You have changed some values of the below records but did not save, please review the changes and "Save" the records then proceed.Otherwise “Cancel” to discard all pending changes.'; public transient Map<String, Decimal> probabilityStageNameMap; ApexPages.StandardSetController controller; ApexPages.StandardSetController controller2; public List<Opportunity> oppList{get;set;} PageReference pg; public boolean pbt1{get;set;} public boolean pbt2{get;set;} private String sortDirection = 'ASC'; private String sortExp = 'name'; public List<Opportunity> sortedOppList{get;set;} public Set<Opportunity> sortedOppSet {get;set;} public OppRecordSetVarController4(ApexPages.StandardSetController controller) { this.controller = controller; controller.setPageSize(pageSize); oppList = new List<Opportunity>(); //oppList = controller.getRecords(); // pbt1 = true; //pbt2= false; //while(controller.getHasNext()){ // for(Opportunity o: (List<Opportunity>) controller.getRecords()){ //oppList.add(o); //} //controller.next(); //} getoppList(); } //**** Sorting Properties Starts****// public String sortExpression { get { return sortExp; } set { //if the column is clicked on then switch between Ascending and Descending modes if (value == sortExp) sortDirection = (sortDirection == 'ASC')? 'DESC' : 'ASC'; else sortDirection = 'ASC'; sortExp = value; } } public String getSortDirection() { //if not column is selected if (sortExpression == null || sortExpression == '') return 'ASC'; else return sortDirection; } public void setSortDirection(String value) { sortDirection = value; } public void doNext(){ try{ controller.Next(); //pageNumber++; //lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doPrevious(){ try{ controller.Previous(); // pageNumber--; //lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doFirst(){ try{ controller.First(); //pageNumber = 1; //lastPage = false; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public void doLast(){ try{ controller.Last(); //lastPage = true; //pageNumber++; }catch(Exception e){ ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.WARNING,Could_Not_Save_Modified_Records)); } } public Boolean getHasPrevious(){ return this.controller.getHasPrevious(); } public Boolean getHasNext(){ return this.controller.getHasNext(); } public List<Opportunity> getOpportunities() { //oppList = (List<Opportunity>) controller.getRecords(); //System.debug('==oppList.size=='+oppList.size()); return (List<Opportunity>) controller.getRecords(); } public List<Opportunity> getOppList() { oppList = (List<Opportunity>) controller.getRecords(); System.debug('==oppList=='+oppList); return oppList; } public PageReference changeStageName(){ if (probabilityStageNameMap == null) { probabilityStageNameMap = new Map<String, Decimal>(); for (OpportunityStage oppStage : [Select MasterLabel, DefaultProbability From OpportunityStage]) { probabilityStageNameMap.put(oppStage.MasterLabel, oppStage.DefaultProbability); } } for(Opportunity op : oppList){ if (probabilityStageNameMap.containsKey(op.StageName)) { op.Probability = probabilityStageNameMap.get(op.StageName); } } return null; } public void changeListView(){ controller.save(); } public void ViewData() { pageNumber = controller.getPageNumber(); while(controller.getHasNext()){ for(Opportunity o: (List<Opportunity>) controller.getRecords()){ oppList.add(o); } controller.next(); } controller.setPageNumber(pageNumber); //controller2 = new ApexPages.StandardSetController(oppList); } public PageReference doSave(){ PageReference p; try{ pageNumber = controller.getPageNumber(); p = this.controller.save(); //pageNumber = controller.getPageNumber(); if(p != null){ if(pageNumber != 1){ controller.setPageNumber(pageNumber -1); controller.next(); } //pg = ApexPages.currentPage(); //pg.setRedirect(false); pg = new PageReference('/apex/OppListViewVFv3'); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, 'Records saved successfully!!')); //} } }catch(Exception exx){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'An error occured on the page.Please try again reloading the page.')); } return null; } public PageReference doCancel(){ PageReference pgc; PageReference p = this.controller.cancel(); if(p != null){ pgc = new PageReference('/apex/OppListViewVF'); } return pgc; } }
Thanks,
Bappa
- bappa
- October 30, 2014
- Like
- 0
Salesforce for outlook side panel '+' icon not appearing
I am not able to see the '+' icon in my Salesforce for outlook sidepanel.Email to case is configured in my org.
Outlook configuration:
I would tlike to get '+' icon in SFO side panel like in the red circle in below picture:
Please help.
Thanks,
Sagar
- bappa
- June 28, 2014
- Like
- 0
User deactivation : email alert
We would like to deactivate one user and want to assign another active user in all the email alerts,assignment rules associated with him.
1.We want to achieve it in a custom way.Because if there are 100 email alerts associated with the user we want to deactivate, manually it will take a lot of time.
2.Do we have any object from which we can get the data of email alerts,assignment rules related to a user?
Overall any idea related to deactivating a user succesfully and assign all its assignment rules and email alerts to other active users are welcome.
Thanks,
- bappa
- June 03, 2014
- Like
- 1
Account : Add Default Team
Hi All,
I have a small question,
In case of Opportunity team, if I dont have any Default Opportunity Team , I click 'Add Default Team' , a pop up will come 'The record owner does not have a default opportunity team.You can define default Opportunity team in User setup.'
If I do not have any default account team, then also I click 'Add Default Team' its refreshing the current Account Detail page.No pop up message is coming up.Is this an expected behaviour? Why the same type of pop up its coming in this case?
Please reply.
Thanks.
- bappa
- December 09, 2013
- Like
- 0
Live Agent Peculiarities.
I am sometimes amazed how a seemingly simple thing is some times made unneccessary difficult. Say you want to start a Live Agent session and have an input field to type an email address in right away without bothering the user with a pre-chat form. Should be as simple as the following code, right?:
<html> <head> <!-- THIS NEEDS TO BE INCLUDED FOR EVERYTHING TO WORK --> <script type='text/javascript' src='https://c.la1c1.salesforceliveagent.com/content/g/deployment.js'></script> <script type='text/javascript'> liveagent.init('https://d.la1c1.salesforceliveagent.com/chat', '572D0000000011K', '00DD0000000oGsq'); </script> <!-- END INCLUDE --> </head> <body> <!-- THIS IS JUST THE HEADER OF THE PAGE --> <h1>Chat med en kundebehandler!</h1> <!-- HERES THE BUTTON CODE FROM SF. ADD CONTENT WHERE THE COMMENT IS --> <div id="liveagent_button_online_573D0000000016a" style="display: none;" > <input type="text" name="email" id="chatter_email" onBlur="emailUpdate()"/><br/> <a href="javascript://Chat" onclick="liveagent.startChat('573D0000000016a')">Fyll inn din e-post og trykk her for å chatte</a> </div> <div id="liveagent_button_offline_573D0000000016a" style="display: none;">Kundebehandler offline</div> <script type="text/javascript"> if (!window._laq) { window._laq = []; } window._laq.push(function() {liveagent.showWhenOnline('573D0000000016a', document.getElementById('liveagent_button_online_573D0000000016a')); liveagent.showWhenOffline('573D0000000016a', document.getElementById('liveagent_button_offline_573D0000000016a')); }); function emailUpdate() { liveagent.addCustomDetail('Contact E-Mail', document.getElementById('chatter_email').value).map('Contact', 'Email', true, true, false); } </script> <!-- END OF BUTTON CODE --> </body> </html>
But no - you get a javascript exception: "you cannot add a detail after page initialization".
In practice this means that you can add whatever you like before you load the page, but if you want the user to input something - you're ... toast (that was not the word I wanted to use, so I leave that up to your imagination).
Stuff like that irritates me like a red hot poker up the butt.
Thanks for listening :) ...
- FinnArildFluido
- April 11, 2013
- Like
- 2