You need to sign in to do that
Don't have an account?
Swamy P R N
how to give the api name in apex button logic for a un-managed package
Hi ,
Am created a un-managed package. Earlier my logic and everything works fine, when i created a this package entire sytem field,class apis are changed with some namespace prefix.
Actually i implemented a button logic to execute my apex class. Earlier it was executed, Now when i click on it was showing an error which is in below image. if i added name space prefix to class name also throwing same error.
class:
global class cls_RewardFeedSent{
webservice static string rewardfeedsend(ID rewrdid){
Reward__c rew =new Reward__c();
rew = [select id,name,Active__c,Rward_Amount__c,Time_Based_Mgmnt__c,User__c from Reward__c where id=:rewrdid];
}
}
Button logic :
sforce.connection.sessionId = "{!$Api.Session_ID}";
var rwrd = '{!QnxSPM__Reward__c.Id}';
var result = sforce.apex.execute("cls_RewardFeedSent", "rewardfeedsend", {rewrdid:rwrd});
alert(result);
Can anybody suggest me the solution for this, Thanks in adavnce.
Am created a un-managed package. Earlier my logic and everything works fine, when i created a this package entire sytem field,class apis are changed with some namespace prefix.
Actually i implemented a button logic to execute my apex class. Earlier it was executed, Now when i click on it was showing an error which is in below image. if i added name space prefix to class name also throwing same error.
class:
global class cls_RewardFeedSent{
webservice static string rewardfeedsend(ID rewrdid){
Reward__c rew =new Reward__c();
rew = [select id,name,Active__c,Rward_Amount__c,Time_Based_Mgmnt__c,User__c from Reward__c where id=:rewrdid];
}
}
Button logic :
sforce.connection.sessionId = "{!$Api.Session_ID}";
var rwrd = '{!QnxSPM__Reward__c.Id}';
var result = sforce.apex.execute("cls_RewardFeedSent", "rewardfeedsend", {rewrdid:rwrd});
alert(result);
Can anybody suggest me the solution for this, Thanks in adavnce.
For example, to call the above class, the JavaScript code from above would be rewritten as follows:
var contextUser = sforce.apex.execute("myNamespace.myClass", "getContextUserName", {});
All Answers
For example, to call the above class, the JavaScript code from above would be rewritten as follows:
var contextUser = sforce.apex.execute("myNamespace.myClass", "getContextUserName", {});
By adding namespaceprefix along with " . " i.e,
var result = sforce.apex.execute("namespaceprefix.cls_RewardFeedSent", "rewardfeedsend", {rewrdid:rwrd});