• jsallen79
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

We have a Visualforce page that contains a multi-select picklist field called Topics__c.  When a value of "Other" is selected I need to dynamically require another field called Other_Topic__c to be populated before the record can be saved.  There are several other fields on this page that are required and the page controller is checking that those fields are populated before the record can be saved.  My challenge is that I can't seem to correctly evaulate the values in the multi-select picklist prior to the record being saved to determine if Other_Topics__c needs to be required as well.  Below is the snippet of code from the page controller where I'm trying to evaluate the multi-select picklist values.

 

if (cl.Topics__c.contains('Other') && cl.Other_Topic__c ==''){
			bOk=false;
			ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Other Topic is a required field.');
			ApexPages.addMessage(myMsg);
		}

 I've found examples of how to query multi-select fields via SOQL, but since the record hasn't been written to the database yet I'm kind of at a loss.  With the code written as above I can choose "Other", with no value in Other_Topic__c and still save the record, which is bad.

 

Any help would be appreciated as I'm a relatively inexperienced coder, especially when it comes to APEX and Visualforce!

 

I've created a Flow that is embedded in a Visualforce page.  The page is opened in a new Salesforce window, which is launched by a custom button.  The flow creates a new record successfully, but upon creation of the record I would like the popup to close and ideally refresh the underlying Salesforce window that it was launched from.  Below is the code behind by page.

 

<apex:page standardController="Services__c" showHeader="false" sidebar="false">
	<flow:interview name="LogHours" buttonLocation="bottom" >
		<apex:param name="vaServiceId" value="{!Services__c.Id}"/>
		<apex:param name="vaUser" value="{!$User.Id}"/>
		<apex:param name="vaServiceName" value="{!Services__c.Name}"/>
	</flow:interview>
</apex:page>

 Any input on how to close this popup once the record is created would be much appreciated.

 

We have a Visualforce page that contains a multi-select picklist field called Topics__c.  When a value of "Other" is selected I need to dynamically require another field called Other_Topic__c to be populated before the record can be saved.  There are several other fields on this page that are required and the page controller is checking that those fields are populated before the record can be saved.  My challenge is that I can't seem to correctly evaulate the values in the multi-select picklist prior to the record being saved to determine if Other_Topics__c needs to be required as well.  Below is the snippet of code from the page controller where I'm trying to evaluate the multi-select picklist values.

 

if (cl.Topics__c.contains('Other') && cl.Other_Topic__c ==''){
			bOk=false;
			ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Other Topic is a required field.');
			ApexPages.addMessage(myMsg);
		}

 I've found examples of how to query multi-select fields via SOQL, but since the record hasn't been written to the database yet I'm kind of at a loss.  With the code written as above I can choose "Other", with no value in Other_Topic__c and still save the record, which is bad.

 

Any help would be appreciated as I'm a relatively inexperienced coder, especially when it comes to APEX and Visualforce!

 

HI,

 

I would like to find out how I could make a flow end at a custom location, more specifically make it end at the place where it was started/clicked, which is a VF page within a button on a record detail page.

 

Here is the VF page that I've created, I only need it to end at the Contact Id page where it was clicked (the flow already has a variable with the Contact Id called ContactID.

 

All help is much appreciatted!

 

<apex:page standardController="Account" tabStyle="Account">

    <flow:interview name="Flow_Testing" finishLocation="{!URLFOR('/003/o')}">
        <apex:param name="AccountID" value="{!account.Id}"/>
        <apex:param name="UserID" value="{!$User.Id}"/>
    </flow:interview>
    
</apex:page>