• Kent Manning
  • NEWBIE
  • 349 Points
  • Member since 2007
  • Certified Salesforce CRM Administrator

  • Chatter
    Feed
  • 12
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 111
    Replies

I have created a custom object named "Work Order". In this, I have a picklist field, "Reason on Hold", that has "Deductible Hold" as a value. I also have a checkbox field of "Pays with PO" in the same custom object. I would like to create a validation rule preventing the "Reason on Hold" field from having "Deductible Hold" entered, if the checkbox field of "Pays with PO" is checked. Can anyone offer any insight? It would be much appreciated.

I have just set up the Force.com IDE through eclipse, and have a question about getting custom objects.  I have created a sandbox instance that has custom objects that were created through salesforce.com in a browser, but when looking at this instance in the Force.com IDE it does not show any of my custom objects.  Any help/suggestions here would be great!

 

Cameron

I created the code below to display an image - I use this as a visualforce element on a page layout.  

 

<apex:page standardController="Carrier__c" >
<img src="{!$Resource.SafecoMap}" width="772" height="496"/>,
</apex:page>

 

What I need to do is add logic to display the correct image depending on the name of the record so something like:

 

<apex:page standardController="Carrier__c" >

IF Carrier__c.Name="Safeco", <img src="{!$Resource.SafecoMap}" width="772" height="496"/>,

IF Carrier__c.Name=...

</apex:page>

 

This way I can display the appropriate image for each carrier record.  Does anyone know the correct syntax to accomplish this?

Hi, I'm trying to perform the following in a formula value in a workflow rule field update.

 

If value x is not null

 - update field with value x

else

 - update the field with value y

 

I tried this out using an If statement and Case statements but got errors both times.

is it true that an if statement can only return true or fase?  I can't say 

If (x not null), x, y

 

The above is just pseudocode but should outline what i am trying to do.

 

Any suggestions would be welcomed.

 

Thanks!

 

 

I have contract expiration notice turned on for account and contract owners.  However, I would like my Office manager to get notified instead of the contract owner.  Is that possible?  Or would I need to create a specific apex class to do it?

 

Thanks

Hi All,

 

I am having trouble creating an edit page using Visualforce.  We created a visualforce page for a custom object and have assigned this visualforce page for the custom object page layout.  We want to create a visualforce page for the edit function as well but I am having issues creating this.  I think we may need to create a controller extension but I am not sure. Here is the sample code we have for our page layout. All we want is to allow this page layout to be edited using a visualforce page.

 

 

 

<apex:page standardController="Sharing_ES__c">
	<apex:sectionHeader title="{!$ObjectType.Sharing_ES__c.label}" subtitle="{!Sharing_ES__c.name}"/>
	<apex:pageBlock title="{!$ObjectType.Sharing_ES__c.label} Detail">
		<apex:pageBlockButtons >
		<apex:form >
			<apex:commandButton action="{!edit}" value="Edit"/>
			<apex:commandButton action="{!delete}" value="Delete"/>
			<apex:commandButton action="{!URLFOR($Action.Sharing_ES__c.Clone,Sharing_ES__c.id)}" value="Clone"/>
		</apex:form>
		</apex:pageBlockButtons>
		<apex:pageBlockSection showHeader="false" columns="2">
			<apex:outputField value="{!Sharing_ES__c.Name}"/>
			<apex:pageBlockSectionItem >
				<apex:outputLabel value="Custom Sharing Owner"/>
				<apex:outputPanel >
					<apex:outputField value="{!Sharing_ES__c.OwnerId}"/>&nbsp;
					<apex:outputLink value="{!URLFOR($Action.Sharing_ES__c.ChangeOwner,Sharing_ES__c.id)}">[Change]</apex:outputLink>
				</apex:outputPanel>
			</apex:pageBlockSectionItem>
			<apex:outputField value="{!Sharing_ES__c.Sharing_Type__c}"/>
			<apex:outputField value="{!Sharing_ES__c.Account__c}"/>
			<apex:outputField value="{!Sharing_ES__c.Record_Type__c}"/>
			<apex:outputField value="{!Sharing_ES__c.isActive__c}"/>
			<apex:outputField value="{!Sharing_ES__c.Access_Type__c}"/>
			<apex:outputField value="{!Sharing_ES__c.Description__c}"/>
			<apex:outputField value="{!Sharing_ES__c.User__c}"/>
			<apex:pageBlockSectionItem />
			<apex:outputField value="{!Sharing_ES__c.Group__c}"/>
			<apex:pageBlockSectionItem />
		</apex:pageBlockSection>
		<apex:pageBlockSection showHeader="false" columns="2">
			<apex:outputField value="{!Sharing_ES__c.CreatedById}"/>
			<apex:outputField value="{!Sharing_ES__c.LastModifiedById}"/>
		</apex:pageBlockSection>
		<apex:pageBlockSection showHeader="true" title="Custom Links" columns="3">
		</apex:pageBlockSection>
	</apex:pageBlock>
</apex:page>
			

 

 

I have a picklist with some values and a text field. When the "Other" value from the picklist is selected, i would like the text field to be required. Can somebody please help me ?

 

Thanks

I'm trying to build a formula to accomplish the following:

  • Reformat a phone number field to display the full US calling format instead of the local calling format.
  • Example: In the UK numbers have one of three prefixes, 01, 02, or 03. When my leads post from web to lead, they are formatted as if I were located in the UK and calling these leads. I am located in the US where I am required to dial 011 44 and then the number.  


Here is my code:

 

 

if(contains (Phone, "01"), substitute(Phone,"01", "011 44 1"),
if (contains (Phone, "02"), substitute(Phone, "02", "011 44 2"),
if (contains (Phone, "03"), substitute(Phone, "03", "011 44 3"),
""
)))

 


 

 

The formula works well, except for cases where there exists a "01", "02", or "03" somewhere other that the begining of the number, which it will then replace with the designated text. 

 

How do I get my formula to only replace the value of the phone number in cases which it begins with an "01", "02", or "03" without searching the entire field. 

 

Thanks in advance. 


Steve

Message Edited by smerrill on 05-20-2009 03:31 PM
I am running a Database of Club members, and want to be able to track how long someone has been a member. I have a custom field "Initial_Membership_Date" I have a second custom field "Years_of_Membership" "Years_of_Membership" is a calculated Number field with the following formula: YEAR(TODAY() )- YEAR(Initial_Membership_Date__c) Even in cases where the "Initial_Membership_Date" is properly populated with a date, the field remains blank. Anyone have any thoughts?
  • April 11, 2009
  • Like
  • 0

Hello,

 

I need some help creating a custom formula field that will auto populate the industry text area based on the account page industry selection associated with the opportunity.  I have a Opportunity page layout that I need to link the industry fields together on, but I have no idea how to get the formula written to have that data from the industry field on the account page to pull into the opportunity page.  Can anyone help me with this?

 

Thank you

 

I'm having difficulty finding appropriate validation rule examples to build from. 

  1. I'd like to create a validation rule indicating that if the Opportunity Stage equals Revist that the Close Date cannot exceed one year from today.  Is that possible? 
  2. I have Professional Edition so user permissions are a bit different.  I would like to create another rule indicating that if you are not a system administrator you cannot delete Opportunities.  Is that possible?

Any help would be greatly appreciated!

N

  • February 03, 2009
  • Like
  • 0
Hello Everybody,
 
I wonder if someone ever seen this situation. I am relatively new to SF, hope somebody can help.
 
I have different selling services (26) and the fees are changing according to the billing cycle (yearly or monthly) and their types.
 
Therefore, I want to create a rule that is going to relate: the ispickval (Service) and the BC (Y or M)
 
I tried with the functions IF and AND,
 
IF(
AND(ISPICKVAL(A),ISPICKVAL(Y),Fees1),
AND(ISPICKVAL (A),ISPICKVAL(M),Fees2),
AND(ISPICKVAL(B),ISPICKVAL(y), Fees3),
AND...,
null)
 
I have a report that something is missing, but I can not find what and how I should do that.
 
If someone can help!
 
Thanks in advance. <Dolphin

We would like to create a bar code of the case number. This would then go onto a PDF document that is generated via visualforce.  How do i generate the code to produce the barcode with visualforce and an Apex controller?   Any help or suggestions would be appreciated. 

I have a test class for a trigger that essentally creates a 'test' contract.  Once the contract is activated my trigger copies the pertainate infromation to a custom object.   My test code method is this:

@isTest(SeeAllData=true)
public class CopyContractInfo_Test{
    public static testMethod void testCaseInstrument_A(){
    	List<Case_instrument__c> ciResult;
        Case_Instrument__c ci1 = new Case_instrument__c (case__c = myObjectFactory.insertCase().id,Instrument__c = 'xxxx', Name = '.', Asset__c=myAssetFactory.insertAssetB().id  );
        
        myObjectFactory.insertContract2y(); /* calls my helper class called myObjectFactory */
        
        test.startTest();
        	insert ci1;
        test.stopTest();
     
/* system assert tests */ }

 

This is the myObjectFactory helper class. 

public static Contract insertContract2y(){ Contract testContract = new Contract(); testContract.AccountId = myAssetFactory.insertAccount().id; testContract.recordTypeId = '0126000000018Z2AAI'; testContract.Name = 'Case Instrument Contract Test'; testContract.Location__c = 'the factory'; testContract.Product__c = insertProduct().id; testContract.Contract_Purchase_Price__c = 100.00; testContract.Bio_Inst_Serial_Number__c = myAssetFactory.insertAsset().id; testContract.StartDate = System.today()+10; testContract.ContractTerm = 24; testContract.Status = 'Activated'; <---------------------------- error occurs here. testContract.Contract_type__c = '2-year Service Contract'; testContract.Free_ChamberMaintenance_Allowed__c = 0; testContract.Free_Calibration_s_Allowed__c = 1; testContract.Customer_Visit_Allowed__c = 0; insert testContract; return testContract; }

