Adding custom buttons in body of a page?

Thanks Moshe, this is the apex class I am calling:

global with sharing class RetrieveNextUtilsSkuid {

public RetrieveNextUtilsSkuid(caseNewCustomList controller) {
}

webService static String retrieveNextCase()
{
String caseId;
List caselist = [select c.Id,c.OwnerId, c.Status, c.CaseNumber from Case c where
c.IsClosed=false
limit 1];
if (!caselist.isEmpty()) {
case caseObj = caselist[0];
caseId = caseObj.CaseNumber;
return caseId;

        }
    return null;        
}

}

And this is my snippet:

{!REQUIRESCRIPT (“/soap/ajax/29.0/connection.js”)}
{!REQUIRESCRIPT(“/soap/ajax/29.0/apex.js”)}
var caseNumber = sforce.apex.execute(“RetrieveNextUtilsSkuid”, “retrieveNextCase”, {});

CaseData.getConditionByName(“CaseNum”);
CaseData.setCondition(caseNum, caseNumber);

I created a Filtered condition on the CaseData model as you mentioned with Filterable Default Off

caseNumber is the param retrieved by Apex
CaseNum is the Condition Name
caseNum is the Condition Var

My button calls the inline snippet above, but at present it isn’t doing anything, do you think there is something wrong with my apex class code, or snippet code

I’ve tried to keep the code simple just to get it working first, thanks again
p.s. The SOQL code above for {caselist} does return values