我正在构建一个按钮,用户可以在打开案例后获取所有权并将状态设置为活动状态.虽然我的代码非常接近,但我收到了一个我不熟悉的错误.
这是我的代码:
{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")}
var url = parent.location.href;
var record = {!GETRECORDIDS($ObjectType.Case)}; //Looking for current case ID
var updateRecord;
var update_Case = new sforce.SObject("Case");
update_Case.Id = record;
update_Case.User = {!$User.Id};
update_Case.Status = "Active";
updateRecord.push(update_Case);
result = sforce.connection.update(updateRecord);
parent.location.href = url;
Run Code Online (Sandbox Code Playgroud)
我收到这个错误:
A problem with the OnClick JavaScript for this button or link was encountered:
identifier starts immediately after numeric literal
Run Code Online (Sandbox Code Playgroud) 我要做的是创建一个自定义控制器列表,显示机会,案例和可能的另一个对象的混搭.我开始使用visualforce指南中的课程来帮助我:
public with sharing class CasePagination {
private final Case c;
public CasePagination(ApexPages.StandardSetController controller) {
this.c = (Case)controller.getRecord();
}
public ApexPages.StandardSetController CaseRecords{
get {
if(CaseRecords == null) {
return new ApexPages.StandardSetController(Database.getQueryLocator(
[SELECT c.CaseNumber, c.AccountId, c.Subject, c.Status FROM Case c]));
}
return CaseRecords;
}
private set;
}
public List<Case> getCasePagination() {
return (List<Case>) CaseRecords.getRecords();
}
}
Run Code Online (Sandbox Code Playgroud)
我调整了一些visualforce代码来显示现在的案例列表:
<apex:page standardController="Case" recordSetvar="cases" extensions="CasePagination">
<apex:pageBlock title="Viewing Cases">
<apex:form id="theForm">
<apex:pageBlockTable value="{!CasePagination}" var="c">
<apex:outputLink value="{!c.Id}">{!c.CaseNumber}</apex:outputLink>
<apex:column value="{!c.Id}"/>
<apex:column value="{!c.CaseNumber}" />
<apex:column value="{!c.Subject}" onclick="openCase"/>
<apex:column value="{!c.Status}" …Run Code Online (Sandbox Code Playgroud) 在salesforce中,我们设想有人点击帐户对象记录上的引用按钮,并将多个字段信息传递给两个系统中的一个.一个系统是一个Web应用程序.另一个是Windows应用程序.我以为这是对系统的JavaScript调用,但我不确定.我有哪些潜在的选择?你们会怎么做呢?
谢谢,对不起,它是如此广泛.
我们已经设置了此流程来帮助确定案例的优先级.为此,我希望在通过电子邮件发送到案例后触发新的案例记录.然后查询它是否与帐户相关.如果是,我想返回一个值cScore.然后插入.
这是我到目前为止,它返回此错误:
错误:无效数据.查看下面的所有错误消息以更正您的数据.Apex触发newCaseScoring导致意外异常,请联系您的管理员:newCaseScoring:由以下原因导致的BeforeInsert执行:System.QueryException:List没有用于赋值给SObject的行:Trigger.newCaseScoring:第12行,第18列
这是我的代码:
在Case上插入newCaseTrigger(插入之前){
if(Trigger.isInsert){
List<Case> cList = [Select AccountId, Id, Priority_Score__c, Case_Priority_Score__c FROM Case WHERE Id IN :Trigger.new];
List<Case> updateList = [Select AccountId, Id, Priority_Score__c, Case_Priority_Score__c FROM Case WHERE Id IN :Trigger.new];
System.debug('This is the cList:' + cList);
integer size;
integer cnt=0;
List<id> idList = New List<id>();
for(Case cases : cList){
idList.add(cases.AccountId);
size = idList.size();
System.debug('This is the idList:' + idList);
System.debug('This is the size:' + size);
cnt++;
System.debug(cnt);
}
List<Account> aList = [Select Id, Customer_s_Score_Total__c from Account …Run Code Online (Sandbox Code Playgroud)