  I tried to change the status to activated on the contract object, but here is what comes back:  System.DmlException: Insert failed. First exception on row 0; first error: INVALID_STATUS, invalid status: []  If I set the status line to "draft"  everything is happy.  

 

So how do I "activate a contract" so that this test code will work properly?

 

Thanks!

We have a quote template (a visual force page that renders as a PDF). This page currently uses the MessageFormat class from Java to format the currency fields on the quote. 

 

Here is the Visualforce example of how the Unit price on a product line item is formatted:

 

     <apex:column headerValue="Unit Price">

             <apex:outputText value="{0, number, $###,###,##0.00}">

                    <apex:param value="{!item.ListPrice}"/>

             </apex:outputText>

     </apex:column>

 

Note that <apex:outputText value="{0, number, $###,###,##0.00}"> gives back a USA currency format of $1,000.00. However, I need to have this be €###.###.##0,00 where the value comes out as €1.000,00. Note the position of the comma and period in the string.  It has been determined that the Java MessageFormat class will not work with other locations outside of the US. So I need another solution.

 

I have found some code in the Force.com Cookbook that will work to convert the decimal string into a Euro format:

 

     Decimal Amount = 199850010.28;
     Decimal dollars;
     Decimal cents;
     dollars = Amount.intValue();
     system.debug('Dollars is set to:' + dollars);
     cents = Amount - dollars;

     cents = cents.setScale(2);
     system.debug('cents is set to:' + cents);
     String AmtText = dollars.format()+','+ cents.toPlainString().substring(2) + ‘€’ ;
     System.debug(AmtText);

 

     199.850.010,28 €

 

 

I need help converting this code into a method inside of my Visualforce page controller. Also, I don’t know how link the output of this method to the appropriate line item values on the quote page.  It has been suggested by Salesforce Support that a wrapper class would do the dirty work. However, I have no experience with how to make a wrapper class work, nor how to use the above code within the wrapper class to format all of the currency fields (List Price, Discount Price, Discount Amount, Subtotal Amount, etc.) on our quote. 

 

Does anyone have a custom code example, or techniques for formatting currency in a Visualforce page so that Euros display properly?  I’m sure someone, somewhere has run into this requirement before since Salesforce is an international company.  Please share how you resolved this issue when using a Visualforce page template.

We have a quote template (a visual force page that renders as a PDF). This page currently uses the MessageFormat class from Java to format the currency fields on the quote. 

 

Here is the Visualforce example of how the Unit price on a product line item is formatted:

 

     <apex:column headerValue="Unit Price">

             <apex:outputText value="{0, number, $###,###,##0.00}">

                    <apex:param value="{!item.ListPrice}"/>

             </apex:outputText>

     </apex:column>

 

Note that <apex:outputText value="{0, number, $###,###,##0.00}"> gives back a USA currency format of $1,000.00. However, I need to have this be €###.###.##0,00 where the value comes out as €1.000,00. Note the position of the comma and period in the string.  It has been determined that the Java MessageFormat class will not work with other locations outside of the US. So I need another solution.

 

I have found some code in the Force.com Cookbook that will work to convert the decimal string into a Euro format:

 

     Decimal Amount = 199850010.28;
     Decimal dollars;
     Decimal cents;
     dollars = Amount.intValue();
     system.debug('Dollars is set to:' + dollars);
     cents = Amount - dollars;

     cents = cents.setScale(2);
     system.debug('cents is set to:' + cents);
     String AmtText = dollars.format()+','+ cents.toPlainString().substring(2) + ‘€’ ;
     System.debug(AmtText);

 

     199.850.010,28 €

 

 

I need help converting this code into a method inside of my Visualforce page controller. Also, I don’t know how link the output of this method to the appropriate line item values on the quote page.  It has been suggested by Salesforce Support that a wrapper class would do the dirty work. However, I have no experience with how to make a wrapper class work, nor how to use the above code within the wrapper class to format all of the currency fields (List Price, Discount Price, Discount Amount, Subtotal Amount, etc.) on our quote. 

 

Does anyone have a custom code example, or techniques for formatting currency in a Visualforce page so that Euros display properly?  I’m sure someone, somewhere has run into this requirement before since Salesforce is an international company.  Please share how you resolved this issue when using a Visualforce page template.

I have a quote visualforce page that is rendering as a PDF.  Our offices in Germany and the UK would like to start using the quoting functions, but one of the requirements is that the currency fields display properly.  Here is an example of the code from the Visualforce page:

 

 <apex:column headerValue="Price Extension">
                <apex:outputText value="{0, number, £###.###.##0,00}">
                    <apex:param value="{!item.TotalPrice}"/>
                 </apex:outputText>
            </apex:column>

 The only problem is my Quote "Total Price"  does not format properly.  The output is £42,900.00 when it should be £42.900,00 - Note the position of the comma and period.  Is there any way to get this to work for Europe?  If the Java Message Format will not work, how would i go about getting the price fields to be formatted properly?

 

Any suggestions or help would be appreciated.

I have a quote visualforce page that is rendering as a PDF.  Our offices in Germany and the UK would like to start using the quoting functions, but one of the requirements is that the currency fields display properly.  Here is an example of the code from the Visualforce page:

 

 <apex:column headerValue="Price Extension">
                <apex:outputText value="{0, number, £### ### ##0.00}">
                    <apex:param value="{!item.TotalPrice}"/>
                 </apex:outputText>
            </apex:column>

 The only problem is my Quote "Total Price"  does not format properly.  The output is £42,900.00 when it should be £42.900,00 - Note the position of the comma and period.  Is there any way to get this to work for Europe?  If the Java Message Format will not work, how would i go about getting the price fields to be formatted properly?

 

Any suggestions or help would be appreciated.

 

 

Does anyone have the code or know how to style the related lists on a visual force page so that it looks like the standard related list on a standard page view? 

 

I have built a visualforce detail page for our asset object.  I've added a number of related lists using the <apex:relatedList  list="service_Parts__r"/> and <apex:relatedList list="NotesAndAttachments"/> components.  The problem is that each of these related lists only displays the key field from the related object - nothing else.  How do I get these related lists to show additional fields from the related objects and have it look like (row colors, header style and actions) a standard related list?

 

Any help you could offer would be greatly appreciated.

 

Kent

I need some direction.  I currently have two lists - one called upgrades and the other called serial number / upgrades.  What I want my code to do is compare the values in the upgrades list with the values in the serial number / upgrades list.  If a value on the upgrades list is found on the serial number / upgrades list then don't do anything.   However, if a value on the upgrades list is NOT found on the serial number / upgrades list, then add that value to the serial number / upgrades list.  Both lists are variable in size, meaning that they could have 1 value or as many as 40 values.  How can I achieve this, with apex code preferably inside of a trigger? 

 

UPGRADES                                                          SN/UPGRADES

UG-001   <-----compare This     To all of these ---->   UG-004

                                                                                   UG-001 This value found, don't add it again.

UG-002 <-- This value            is not found here -->     ----       So add it to SN/UPGRADE list. 

UG-003 <-- This value            is not found here -->     ----        So add it to SN/UPGRADE list.

 

 

Any help would be appreciated.

 

 

On our contact page we have an instrument / application section.  This is a tabbed visualforce page with 6 tabs. Each tab represents an instrument family. Within each tab, is a series of check boxes relating to the applications which can be done on that particular instrument.   So for example: our protein instrument would have applications like "western assays", "ELISA", "RNAi", etc. Another instrument - small animal imager would have applications like "western assays", "transcription factor assays" etc.  Note That the "western assay" appears on two different tabs, however the field "western assays" is a common field to both tabs.

 

Here is my problem.  Prior to Spring '12, it didn't matter if the western application check box was checked on protein reader tab or on the small animal imager tab, it would retain the fact that the box was checked.  Now after Spring '12, Salesforce changed the way vf evaluates which duplicate merge field becomes the winner. Now the behavior is whatever the state of the check box on tab 2 is the state retained on the save.  So if I check the westerns box on tab 1(protein reader) and I leave the westerns box unchecked on  tab 2( small animal imager) and save, the westerns box is not checked because tab 2 overwrites (wins) over tab 1.  

 

I need to write a code extension (and I have no idea where to begin) for this visualforce page that will control which value will be the winner upon saving the page. Does anyone have a suggestion (example code) on how I can control the duplicate check box fields so that if it gets check on tab 1, it stays checked and is not overwritten by the state of the check box on tab 2?  I envision this working similar to a radio button type of arrangement where when one button is selected all others are not selected.  I just don't know how to write the logic to do this.

 

Any suggestions or help would be appreciated.

 

Thanks

 

Kent

On our contact page we have an instrument / application section.  This is a tabbed visualforce page with 6 tabs. Each tab represents an instrument family. Within each tab, is a series of check boxes relating to the applications which can be done on that particular instrument.   So for example: our protein instrument would have applications like "western assays", "ELISA", "RNAi", etc. Another instrument - small animal imager would have applications like "western assays", "transcription factor assays" etc.  Note That the "western assay" appears on two different tabs, however the field "western assays" is a common field to both tabs.

 

Here is my problem.  Prior to Spring '12, it didn't matter if the western application check box was checked on protein reader tab or on the small animal imager tab, it would retain the fact that the box was checked.  Now after Spring '12, Salesforce changed the way vf evaluates which duplicate merge field becomes the winner. Now the behavior is whatever the state of the check box on tab 2 is the state retained on the save.  So if I check the westerns box on tab 1(protein reader) and I leave the westerns box unchecked on  tab 2( small animal imager) and save, the westerns box is not checked because tab 2 overwrites (wins) over tab 1.  

 

I need to write a code extension (and I have no idea where to begin) for this visualforce page that will control which value will be the winner upon saving the page. Does anyone have a suggestion (example code) on how I can control the duplicate check box fields so that if it gets check on tab 1, it stays checked and is not overwritten by the state of the check box on tab 2?  I envision this working similar to a radio button type of arrangement where when one button is selected all others are not selected.  I just don't know how to write the logic to do this.

 

Any suggestions or help would be appreciated.

 

Thanks

 

Kent

We are interested in using Facebook as the authentication provider for SSO to Salesforce.  However, the setup instructions from Salesforce indicate that you need to create an application in Facebook.  I do not know what this application is or what it should do. Also, once you've created the application, how does this application then get distributed to all users so that they can login to Salesforce via Facebook?

 

If anyone has more information about this or suggestions on how to accomplish SSO with Facebook,  I would appreciate it if you would share your knowledge.

 

Thanks in advance

 

Kent

 

I have tried a number of time to use the Insert/Edit Image button to insert a picture into my question posts.  I have been unsuccessful in actually getting this to work.  The main problem is knowing what to put in the "Image URL" field.  What do I put in this line? 

 

Service Tracking Image

 

Could someone offer some instructions?

 

Kent

At Dreamforce 2011 I attended a session that showed how to back up the metadata using the the Force.com IDE.  I was experimenting with how to restore a backed up file and so I used import.  When I went to the import menu, I select the folder and items that I wanted to restore.  However, this recreated the entire folder structure plus the objects instead of replacing the file I wanted restored.  How do I delete this now?  See diagram below: The part in red I want to remove from the project.  The Force.com IDE will not allow you to delete folders.  So what am I to do?

 

>DF_11_IDE

    >src

        >analyticSnapshots

        >applications

        >classes

        >components

        >dashboards

        DF_11_IDE

             src

                  objects

       >documents

       >email

I have a workflow rule criteria that must check zip code ranges for states such as NY and CA.  Here is the code segment.

State_of_Primary_Contact__c = "ID"|| 
(State_of_Primary_Contact__c = "NY" && Value(Postal_Code_of_Primary_Contact_hidden__c) >= 12000 && Value(Postal_Code_of_Primary_Contact_hidden__c) <= 14901) || 
(State_of_Primary_Contact__c = "CA" && Value(Postal_Code_of_Primary_Contact_hidden__c) >= 94000 && Value(Postal_Code_of_Primary_Contact_hidden__c) <= 95999) 
) 

 By using the Value() function, I'm able to convert the text postal code in to a number and then use the "<=" or ">=" operators to test for valid zip code ranges. This works fine until you get a Zip+4 zip code such as 92038-0685.  How can I test a range of zip codes when there is the +4 extension on the number?  

 

I hope someone has run into this situation before.

 

Thanks in advance!

 

 

I'm creating a service report from a visual force page and rendering it as a PDF.  My problem is the report is for our Germany office and their standard paper size is A4,  not 8.5" x 11".  How do I control the page size when rendering my visualforce page as a PDF?

 

Where does the generated PDF get its parameters to know wheather to format to 8.5" x 11" or some other page size?  Does this information come from the browser, the printer, or is it hard coded by Salesforce in the rendering engine? 

 

Any help ASAP would be appreciated.

I am using the <apex:messages/> tag to display messages on a visualforce page that is overriding the New button on a custom object. When the messages present their font color is black, and the message is way to the left of the page.  How do I get the messages to display in red and be centered on the page rather than left justified?

 

 

 Here is my visualforce code.

