-
ChatterFeed
-
1Best Answers
-
1Likes Received
-
0Likes Given
-
5Questions
-
8Replies
No picklist values on my visualforce page
Hello,
I'm not a coder by any stretch, but I've been dabbling a bit to see if I can learn. We currently have a customer Lead convert page in our org where I'd like to add a field for "Qualifying Reason" (a custom picklist that has been created on the Lead). I mimicked some existing code to get the field on the visual force page and I tried to update the controller, by mimicking existing code as well.
What I get is a field for "Qualifying Reason" and picklist box with no values. From researching around, it looks like I need additional coding in my controller to pull the values, but my various attempts to do so have only created errors for me...
Can anyone provide any gudiance here?
Thank you!!!
TK
Visual Force Page:
<apex:pageblocksectionitem >
<apex:outputlabel >Converted Status</apex:outputlabel>
<apex:outputPanel layout="block" styleClass="requiredInput">
<apex:outputPanel layout="block" styleClass="requiredBlock"/>
<apex:selectlist value="{!ConvertedStatus}" required="true" multiselect="false" size="1" onchange="processChange()">
<apex:selectOptions value="{!ConvertedStatuses}"/>
</apex:selectlist>
</apex:outputpanel>
</apex:pageblocksectionitem>
Controller:
public String QualifyingReason {get; set;}
public List<SelectOption> QualifyingReasons {get; set;}
What my page looks like:
- TraciKim
- March 02, 2016
- Like
- 0
- Continue reading or reply
How to capture the URL of a webpage containing a Live Agent chat button?
I added some JavaScript to pass in this detail from the webpage.
`liveagent.addCustomDetail('URL', window.location.href);`
This works fine from a test HTML page on my desktop, but when we put the code on our testing website the URL doesn't get passed through.
On the webpage the code is in the `<body>` tag and looks like this.
<script type="text/javascript"> if (!window._laq) { window._laq = []; } window._laq.push(function(){ liveagent.showWhenOnline('573XXXXXXXXXXXX', document.getElementById('liveagent_button_online_573XXXXXXXXXXXX')); liveagent.showWhenOffline('573XXXXXXXXXXXX', document.getElementById('liveagent_button_offline_573XXXXXXXXXXXX')); }); </script> <script type='text/javascript' src='https://c.la3-c2cs-chi.salesforceliveagent.com/content/g/js/37.0/deployment.js'></script> <script> // liveagent.addCustomDetail('URL', window.location.href); Doesn't work either window.onload=liveagent.addCustomDetail('URL', window.location.href); </script> <script type='text/javascript'> liveagent.init('https://d.la3-c2cs-chi.salesforceliveagent.com/chat', '572XXXXXXXXXXXX', '00DXXXXXXXXXXXX'); </script>I'm not JavaScript wiz so I'm not sure if/how much placement matters.
Also using FireFox firebug I see this error when I refresh the page
> ReferenceError: liveagent is not defined
I suspect this is caused by the `addCustomDetail` function but I'm not sure exactly how to find exactly where it is happening.
- Doug Beltowski X
- October 12, 2016
- Like
- 0
- Continue reading or reply
Using Visual Flow set a Date field to Null / Blank
- Doug Beltowski X
- January 25, 2016
- Like
- 1
- Continue reading or reply
Remote Object Query not respecting multiple conditions on single field
{ where: { RecordTypeId: {in: ids}, Custom_Boolean__c: {eq: true}, Custom_Date_Time__c: {gte: new Date('2014-1-1')}, Custom_Date_Time__c: {lte: new Date('2016-1-1')} }, limit: 100 }Is this a bug/limitation with Remote Objects, or is my query somehow malformed?
- Doug Beltowski X
- January 08, 2016
- Like
- 0
- Continue reading or reply
The page you submitted was invalid for your session. Please click Save again to confirm your change.
I'm getting this error "The page you submitted was invalid for your session. Please click Save again to confirm your change." from an inline Visualforce page on page layout.
We have 2 Standard Objects in which we've added inline Visualforce pages for our support personel to verifiy a customers pin. The PIN is stored encrypted on the Contact sObject. The VF page and accompanying custom controller accepts input from our support personel, encrypts the input and checks to see if it matches what we have on record and displays an appropriate message.
I've been tasked with adding this functionality to another custom object (a child of Contact). When I access the VF page directly I get no errors, but when I try to use it inline in the page layout I get this error.
I've also noticed that the previously built functionality is also giving this error in our. The odd thing is that this error is only happening in our sandbox (CS19) right now. In production (NA28) the previous functionality is still working fine.
I'm not doing any URL hacking, or page redirecting. I'm simpy rerendering the VF page.
<apex:form id="securityForm" > <div class="{!IF(hasPIN,'slds-show','slds-hide')}"> <div class="{!IF(NOT(PINMatches),'slds-show','slds-hide')} input-wrapper"> <div class="slds-form-element {!IF(AND(NOT(PINInput == ''), NOT(PINMatches)),'slds-has-error','')}"> <label class="slds-form-element__label slds-form-element__label--small" for="{!$Component.pinInput}">Enter PIN supplied by Client</label> <div class="slds-form-element__control"> <apex:inputText id="pinInput" styleClass="slds-input slds-input--small" value="{!PINInput}" onkeypress="return noenter(event);" /> <span id="pinError" class="slds-form-element__help {!IF(AND(NOT(PINInput == ''), NOT(PINMatches)),'slds-visible','slds-hidden')}">Incorrect PIN</span> </div> </div> <apex:commandButton value="Submit" action="{!checkPIN}" rerender="securityForm" styleClass="slds-button slds-button--neutral slds-m-left--small"/> </div> <div class="{!IF(PINMatches,'slds-show','slds-hide')}"> Security Information has been verified </div> </div> </apex:form> public void checkPin() { if(PINInput != null) { Blob inputBlob = Blob.valueOf(PINInput); Blob inputHash = Crypto.generateDigest('SHA1', inputBlob); String result = EncodingUtil.base64encode(inputHash); PINMatches = PINRef.equals(result); } }
- Doug Beltowski X
- December 29, 2016
- Like
- 0
- Continue reading or reply
Error when trying to implement toString method on a custom class
public String toString() { return csvCell; }
csvCell is defined as a private String.
- Doug Beltowski X
- November 19, 2015
- Like
- 0
- Continue reading or reply
Using Visual Flow set a Date field to Null / Blank
- Doug Beltowski X
- January 25, 2016
- Like
- 1
- Continue reading or reply
Case Status validation rule
I am trying to create a validation rule that restricts the ability to change the status of a case to Transfer for all users.
It should restrict the user from changing the status of a case with a specific record type to transfer, unless the user has a specific role which will allow it to use that status.
The syntax passes, but whenever I test the rule on a case I get the validation error with the roles listed.
Any help would be very appreciated.
Thank you in advance!
AND( ISPICKVAL(Status, "Transfer"), RecordType.Name = "Example", OR( NOT($UserRole.Name = "CEO"), NOT($UserRole.Name = "CFO"), NOT($UserRole.Name = "CIO"), NOT($UserRole.Name = "Admin") ) )
- matthew Gordon
- March 03, 2016
- Like
- 0
- Continue reading or reply
No picklist values on my visualforce page
Hello,
I'm not a coder by any stretch, but I've been dabbling a bit to see if I can learn. We currently have a customer Lead convert page in our org where I'd like to add a field for "Qualifying Reason" (a custom picklist that has been created on the Lead). I mimicked some existing code to get the field on the visual force page and I tried to update the controller, by mimicking existing code as well.
What I get is a field for "Qualifying Reason" and picklist box with no values. From researching around, it looks like I need additional coding in my controller to pull the values, but my various attempts to do so have only created errors for me...
Can anyone provide any gudiance here?
Thank you!!!
TK
Visual Force Page:
<apex:pageblocksectionitem >
<apex:outputlabel >Converted Status</apex:outputlabel>
<apex:outputPanel layout="block" styleClass="requiredInput">
<apex:outputPanel layout="block" styleClass="requiredBlock"/>
<apex:selectlist value="{!ConvertedStatus}" required="true" multiselect="false" size="1" onchange="processChange()">
<apex:selectOptions value="{!ConvertedStatuses}"/>
</apex:selectlist>
</apex:outputpanel>
</apex:pageblocksectionitem>
Controller:
public String QualifyingReason {get; set;}
public List<SelectOption> QualifyingReasons {get; set;}
What my page looks like:
- TraciKim
- March 02, 2016
- Like
- 0
- Continue reading or reply
I want to create a trigger which can restrict creating opportunity when related account industry is defined
trigger o1 on Opportunity (Before Insert) {
for(Opportunity o:Trigger.new){
ID aid = o.Account.ID;
Account a = [Select Name,Industry From Account WHERE ID = :aid];
if(a.Industry == 'Education'){
o.addError('No more Opportunity from Education Domain');
}
}
}
Above triggere is not allowing me to create opportunity for any account.
- Amit Khanduri.
- March 02, 2016
- Like
- 0
- Continue reading or reply
Using Visual Flow set a Date field to Null / Blank
- Doug Beltowski X
- January 25, 2016
- Like
- 1
- Continue reading or reply
Remote Object Query not respecting multiple conditions on single field
{ where: { RecordTypeId: {in: ids}, Custom_Boolean__c: {eq: true}, Custom_Date_Time__c: {gte: new Date('2014-1-1')}, Custom_Date_Time__c: {lte: new Date('2016-1-1')} }, limit: 100 }Is this a bug/limitation with Remote Objects, or is my query somehow malformed?
- Doug Beltowski X
- January 08, 2016
- Like
- 0
- Continue reading or reply
How do you access a custom setting from a flow?
My use case is that I am launching a report from the flow, and best practice is to store report IDs in custom settings to facilitate deployments.
Doug
- thinkdata
- February 24, 2015
- Like
- 0
- Continue reading or reply
Integrating FileNet with salesforce
- sfdciane
- February 15, 2013
- Like
- 1
- Continue reading or reply
Getting duplicate errors in Test class
I have written a trigger on the Campaign Member object that gives users access to our subscription service when their campagn status changes to 'Free Trial'. The trigger works without fail but the test is failing because of this error:
System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []
Here is my code:
@isTest public with sharing class Test_Trial_Campaign { static testMethod void test(){ list<Id> IdLst = new list<Id>(); list<CampaignMember> cMemL = new list<CampaignMember>(); Campaign testC = new Campaign(isActive = true, ActualCost = 0, Name = 'SystemTest'); insert testC; system.debug(testC); CampaignMemberStatus status = new CampaignMemberStatus(CampaignId = testC.Id, HasResponded = true, label = 'Free Trial', SortOrder = 2); insert new list<CampaignMemberStatus>{status}; for (Integer i=0; i<10; i++){ Lead testL = new Lead(FirstName = 'Test', LastName = 'Testerino'+i, email = 'test@testing.co'+i, Trial_Product__c = 'SUB-RTE-01'); insert testL; CampaignMember mem = new CampaignMember(CampaignId = testC.Id, LeadId = testL.Id, Status = 'Free Trial'); IdLst.add(testL.Id); insert mem; CampaignMember testerino = [SELECT Id, Status from CampaignMember where id =:mem.Id]; system.debug(testerino); } list<Lead> lList = [SELECT Id, isConverted From Lead Where Id IN: IdLst]; for (Lead l: lList){ system.debug(l); system.assert(l.IsConverted == true); } } }
It fails when attempting to insert the CampaignMemberStatus. I have tried multiple workarounds, all of which have failed. Any insight is greatly apprechiated.
- SpaceManSpiff
- September 18, 2012
- Like
- 0
- Continue reading or reply