Rule__c:managerules不存在或不是动作Edit的有效覆盖。

时间:2013-01-20 09:34:31

标签: salesforce apex-code visualforce

我在dev org中有一个代码是

的类

类的名称是ManageRules.cls

/**
* This class is used for creating and editing Rule
**/
public with sharing class ManageRules{
public Rule__c newrule {get;set;}
public String objType {get;set;}
public string SearchEvalRule {get;set;}
public string Descr {get;set;}
public List<SelectOption> objOptions {get;set;}
// public String descr {get;set;}
public boolean edit {get;set;}
String ruleId;

public ManageRules(Apexpages.StandardController stdcon){
ruleId = stdcon.getId();
newrule = new Rule__c();
objOptions = new List<SelectOption>();

edit=false;
/**
* Add standard Objects
*/
objOptions.add(new SelectOption('',''));
objOptions.add(new SelectOption('Account','Account'));
objOptions.add(new SelectOption('Contact','Contact'));
objOptions.add(new SelectOption('Opportunity','Opportunity'));
objOptions.add(new SelectOption('Case','Case'));
objOptions.add(new SelectOption('Lead','Lead'));
objOptions.add(new SelectOption('Campaign','Campaign'));
objOptions.add(new SelectOption('Quote','Quote'));
objOptions.add(new SelectOption('Product2','Product'));
//objOptions.add(new SelectOption('ForeCast','Forecast'));

Map<String, Schema.SObjectType> mapObj = Schema.getGlobalDescribe();
for(String objname:mapObj.keySet()){
Schema.SObjectType sobj = mapObj.get(objname);
Schema.DescribeSObjectResult descRes = sobj.getDescribe();
/**
* Add custom objects
*/
if(descRes.isCustom() && !descRes.isCustomSetting()){
String objLabel = descRes.getLabel();
objOptions.add(new SelectOption(objName,objLabel));
}
}

/* Edit Rule */
if(ruleId!=null){
edit=true;
newrule = [select name,object__c,Rule_Execution_Plan__c,Available__c,Evaluation_Rule__c,Description__c from rule__c where id=:ruleId];
if(newrule!=null){
objtype=newrule.object__c;
Descr =newrule.Description__c;
SearchEvalRule =newrule.Evaluation_Rule__c ;

}
}

}

Public List<SelectOption> getEvalRule() {

List<selectOption> options = new List<selectOption>();
options.add(new selectOption('', '- None -'));
Schema.DescribeFieldResult field = Rule__c.Evaluation_Rule__c.getDescribe();
for (Schema.Picklistentry picklistEntry : field.getPicklistValues())
{
options.add(new SelectOption(pickListEntry.getValue(),pickListEntry.getLabel()));
}
return options;
}
public PageReference saveRule(){
newrule.object__c = objtype;
newrule.Evaluation_Rule__c=SearchEvalRule;
newrule.Description__c= Descr;

try{
Database.upsert(newrule);
return(new PageReference('/'+newrule.id));
}
catch(Exception e){
ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,e.getDMLMessage(0));
ApexPages.addMessage(msg);
return null;
}

}

public PageReference saveAndNewRule(){
newrule.object__c = objtype;
newrule.Evaluation_Rule__c=SearchEvalRule;
newrule.Description__c= Descr;
edit=false;
try{
Database.upsert(newrule);
newrule = new Rule__c();
return(new PageReference('/apex/manageRules'));
}
catch(Exception e){
ApexPages.Message msg = new ApexPages.Message(ApexPages.severity.Error,e.getDMLMessage(0));
ApexPages.addMessage(msg);
return null;
}

}


}

我创建了一个对象,它给了我错误

描述资源路径位置类型 保存错误:Rule_ c:managerules不存在或不是操作Edit的有效覆盖。规则 _c.object / RuleCriteria / src / objects第0行Force.com保存问题

我的Rule__c目标代码段我得到的错误是:

<actionOverrides>
<actionName>Edit</actionName>
<content>ManageRules</content>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Visualforce</type>
</actionOverrides>

我无法弄清楚为什么它向我显示这个错误它是一个现有的项目所以我必须将它部署在我的开发组织.on其他org它工作完全正常。我先保存这个类代码,然后尝试保存这个对象代码和得到这个错误。任何人请问如何解决这个问题??

0 个答案:

没有答案