<apex:page standardController="Salesforce_Issue__c"  >

<style type="text/css">
.exceptionText{font-style:italic;
font-size:16px;
font-weight:bold;
text-align:center;
color:red;}
</style>


<apex:form>
<apex:pageBlock mode="edit">
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>

<apex:messages layout="table" styleClass="exceptionText"/>

 It seems that the css is not working fully. Font-weight,  font-size, font-style all work but text-align and color don't seem to be recognized.

 

 

Any help would be appreciated.

 

 

I've overwritten the edit page on our contact object with a visualforce page.  I have two 32000 text long fields on this page one called Description (which is a standard field) and another called Additional Notes.  Both of these in the edit screen are very narrow and small.  Does anyone know how to expand these boxes so that they are normal size?  If I use the native edit function they display properly.

 

Here is an excerpt of my code with the offending fields in red. Note that I have tried to sent the columns on the pageblocksection to 1 but that doesn't make any difference.  (A screen shot is below the code).

 

 

<apex:page standardController="Contact"   >
   

    <apex:form >
        <apex:pageBlock title="Contact Edit" mode="edit" >
            <apex:pageBlockButtons >
               <apex:commandButton action="{!Save}" value="Save"/>
               <apex:commandButton action="{!Cancel}" value="Cancel"/>               
            </apex:pageBlockButtons>

           
            
            <apex:pageBlockSection id="OwnerUserData" title="Owners and Users Details" columns="2" >
               <apex:inputField value="{!contact.Prospective_owner_user__c}"/>
               <apex:inputField value="{!Contact.Owner__c}"/>
               <apex:inputField value="{!Contact.Gen_Owner__c}"/>
               <apex:inputField value="{!contact.User__c}" />
               <apex:inputField value="{!contact.Gen_User__c}" /> 

 </apex:pageBlockSection> <apex:pageBlockSection id="OwnerUserData2" rendered="true" columns="1"> <apex:inputfield value="{!contact.Product_s_Used__c}" /> <apex:inputfield value="{!contact.Additional_Notes__c}" /> </apex:pageBlockSection> <apex:pageBlockSection title="Description Information" columns="1"> <apex:inputfield value="{!Contact.Description}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

I am designing a service report in visualforce.  I'm rendering this as a PDF document.  I have eight check boxes that need to be displayed on this form. When I try to dynamically bind the object with <apex:outputText value="{!ServiceWorkRequest.warranty__c}"/>  I get a true or false output - not the a checked or unchecked  check box.  How does one insert a check box into a PDF document?  I only need to display the static check box as checked or unchecked based on the underlying database value.   It does not have to be interactive.

 

Any ideas on how to proceed?

 

Thanks for your input.

I have a field on the case object that looks up, via the asset, the extended service contract end date.  My problem is that it is only returning one entry from the contract related list and hence returning the wrong end date.  Does anyone know how to make the lookup query the related list for the most recent acitive contract?

 

My lookup formula is this:

Asset_num__r.Contract__r.EndDate

 


 

I'm reposting this again since I've gotten no replys.  Do anyone have any ideas on how to do this?

 

We have a custom object in which we record information about demo's or installations of instruments.  Because these reports tend to be long, and the users often need to reference other information, there are times when they will inadvertantly navigate away from the page, thus losing all the data. 

 

Is there a way to create a button, or link or keyboard short cut on the edit page to save the data on the page but still remain in the edit window?

Message Edited by bioscience man on 10-26-2009 10:51 AM

Hi all!  

 

I am creating a formula that counts events for a company.  The hitch is - if the "meeting type" field (which is a custom picklist) on the activity record is "conference call" or "web meeting" -  I do not want it to count it.  

 

I put together the formula below - but it does not seem to be working.  Any help would be very appreciated.  

 

 IF( AND(Activity_Type__c = "Event", OR( NOT( ISPICKVAL(Meeting_Type__c, "Conference Call")), NOT(ISPICKVAL(Meeting_Type__c, "Web Conference")))) 
, 1, 0)

 

 

Actiivty_Type__C is a text formula field that will either be "Event" or "Task".  

 

 

Best regards, 

 

John 

 

 

I have created a custom object named "Work Order". In this, I have a picklist field, "Reason on Hold", that has "Deductible Hold" as a value. I also have a checkbox field of "Pays with PO" in the same custom object. I would like to create a validation rule preventing the "Reason on Hold" field from having "Deductible Hold" entered, if the checkbox field of "Pays with PO" is checked. Can anyone offer any insight? It would be much appreciated.

Hey,

I have a formula field, either text or number, that I want to use an IF CONTAINS formula on a multi select picklist. Ideally there would be several of these so I can get different outcomes similar to a case statement, but just the basic formula is giving me an error when I Check Syntax:

 

