Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Salesforce 基于picklistValues渲染Visualforcepage_Salesforce_Visualforce_Apex - Fatal编程技术网

Salesforce 基于picklistValues渲染Visualforcepage

Salesforce 基于picklistValues渲染Visualforcepage,salesforce,visualforce,apex,Salesforce,Visualforce,Apex,我正在尝试使用picklist值中的更改来呈现visualforce页面。我要呈现的数据是表中的联系人姓名。根据我选择的销售区域的不同而有所不同 控制器 公共类PhotoSchedulerController{ 公共字符串salesRegionId{get;set;} 公共字符串ContactSalesRegion{get;set;} 公共页面引用SalesRegionOveredFilter(){ String contacts=[从联系人中选择Id、Name、Sales_Regions_Co

我正在尝试使用picklist值中的更改来呈现visualforce页面。我要呈现的数据是表中的联系人姓名。根据我选择的销售区域的不同而有所不同

控制器

公共类PhotoSchedulerController{
公共字符串salesRegionId{get;set;}
公共字符串ContactSalesRegion{get;set;}
公共页面引用SalesRegionOveredFilter(){
String contacts=[从联系人中选择Id、Name、Sales_Regions_Covered___c='03']。Sales_Regions_Covered__c;
系统调试('销售区域:'+联系人);
返回null;
}
公共列表GetSalesRegionCoveredValues(){
列表选项=新列表();
Schema.descripbeFieldResult salesRegion=Contact.Sales_Regions_Covered__c.getdescripe();
List salesRegions=salesRegion.getPicklistValues();
for(Schema.Picklistentry条目:salesRegions){
添加(新的SelectOption(entry.getLabel(),entry.getValue());
}
返回选项;
}
公共列表getHeadDays(){
List formattedDays=新列表();
列表天数=新列表();
DateTime currentDay=DateTime.now();
对于(整数idx=0;idx<28;idx++){
天。添加(当前天+idx);
系统调试('天:'+天);
}
用于(日期时间dt:天){
字符串formattedDay=dt.format('E');
formattedDays.add(formattedDay);
}
返回时间为天;
}
公共列表getHeadDates(){
List formattedDates=新列表();
列表日期=新列表();
Date currentDate=system.today();
对于(整数idx=0;idx<28;idx++){
日期。添加(当前日期+idx);
}
对于(日期:日期){
字符串formattedDate=dt.format();
formattedDates.add(formattedDate);
}
返回格式化日期;
}
//检索包含已包装大小写标题的行包装
公共列表getDataRows(){
List scheduledDates=新列表();
摄影师箭头=新的摄影师箭头();
List dataRows=新列表();
对于(联系人con:getContacts()){
船头摄影师=con.名称;
船首照片Id=控制Id;
船首联系人添加(con);
}
对于(整数idx=28;idx>0;idx--){
船首小计增加(idx);
}
对于(案例c:getCaseInfo()){
船首案例编号=c案例编号;
船首案例。添加(c);
}
dataRows.add(船头);
返回数据行;
}
公共级摄影师罗{
公共字符串{get;set;}
公共字符串{get;set;}
公共字符串caseNumber{get;set;}
公共列表联系人{get;set;}
公共列表案例{get;set;}
公共列表小计{get;set;}
公共列表计数{get;set;}
//建造师
公众照片如箭头所示{
联系人=新列表();
小计=新列表();
计数=新列表();
案例=新列表();
}
}
公共列表getContacts(){
Listcontacts=[从联系人中选择Id、姓名、销售地区和覆盖范围];
返回联系人;
}
公共列表getCaseInfo(){
列表联系人列表=新列表();
List formattedDatesList=新列表();
对于(联系人c:getContacts()){
联系人列表。添加(c.姓名);
}
列表日期=新列表();
Date currentDate=system.today();
对于(整数idx=0;idx<28;idx++){
日期。添加(当前日期+idx);
}
系统调试('日期列表:'+日期);
系统调试('联系人列表:'+联系人列表);
列出案例=[从RecordType.DeveloperName所在的案例中选择id、案例编号、计划日期、Account.Owner.Name、摄影师联系人姓名('Time\u Booking'、'Media\u Package'、'Photography')
和计划的_Date_uc=:dates];
system.debug('查询的案例:'+案例);
返回案例;
}
/*公共整数getCaseCount(){
整型病例数;
列表
{!计数。案例编号}

谢谢

我不确定您是否100%复制了它,但我注意到您的outputPanel的ID是“数据块”,但actionSupport上的Reender属性是“数据块”,这当然不起作用

<apex:page controller="PhotoSchedulerController" tabstyle="Report" sidebar="false">
    <apex:form>
        <apex:outputPanel id="dataBlocks">
            <apex:sectionHeader title="Field Researcher Schedule for Region" />

            <apex:selectList value="{!contactSalesRegion}" size="1" multiselect="false">
                <b>Field Researcher Schedule for Region</b>
                <apex:selectOptions value="         {!SalesRegionsCoveredValues}"></apex:selectOptions>
                <apex:actionSupport event="onchange" action="{!salesRegionCoveredFilter}" reRender="dataBlock">
                    <apex:param name="salesRegionId" assignTo="{!salesRegionId}" value="{!SalesRegionsCoveredValues}"></apex:param>
                </apex:actionSupport>
            </apex:selectList>

            <apex:pageBlock>

                <table class="list" border="0" cellpadding="0" cellspacing="0" id="dataBlock">

                    <tr>
                        &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;

                        <b>Scheduled Date</b>

                    </tr>
                    <tr>

                        <td>
                        </td>
                        <apex:repeat value="{!headDays}" var="days">
                            <th style="background-color:#00BFFF;">
                                {!days}
                            </th>
                        </apex:repeat>
                    </tr>

                    <tr class="headerRow  ">
                        <th style="background-color:#00BFFF;">Photographer: Full Name</th>

                        <apex:repeat value="{!headDates}" var="heading">
                            <th style="background-color:#00BFFF;" class="headerRow ">
                                {!heading}
                            </th>
                        </apex:repeat>
                    </tr>
                    <apex:repeat value="{!DataRows}" var="dRow">
                        <apex:repeat value="{!dRow.contacts}" var="photo">
                            <tr>
                                <td style="background-color:#d4dadc;">
                                    <a href="https://apartments--pre.cs20.my.salesforce.com/{!photo.Id}"> {!photo.Name} </a>
                                </td>

                                <apex:repeat value="{!dRow.cases}" var="count">

                                    <td>
                                        {!count.casenumber}
                                    </td>

                                </apex:repeat>

                            </tr>
                        </apex:repeat>

                    </apex:repeat>
                </table>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
</apex:page>