如何在Salesforce中的Picklist中添加更多值?

时间:2012-04-06 06:00:54

标签: salesforce

我必须在选项列表中显示许多值,并且达到一定的限制。但是,当我分配给它时,它会在达到某个限制时抛出错误。那么请帮帮我,如何设法在Picklist中存储更多值?

公式如下:

CASE( Name, 
"Virgin Australia",HYPERLINK("http://www.virginaustralia.com/Personal/Bookings/Managebookings/index.htm","Virgin Australia"),
"Virgin Atlantic",HYPERLINK("https://www.virgin-atlantic.com/en/us/manageyourflights/updatebooking/index.jsp","Virgin Atlantic"),
"Virgin America",HYPERLINK("http://www.virginamerica.com/view-itinerary.html","Virgin Australia"),
"US AIR",HYPERLINK("http://reservations.usairways.com/Default.aspx","Virgin America"),
"United Airlines",HYPERLINK("http://www.united.com/page/genericpage/0,,52172,00.html?navSource=dropDown&linkTitle=itineraries","United Airlines"),
"Turkish Air",HYPERLINK("http://www4.thy.com/mybookings/reservations.tk?target=view&lang=en","Turkish Air"),
"Turkish Air",HYPERLINK("http://www.thaiair.com/AWR_PREM/view-trip.jsp","Turkish Air"),
"Swiss Airlines",HYPERLINK("http://www.swiss.com/web/EN/Pages/index.aspx?Country=US","Swiss Airlines"),
"Southwest Airlines",HYPERLINK("https://www.southwest.com/flight/lookup-air-reservation.html?int=GSUBNAV-AIR-RETRIEVE&forceNe...","Southwest Airlines"),
"South African",HYPERLINK("https://www.flysaa.com/Journeys/reservation/searchpnr.action?nameSpace=reservation","South African"),
"Singapore Airlines",HYPERLINK("https://www.singaporeair.com/manageBooking-flow.form?execution=e1s1","Singapore Airlines"),
"QATAR AIRWAYS",HYPERLINK("http://www.qatarairways.com/us/en/homepage.page","QATAR AIRWAYS"),
"Qantas Airlines",HYPERLINK("http://www.qantas.com.au/travel/airlines/your-booking/global/en","Qantas Airlines"),
"Malaysia",HYPERLINK("https://book.malaysiaairlines.com/itd/itd/lang/en/reservations","Malaysia"),
"Lufthansa",HYPERLINK("http://www.lufthansa.com/online/portal/lh/us/my_account/my_bookings","Lufthansa"),
"KLM - Royal Dutch Airlines",HYPERLINK("http://www.klm.com/travel/us_en/index.htm#tab=db_mmb","KLM - Royal Dutch Airlines"),
"Japan Air",HYPERLINK("http://www.5971.jal.co.jp/eng/SearchReservation.do","Japan Air"),
"Etihad Airlines",HYPERLINK("http://www.etihadairways.com/sites/etihad/_layouts/etihad/obe/RetrieveBooking.aspx","Etihad Airlines"),
"Emirates",HYPERLINK("https://fly.emirates.com/MYB/MMBLogin.aspx","Emirates"),
"Delta Airlines",HYPERLINK("http://www.delta.com/","Delta Airlines"),
"Copa Airlines",HYPERLINK("http://www.copaair.com/sites/US/EN/Pages/homepage.aspx","Copa Airlines"),
"Continental Airlines",HYPERLINK("http://www.continental.com/web/en-US/apps/reservation/default.aspx","Continental Airlines"),
"")

获取错误:编译的公式太大而无法执行(5,171个字符)。最大大小为5,000个字符

4 个答案:

答案 0 :(得分:2)

你可以通过几种方式解决这个问题。

我首选的方法是使用工作流程字段更新。您可以将案例陈述拆分为单独的工作流程,并使用正确的链接更新字段。这样,您就可以将公式计算分成几个工作流程。

示例:

Workflow A:
If "Virgin Atlantic" OR "Virgin Atlantic" OR...
THEN Update the field

Workflow B:
If "Swiss Airlines" OR "Southwest Airlines" OR...
THEN Update the field

依旧......

答案 1 :(得分:1)

在此尺寸下,您将进入代码区。这是Apex和Visualforce的时候,即使您可能不想处理代码管理。不知道您的目的地环境是什么,很难说最佳解决方案是什么。例如,如果您正在编写应用程序以向其他人销售,或者您只是配置自己公司的Salesforce组织以满足您的需求 - 它会改变方法。

如果您不想管理整个Visualforce页面来处理所有详细信息字段和相关列表,请考虑使用您需要的字段(例如上面提到的大量选项列表)进行细长的内联VF页面)。

例如:

的Apex

public List<SelectOption> customList
{
   get
   {
      List<SelectOption> retVal = new List<SelectOption>();

      retVal.add(new SelectOption('value1', 'Label 1'));
      retVal.add(new SelectOption('value2', 'Label 2'));
      retVal.add(new SelectOption('value3', 'Label 3'));
      // ...            

      return retVal;
   }
   private set;
}

Visualforce

<apex:selectList size="1" value="{!controller.theSelection}">
   <apex:selectOptions value="{!customList}"/>
</apex:selectList>

答案 2 :(得分:0)

+1视力。另一种方法是使用字段依赖关系为用户拆分选项。但在这种情况下听起来并不适用于你,因为你正在敲击代码墙 - 而不是“选项”墙。

您可以像这样设置字段依赖关系。控制字段= A-Z,受抚养人是具有该字母的相关航空公司

答案 3 :(得分:0)

另一种解决方案可能是使用AppExchange应用程序,ProvenWorks的AddressTools提供超过3,000个状态选择列表值,而Salesforce State&amp;国家选秀名单。除此之外,它还可以完全自定义,适用于自定义对象。

有关详情,请查看商家信息:https://appexchange.salesforce.com/listingDetail?listingId=a0N30000002zt9uEAA

希望这有帮助。