'Error: Syntax error missing ')'

 

Hear is my initial formula:

 

IF(INCLUDES(Project_TYPE__c, "Equipment"), 1, 2)

 

I've also tried IF(INCLUDES(Project_TYPE__c, "Equipment"), "1", "2")

 

With the same error.

 

I verified the field is available in the Insert Field pop-up. I've seen other threads where they discuss doing this and nesting the formula to work through the values, but I'd like just to get this one line to work.

 

Thanks for any help!

I have a validation rule setup so the user cannot close a case if a certain field is not filled in:

AND(ISPICKVAL(How_was_the_delivery_receipt_signed__c , "BOL Signed Clear"),  NOT(ISPICKVAL(Status,"Closed")))

It works fine when the case is created and an email is sent from the case. However, I receive a validation error when an email response is returned:

The following errors were encountered while processing an incoming email:

FIELD_CUSTOM_VALIDATION_EXCEPTION : Close your case when BOL is signed clear

How do I stop the validation from running after the case is closed?

Thanks for your help!

Shannon

Hi,

 

I have created a formula field on Contact , which gets calculated as given :

 

IF( (RecordType.DeveloperName== 'Continuum_Member' && (AA_CM_A_Type__c == '1CM' || AA_CM_A_Type__c == '2CM')), 
HYPERLINK("/"&LEFT(Corps_Region__c,18), Corps_Region__r.Name,'_self'), 
HYPERLINK("/"&LEFT(Hire_Credit_Region_New__c,18), Hire_Credit_Region_New__r.Name,'_self') 
)

It always shows correct value when checked on detail page on record But whenever report is run , it always evaluates to false  and gives incorrect result.

Please help me to understand this behaviour whenever reports run.

 

Hi i'm trying to re-write this formula and having some syntax issue :(

 

Old rule condition was : if 1st established contact already contains a date, canot change it

 

New rule condition is as follow: If established 1st contact is WITHIN last 3 months, that date cannot be changed with exception for admin

 

 

Here is old formula without new condition

 

 

AND(
NOT($Profile.Name = "System Administrator"),
ISCHANGED(Established_1st_Contact__c),
NOT(
ISBLANK(
PRIORVALUE(Established_1st_Contact__c))))

 

 

If nayone can help, i would appreciate

 

 

Thx in advance

  • November 04, 2013
  • Like
  • 0

We would like to create a bar code of the case number. This would then go onto a PDF document that is generated via visualforce.  How do i generate the code to produce the barcode with visualforce and an Apex controller?   Any help or suggestions would be appreciated. 

We have a few new Windows 8 machines at our company and we are running into issues installing Salesforce for Outlook (2007).  The software installs, and items can sync, but the add-ins do not launch.    

 

They do not appear under Help > Disabled Items....  

 

They are listed as disabled under Tools > Trust Center > Add-ins > Manage COM Add-ins, but get the following message:  "This add-in is installed for all users on this computer, and can only be connected or disconnect by an administrator".  If I log in as an admin, I can activate these add-ins, but they keep reverting back to disabled and the message when try to activate this is not:  "Not Loaded.  The Managed Add-in Loader failed to initialize."

 

Not sure if this is related, but after installing and starting the application, if I right click and hit settings, I received two script errors:

https://ssl.salesforce.com/jslibrary/1360895802000/sfdc/Security.js

and then

https://ssl.salesforce.com/secur/frontdoor.jsp?sid=ORGIDGOESHERE%21ARMAQIT9SNoFN9q8wcqtr1sKaBYXQz.JTEDaCZrbznF9sb

We have a quote template (a visual force page that renders as a PDF). This page currently uses the MessageFormat class from Java to format the currency fields on the quote. 

 

Here is the Visualforce example of how the Unit price on a product line item is formatted:

 

     <apex:column headerValue="Unit Price">

             <apex:outputText value="{0, number, $###,###,##0.00}">

                    <apex:param value="{!item.ListPrice}"/>

             </apex:outputText>

     </apex:column>

 

Note that <apex:outputText value="{0, number, $###,###,##0.00}"> gives back a USA currency format of $1,000.00. However, I need to have this be €###.###.##0,00 where the value comes out as €1.000,00. Note the position of the comma and period in the string.  It has been determined that the Java MessageFormat class will not work with other locations outside of the US. So I need another solution.

 

I have found some code in the Force.com Cookbook that will work to convert the decimal string into a Euro format:

 

     Decimal Amount = 199850010.28;
     Decimal dollars;
     Decimal cents;
     dollars = Amount.intValue();
     system.debug('Dollars is set to:' + dollars);
     cents = Amount - dollars;

     cents = cents.setScale(2);
     system.debug('cents is set to:' + cents);
     String AmtText = dollars.format()+','+ cents.toPlainString().substring(2) + ‘€’ ;
     System.debug(AmtText);

 

     199.850.010,28 €

 

 

