AJAX picklist to display a complex view

hello to everyone.

i’m just trying to get a couple of ideas on how people would go about accomplishing something like this:

i have an AJAX picklist (from Scott Good’s AJAX NAB Picker; amazing work!) which has been modified to display a view’s contents. the view (vwEmployees) contains notes IDs, employee ID number, full name, etc. i have another view (vwEmployeeRoles) containing notes IDs and the corresponding roles that they have in the DB’s ACL. i have two agents populating these views: agent 1 retrieving data from an SQL database, and agent 2 retrieving the data from the ACL.

now, what i want to do is retrieve all the vwEmployee records which have a specific role, like [Encoder]. i have to find a way of, uh, for lack of a better word, joining these views together using the Notes ID as a link.

am thinking of calling an agent that does the searching, outputs the documents into another view, and that view will be the one displayed by the picklist.

however it seems like overkill. is there a simpler way that i might have missed?

thanks a lot in advance. have a good day people.

HTH,

isabel

Subject: AJAX picklist to display a complex view

Yuo pointed to a major problem with views: you cannot use view data to access anothe document and get data out of that document.

You could however modify you agents that all data is stored into a single doucment and then it is avaialable in all your views. I understand that it requires some extra work, when part of the data is changed. In that case you have to make sure that the updates are applied in all relevant documents. Here the StampAll function may be handy.

Subject: RE: AJAX picklist to display a complex view

thanks a lot.

that was exactly the simple (well, relatively simple) method that i missed. i suppose i was so engrossed in the JS code i totally forgot that it would be way easier to edit the two agents who were creating the documents. i am now bonking my head on my desk.

why won’t they make the view selection formulas SQL-ish? like adding joins or anything that allows you to combine data from different views. although i know Notes shouldn’t be treated as a relational database. it really requires a bit of a change in perspective for ex-SQL people like me.

but if there’s already something like that i just missed, please point it out! learning is fun. :slight_smile:

Subject: AJAX picklist to display a complex view

while I do not know how the particular picklist has been coded, there must be little problem to feed the data twice from two views - you just need to change the way the data gets stored/displayed. Instead of reading a single view and displaying it as a picklist at once, you can first read the other view and add the missing data by noteid (that is available from both views by default)

Subject: RE: AJAX picklist to display a complex view

hmm. i’m not exactly sure how to do that…

the data of the view in xml form is displayed by the picklist in a table. i suppose i could call readViewEntries twice (once for each view) and then combine and manipulate the xml data returned by them to get the desired output.

only that i had hoped i wouldn’t be messing too much with those pointy little bracket thingies… but it would be worth a try too!

did i get what you were trying to say? i hope so. anyway, thank you very very much. :slight_smile: