• Alex K.
  • NEWBIE
  • 80 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 31
    Replies
This tag works: {!relatedTo.Owner.Name}
This tag does NOT work: {!relatedTo.Owner.Title}

I've also tried using {!User.Title} and {$User.Title}

Any suggestions on how to get to the rest of the Owner fields?
Thanks!
Barry

I'm kind of a newbie, so please excuse if this is simplistic - but I can't find anything on it. Here goes:

 

WIthin Visualforce, is it possible to look at a cell in ANOTHER row and format the current cell based on it what it finds?

 

In Excel's conditional formatting it would be something like =IF(A2 <> A1, black, grey)

 

All I want is to change the style of  a cell if the one above it is the same, giving me:

 

Type SKU
Switch17982
Switch17983
Switch17985
Button17988
Button17989
Knob19827
Knob19829

 

 

While something like this could be achieved within the controller, I'm trying to make it work on a Visualforce page so that if dynamic filters within the page are applied, the page formatting adjusts without having to do another query.

 

I did find another post which does something similar within the same row, (Re: conditional styling in table), but there's no mention of how this type of referential access might be achieved within a table.

 

Has anyone done something similar? If so, how did you manage? Any help is most appreciated.

 

 

I could  really use some perspective and advice. I have an application where fields on a custom object need to be populated by combining choices from various select lists on parent and grandparent objects.

 

My issue comes up when the parent/grandparent select lists are changed - what's the best way to handle it?

 

  1. Should I use (somewhat complex) formula fields on the children that point up to the parents and combine the choices based on rules? ; or,
  2. Should I build a trigger with these rules which updates a static text field on all of the children whenever a parent is changed?

The benefits of a formula are that I don't have to touch what could be thousands of children everytime a select list is changed, however I am starting to have to dance around formula compiled character limits.

 

The benefits of using a trigger is that it's more flexible, the code is in one place and the formula compiled character limits don't apply.

 

I guess I don't know if I'm going to take a performance hit of some kind by using the trigger option and updating thousands of records - potentially many times if I have a user who keeps changing his mind on some naming scheme thereby continuing to update all of the children. A formula is just a live reflection of the parent so no update is neccesary. If I properly bulkify the trigger is that all I need to worry about?

 

Am I missing anything else? Is there best practice when it comes to this?

 

Thanks much for any persepctive.

 

Alex

 

 

Can you build a custom object with some Apex code?

 

Sure you can! And I will pay you to do it! ;)

 

Here's what I need - see if you're up for it:

 

There is an existing application in Salesforce called "Quotes" - It: 

 

  • - Allows a user to add products to an opportunity
  • - Creates "opportunity product" records
  • - Creates one or more linked "Quote" record(s) which can be synced to the opportunity (or not)
  • - Outputs a nifty PDF file of the quote
It's pretty cool, but only works with product records. I need you to write some code that does almost exactly the same thing - but with custom objects instead of product records.

 