I need help converting this code into a method inside of my Visualforce page controller. Also, I don’t know how link the output of this method to the appropriate line item values on the quote page.  It has been suggested by Salesforce Support that a wrapper class would do the dirty work. However, I have no experience with how to make a wrapper class work, nor how to use the above code within the wrapper class to format all of the currency fields (List Price, Discount Price, Discount Amount, Subtotal Amount, etc.) on our quote. 

 

Does anyone have a custom code example, or techniques for formatting currency in a Visualforce page so that Euros display properly?  I’m sure someone, somewhere has run into this requirement before since Salesforce is an international company.  Please share how you resolved this issue when using a Visualforce page template.

I have a quote visualforce page that is rendering as a PDF.  Our offices in Germany and the UK would like to start using the quoting functions, but one of the requirements is that the currency fields display properly.  Here is an example of the code from the Visualforce page:

 

 <apex:column headerValue="Price Extension">
                <apex:outputText value="{0, number, £###.###.##0,00}">
                    <apex:param value="{!item.TotalPrice}"/>
                 </apex:outputText>
            </apex:column>

 The only problem is my Quote "Total Price"  does not format properly.  The output is £42,900.00 when it should be £42.900,00 - Note the position of the comma and period.  Is there any way to get this to work for Europe?  If the Java Message Format will not work, how would i go about getting the price fields to be formatted properly?

 

Any suggestions or help would be appreciated.

I need when the billing Shipping number is null not to show up on the page.




<apex:page standardController="OrderHeader__c" showHeader="true"> <apex:form id="pgform" > <apex:pageBlock title="Edit Order {!OrderHeader__c.Name}" id="thePageBlock" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Order Information" showHeader="false" columns="2"> <apex:inputField value="{!OrderHeader__c.AccountingCustomerId__c}"/> <apex:inputField value="{!OrderHeader__c.SalespersonId__c}"/> <apex:inputField value="{!OrderHeader__c.Type__c}"/> <apex:inputField value="{!OrderHeader__c.Sales_Engineer__c}"/> <apex:inputField value="{!OrderHeader__c.CreditTerms__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Shipping and Fulfillment Information" showHeader="true" id="ShippingSection"> <apex:inputField value="{!OrderHeader__c.ShippingMethodId__c}"/> <apex:inputField value="{!OrderHeader__c.ChargeShipping__c}"/> <apex:inputField value="{!OrderHeader__c.ShipNumber__c}" id="Shipping"/> <apex:inputField value="{!OrderHeader__c.ShipProducts__c}"/> [<a href="#" onclick="document.getElementById('j_id0:pgform:thePageBlock:ShippingSection:Shipping').value='337089496';">PVSW FedEx</a>] | [<a href="#" onclick="document.getElementById('j_id0:pgform:thePageBlock:ShippingSection:Shipping').value='852845013';">PVSW DHL</a>] | {!IF(OrderHeader__c.AccountingCustomerId__r.DefaultShippingNumber__c= "",(<a href="#" onclick="document.getElementById('j_id0:pgform:thePageBlock:ShippingSection:Shipping').value='{!OrderHeader__c.AccountingCustomerId__r.DefaultShippingNumber__c}';">Customer Shipping Number</a>),""))} </apex:pageBlockSection> <apex:pageBlockSection title="Tax Settings" showHeader="true" columns="1"> <apex:inputField value="{!OrderHeader__c.ChargeTax__c}"/> <apex:inputField value="{!OrderHeader__c.TaxNumber__c}"/> <apex:inputField value="{!OrderHeader__c.VAT__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

There is an "idea" to disable jobs, but is there a way to mass delete them all using Apex?   Would like to delete the following:

 

Dashboard Refresh

Data Export

Scheduled Apex

Report Run

 

 

 

https://sites.secure.force.com/success/ideaView?id=08730000000HBnU

I created the code below to display an image - I use this as a visualforce element on a page layout.  

 

<apex:page standardController="Carrier__c" >
<img src="{!$Resource.SafecoMap}" width="772" height="496"/>,
</apex:page>

 

What I need to do is add logic to display the correct image depending on the name of the record so something like:

 

<apex:page standardController="Carrier__c" >

IF Carrier__c.Name="Safeco", <img src="{!$Resource.SafecoMap}" width="772" height="496"/>,

IF Carrier__c.Name=...

</apex:page>

 

This way I can display the appropriate image for each carrier record.  Does anyone know the correct syntax to accomplish this?