Topic Options
Rate This Topic
#135812 - 11/06/06 07:24 AM Enable a filter via Java API
Vitus Offline
Just Signed Up

Registered: 07/17/06
Posts: 2
Hi,

is there a possibilty to enable or disable a filter via an API call.

I tried the following:

Code:
 context.login();
 FilterCriteria c = new FilterCriteria();
 c.setRetrieveAll(true);
 WorkflowObjectListCriteria w = new WorkflowObjectListCriteria(formName,0);
 Filter[] x = FilterFactory.findObjects(context,w,c);

 x[0].setEnable(1);


But it does not work.
What is wrong with my code?

Thx a lot,
Vitus

Top
#135858 - 11/09/06 10:53 AM Re: Enable a filter via Java API [Re: Vitus]
remedybuff Offline
Stealth Member

Registered: 05/05/06
Posts: 76
Loc: New Jersey, USA
try to find the filter on the server this way,

FilterFactory filterFactory = FilterFactory.getFactory( );
FilterKey key = new FilterKey( );
FilterCriteria criteria = null;
if( FilterKey.GetBoolean( false )
{
criteria = new FilterCriteria( );
criteria.setRetrieveAll( true );
}
Filter filter = filterFactory.findByKey( context, key, criteria );


and then enable the filter..

Thanks,

Anuj.

Top