You could either attempt to modify the existing Quotes code (as I don't use Quotes) or write some from scratch to emulate the functionality.

 

Does this makes sense and can you do it?

 

If so, please contact me through this system and let's work something out and I can supply more detail.

 

Thanks!

 

Alex

Hi all,

 

I am trying to make a field which displays this:

 

48 x 180 (8,640)

 

But I'm getting this (no separators):

 

48 x 180 (8640)

 

Here's the code I'm using:

 

TEXT(Lot__r.Unit_Count__c) & " x " & TEXT(Lot__r.kg_unit__c) &" (" & TEXT((Lot__r.Unit_Count__c * Lot__r.kg_unit__c)) & ")"

 

Is there a simple way to insert comma separators in TEXT numbers - or perhaps a better way to do this? I am stumped and think the only way must be to write some combination of RIGHT and TRIM statements - or something else? This must have come up before, right?

 

It's easy in APEX:

 

<apex:outputText value="{0, number, ###,###,###,###}"><apex:param value="{!Quote.Total_Price__c}"/></apex:outputText>

 

...but does not work in formula fields.

 

What am I missing? Thanks much for any help.

 

Alex

 

 

 

Hi All -

 

I am new, so please forgive my green - but I am having a perplexing problem in generating a Visual Force email template showing related lists for a custom object.

 

I CAN get a list of Cases related to an Account with no problem, but when I put in a custom object  (Child Relationship Name "Suppliers") which is also (Master-Detail) related to Account I get the following error: Error: Invalid field Suppliers for SObject Account

 

I have tried everything I can think of - using API name instead, appending "__c" to the end, but it seems that i can't make any lists at all with custom objects in this code.

 

Is there a restriction within this type of code that allows only lists with standard objects or is there something I'm missing?

 

Any help would be greatly appreciated. I am not good enough to make a custom Apex controller yet and a little under the gun to kluge something together.

 

Thanks much,

 

Lex

 

Below is relevant code:

 

 

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Account"
    subject="Supplier report for Account: {!relatedTo.name}"
    replyTo="support@acme.com" >
<messaging:htmlEmailBody >   
<html>
    <body>
     <STYLE type="text/css">
           TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
           TD  {font-size: 11px; font-face: verdana }
           TABLE {border: solid #CCCCCC; border-width: 1}
           TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
         <font face="arial" size="2">
      <p>Dear {!recipient.name},</p>
      <p>Below is a list of supplier records related to the account: {!relatedTo.name}.</p>
<table border="0" >
        <tr >
            <th>Action</th><th>Product</th><th>Status</th><th>Creator Email</th><th>BL date</th>
         </tr>
<apex:repeat var="cx" value="{!relatedTo.Suppliers}">
   <tr>
       <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> |  
       <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td>
(...snip...)

 

 

I am trying to create a Chatter post from a visual workflow.  When an Oppty is won, I want to create a Chatter post congratulating the Oppty owner and have it come from their Manager.  So far I can I can do all that using the Create Record Action
User-added image

The issue I am running into, I want to @mention the Manager (so they know they "sent" a chatter post) so I created a text body formula:
User-added image 
but the Chatter post is listing the id, and not doing a true @mention
User-added image

Any ideas on how to do a proper @mention via a formula?

Thanks, 

Todd B. 
 
Any idea how to move old notes to the new enhanced notes and maintain the original owner/creator and date/time?
I'd like to get our business users to more completely fillin in the Description text and Inline Help for many custom fields.  Visiting each via the web interface to definitions would be tedius.  What I'd like is a way to import/export/report metadata for custom field definitions are flat fields.  (Editing XML is a bit too techie.)  Unfortunately, unlike most RDMSs, SF doesn't represent Metadata as data so you can't use SOQL on metadata or update it with Apex.  I know there is a Metadata API but I don't have time to write an application using it to build an editor.

Does anyone know of any existing utility that will allow exporting, reporting, and importing of some attributes of custom fields? 

I'd want to export/report the type, name, api name, description, and inline help.  I'd like import description and maybe inline help.

Any ideas?

Hi Guys,

 

I understand it's native functionality within the quoting/quote sync functionality for when you have existing quote line items synced, if you create a new quote agains that opportunity, it copies the line items from the previous quote.

 

There's got to be a way around this, even if it involves code, right? Does anyone have experience with this type of business requirement or know how it could be accomplished? Thanks for the help!!!

Hi,

 

My knowledge on coding is very basic so I am not sure it is possble to do what I'd like or if I have to find an alternate solution.   Basically I am rendering a pdf which lists of of the delegates who have attended a training course and stating if they have passed or failed. 

 

I am doing this in a pdf attachment to an email.  I had it working fine until I found a course with 30+ delegates as the table just continues to render over the page footer and beyond.  Is there anyway to easily split this table after 30 entries (I would like to avoid anything creating controllers etc as they are over my head)?

 

This is my code (the red section is the data table):

 

<messaging:attachment renderAs="pdf"  filename="Exam results notification">
<html>
<head><style type="text/css" media="print">
body {color:#666666; font-family:"Arial Unicode MS"; font-size:11pt; font-style:normal; }

@page{
    @bottom-left {                  
    content: element(footer);      
    }   
    size: A4 portrait;
    margin-top:0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:0cm;  
}

div.footer {
   display: block;
   position: running(footer);
   line-height: 10pt;
   font-size: 7.5pt;
   color: #A9A9A9;
   z-index:2;                
}
   
</style>
</head>

<body>


<img src="{!URLFOR($Resource.Template)}" style="position: fixed; left: 0cm; top: 0cm;  z-index:-2;" width="21cm" height="29.7"/>

 <apex:dataTable cellpadding="2" width="15.92cm" border="0.2" style=" text-align:center; position: fixed; left: 2.54cm; top: 8cm; line-height: 12pt; font-size:11pt; z-index:+2;" columns="5" value="{!relatedTo.Enrollments__r}" var="cx" >

               <apex:column width="3cm"  >  
                   <apex:facet name="header">Number</apex:facet>
                       {!cx.name}       
               </apex:column>
               <apex:column >
                      <apex:facet name="header">姓名</apex:facet>
                             {!cx.delegate_name__r.LastNameLocal}{!cx.delegate_name__r.FirstNameLocal}
               </apex:column>
               <apex:column >
                      <apex:facet name="header">單位</apex:facet>
                          {!cx.delegate_name__r.department}     
               </apex:column>
               <apex:column >
                     <apex:facet name="header">英文姓名</apex:facet>
                         {!cx.delegate_name__r.LastName}{!cx.delegate_name__r.FirstName}
               </apex:column>
               <apex:column width="2cm" >
                   <apex:facet name="header">Pass/Fail</apex:facet>
                       {!IF(OR(CONTAINS(cx.Exam_results__c,'Fail'),CONTAINS(cx.Exam_results__c,'fail')),'F','P')}
               </apex:column>
               
        </apex:dataTable>



<table width="15.92cm" valign="top" style="position: fixed; left: 2.54cm; top: 27.1cm; line-height: 10pt; font-size:7.5pt; color: #A9A9A9;" >
  <colgroup>
    <col span="4" width="3.98cm" />
  </colgroup>
<tr valign="top">
<td>
address
</td>
<td>address</td>
<td></td>
<td></td>
</tr>
</table>
</body></html>
</messaging:attachment>

 

Many Thanks for any help you can offer.

 

  • December 19, 2012
  • Like
  • 0

Is there a way to change the Finish button default on a VWF run from a custom button URL that's not referencing a VFP?  Basically I have a simple flow that starts with a button click from a detail page, which opens a new browser window and shows some data along with the standard VWF Finish button. 

 

What I'd like is for finish to close the window, not restart the workflow.

 

 

Hi all,

 

I am trying to make a field which displays this:

 

48 x 180 (8,640)

 

But I'm getting this (no separators):

 

48 x 180 (8640)

 

Here's the code I'm using:

 

TEXT(Lot__r.Unit_Count__c) & " x " & TEXT(Lot__r.kg_unit__c) &" (" & TEXT((Lot__r.Unit_Count__c * Lot__r.kg_unit__c)) & ")"

 

Is there a simple way to insert comma separators in TEXT numbers - or perhaps a better way to do this? I am stumped and think the only way must be to write some combination of RIGHT and TRIM statements - or something else? This must have come up before, right?

 

It's easy in APEX:

 

<apex:outputText value="{0, number, ###,###,###,###}"><apex:param value="{!Quote.Total_Price__c}"/></apex:outputText>

 

...but does not work in formula fields.

 

What am I missing? Thanks much for any help.

 

Alex

 

 

 

We have multi-currency feture enabled.

 


We have several custom objects for documents like sales order, sales quote, ap invoice ,where values  are stored in the local exhange rate.  GBP, EUR, CHF etc. and the corporate currency is set as USD.
 
I need to be able to record an amount (in a new field) in USD
 
Does anyone have a solution to get values for a currency feild in its curporate currency value.

 

I have trieid using convertCurrency in the select statements but it returns the values in user's currency.

 

I want to know, how do we get the values in corporate currency for any  currency field value.

 

Thanks


Wow, I just can't seem to figure this simple thing out.  In a visualforce template I want to create a link to an object record. 

 

I've seen examples like this

 

 

({!LEFT($Api.Partner_Server_URL_140, FIND(".com/",$Api.Partner_Server_URL_140)+3)

 

but shouldn't I be able to use a simple relative URL to get this to work?

 

 

 

 

A new record was created!  <a href="/{!RelatedTo.ID}">Click here</a>  to see it.

 

 

However, when the email gets sent out the link becomes "http://5008000000dmoskaax/" and not "http://na8.salesforce.com/5008000000dmoskaax"

 

 

 

Any idears?

 

 

 

Tyler

 

 

 

Hi All -

 

I am new, so please forgive my green - but I am having a perplexing problem in generating a Visual Force email template showing related lists for a custom object.

 

I CAN get a list of Cases related to an Account with no problem, but when I put in a custom object  (Child Relationship Name "Suppliers") which is also (Master-Detail) related to Account I get the following error: Error: Invalid field Suppliers for SObject Account

 

I have tried everything I can think of - using API name instead, appending "__c" to the end, but it seems that i can't make any lists at all with custom objects in this code.

 

Is there a restriction within this type of code that allows only lists with standard objects or is there something I'm missing?

 

Any help would be greatly appreciated. I am not good enough to make a custom Apex controller yet and a little under the gun to kluge something together.

 

Thanks much,

 

Lex

 

Below is relevant code:

 

 

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Account"
    subject="Supplier report for Account: {!relatedTo.name}"
    replyTo="support@acme.com" >
<messaging:htmlEmailBody >   
<html>
    <body>
     <STYLE type="text/css">
           TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
           TD  {font-size: 11px; font-face: verdana }
           TABLE {border: solid #CCCCCC; border-width: 1}
           TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
         <font face="arial" size="2">
      <p>Dear {!recipient.name},</p>
      <p>Below is a list of supplier records related to the account: {!relatedTo.name}.</p>
<table border="0" >
        <tr >
            <th>Action</th><th>Product</th><th>Status</th><th>Creator Email</th><th>BL date</th>
         </tr>
<apex:repeat var="cx" value="{!relatedTo.Suppliers}">
   <tr>
       <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> |  
       <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td>
(...snip...)

 

 

Hi,

 

I have a very basic question on VF coding. I want to have two or three line breaks between two fields in Visualforce page. I tried writing <p></p> , but it did not give line break. How can I get line break in Visual force?  Thanks in advance.

  • August 13, 2010
  • Like
  • 0

Hi All,

 

Does anyone know how to output the day text part? ie for 1st, it would be 'st', 2nd 'nd', etc. It doesnt seem possible with Java date formatting: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

 

Thanks in advance.

 

Message Edited by danlat on 03-18-2010 08:21 AM
  • March 18, 2010
  • Like
  • 0
Pretty self explanatory...I want to make a button that closes the visualforce page...and no, window.close() doesn't work :robotmad: