How can I filter Resource Assignments in the Project JSOM API

%3CLINGO-SUB%20id%3D%22lingo-sub-1552119%22%20slang%3D%22en-US%22%3EHow%20can%20I%20filter%20Resource%20Assignments%20in%20the%20Project%20JSOM%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1552119%22%20slang%3D%22en-US%22%3E%3CP%3EI%20can't%20seem%20to%20find%20a%20way%20to%20filter%20resource%20assignments%20when%20you%20read%20them%20from%20the%20resource%20(ie.%20using%20%3CSTRONG%3EEnterpriseResource.get_assigments()%3C%2FSTRONG%3E%20using%20the%20Project%20JSOM%20API%20(PS.js)%20from%20a%20Sharepoint%20addin%20installed%20into%20the%20PWA%20site.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20this%20case%2C%20I%20want%20show%20all%20%3CEM%3Efuture%26nbsp%3B%3C%2FEM%3Eassignments%20for%20this%20resource%20and%20not%20have%20to%20troll%20through%20hundreds%20of%20old%20ones.%3CBR%20%2F%3E%3CBR%20%2F%3EWith%20other%20lists%2C%20I%20appear%20to%20be%20able%20to%20say%26nbsp%3B%3CSTRONG%3E.get_list()%3C%2FSTRONG%3E%20and%20then%20use%20a%20CAML%20query%20to%20apply%20a%20filter.%20But%20there's%20no%20get_list%20equivalent%20for%20the%20DraftAssignmentCollection%20returned%20from%20%3CEM%3Eget_assignments()%3C%2FEM%3E%3CBR%20%2F%3E%3CBR%20%2F%3EIs%20there%26nbsp%3B%3CSTRONG%3Eany%3C%2FSTRONG%3E%20way%20to%20filter%20this%20list%3F%20Or%20is%20there%20an%20easy%20way%20to%20call%20the%20REST%20API%20from%20a%20session%20that%20is%20already%20using%20the%20PS.js%20or%20SP.js%20libraries%3F%3CBR%20%2F%3E%3CBR%20%2F%3EI'm%20surprised%20there's%20no%20simple%20way%20of%20injecting%20CAML%20into%20the%20'load'%20functions%20via%20the%202nd%20parameter%20-%20but%20then%20again%26nbsp%3B%3CEM%3Ethe%20second%20parameter%20to%20the%20load%20functions%20documented%20anywhere.%3C%2FEM%3E%26nbsp%3BI'm%20quite%20unimpressed%20with%20the%20over-all%20quality%20of%20the%20documentation%20so%20far.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1552119%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EProject%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

I can't seem to find a way to filter resource assignments when you read them from the resource (ie. using EnterpriseResource.get_assigments() using the Project JSOM API (PS.js) from a Sharepoint addin installed into the PWA site.

In this case, I want show all future assignments for this resource and not have to troll through hundreds of old ones.

With other lists, I appear to be able to say .get_list() and then use a CAML query to apply a filter. But there's no get_list equivalent for the DraftAssignmentCollection returned from get_assignments()

Is there any way to filter this list? Or is there an easy way to call the REST API from a session that is already using the PS.js or SP.js libraries?

I'm surprised there's no simple way of injecting CAML into the 'load' functions via the 2nd parameter - but then again the second parameter to the load functions documented anywhere. I'm quite unimpressed with the over-all quality of the documentation so far.

0 Replies