Creative Notes Views?

I know Notes isn’t a relational database (yet!) but I have a need to do something quasi-relational with views.

Let’s say I have Company documents, Agency documents and Contact documents. There are Agencies associated with Companies, and Contacts associated with both. However, there are also relationships between Contacts at the Agency and the Company with whom they are associated.

So can I do a Notes view like this:

Company 1

-Contacts for Company 1

-Agency 1 for Company 1

–Contact 1 for Agency 1 and Company 1

–Contact 2 for Agency 1 and Company 1

-Company 1 Division 1

–Contact 1 for Division 1

–Contact 1 for Division 1

–Agency 1 for Division 1

—Contact 3 for Agency 1

Company 1

-Contacts for Company 2

-Agency 1 for Company 2

–Contact 4 for Agency 1 and Company 2

–Contact 5 for Agency 1 and Company 2

There’s only one Agency in this example, which displays multiple times in the view because they do work for Company 1, Division 1 and for Company 2. But the Agency 1 contacts should ONLY display under the appropriate category.

Thanks very much in advance.

Subject: Creative Notes Views?

It would be easier if we could see which lines in your example are Categories and which are Documents.

Could you repost with a * next to the categories ?

Subject: RE: Creative Notes Views?

Thanks for your response.

They are all documents. The Company docs are Main docs and all others are responses or responses to responses.

Subject: RE: Creative Notes Views?

Any given document can only be in a view once.

It may be displayed under multiple categories, but it’s the same view “row”

Given that, I don’t think you can do what you want to do without categories.

Subject: RE: Creative Notes Views?

You can only sort documents in a Notes view based on:Information in that document, or

Its hierarchical relationship with a parent document.

A parent-response relationship will not work with Agencies being responses to Companies because Agencies work with multiple companies.

A parent-response relationship will not help you between Agencies and Contacts because, even if there’s just one Agency per Contact, the same set of responses will display for each occurrence of the same document in the view. I.e. if Agency 1 appears listed under Company 1, and later under Company 2, the same set of responses will appear hierarchically below Agency 1 in both cases.

So you’re reduced to using information stored in the document, displayed without response relationships (the response relationships may exist but they wouldn’t be used in this view).

That means that each document must contain complete information about its position in the hierarchy – a contact must have a field value that lists its company and agency (if any), and an Agency must list all its Companies. Since you need varying levels of depth in a hierarchy, with documents at each level, your best bet is to use a category column that contains "" characters to create an “ad hoc” multilevel hierarchy.

For instance, the Company document would just use the company name as its category value.

An Agency document, assuming it contained a list of the companies they worked with in a field called Companies, might use this as its category value:

Companies + “\Agencies\” + AgencyName

If there are multiple Companies values, the agency will appear in the view multiple times, once under each company.

A contact record, which contains a value in the Company field and may or may not contain a value in the AgencyName field, might use this as its formula:

Company + @If(AgencyName = “”; “”; “\Agencies\” + AgencyName) + “\Contacts”

This might not exactly match what you’d like to see in the view; for instance, there are two lines for the agency: a category heading and a document row. You probably would prefer it to work more like a response document, where the same row can be clicked to get the document or expanded to see what comes under the document. Also, the indentation of the document rows doesn’t change based on the number of levels deep it is in categories.

If this just won’t work for you, you might consider making an artificial response hierarchy by inserting an extra record type that represents an agency’s relationship with a company. This could be a response to the company document, and contacts from that company belonging to that agency would be responses to it. Then use a view with responses displayed hierarchically, and you’re set to go. Of course, this will take some reasonably serious coding behind the scenes to establish and maintain this extra reference data – but you were going to have to do somehting like that anyway – what happens if the company name changes, after all? Also, form event code will be needed to switch the user to the Agency document when they open an AgencyCompany document.

Subject: RE: Creative Notes Views?

Thanks very much - lots to think about here. Yes, I’ve thought about creating my own artificial response hierachy in the background, and I already have something like it working. Unfortunately if these aren’t actual response docs I haven’t figured out how to allow users to collapse and expand different levels in the view.

But I hadn’t thought about using categories as well as documents in the view. Do you mean throwing a category in at every document level or just above Agency?

Subject: RE: Creative Notes Views?

If any documents are categorized, they all have to be. You just use the "" character to control the depth of categorization. You would have to have a category containing the company name to make the Agencies for that company appear below the company record.

The indentation of the categories is automatic – for the document rows you would need to calculate indentation yourself

Company record for Lake Industries

Contact 1 for Lake

Agency record for Bobblehead Advertising

Contact 1 for Bobblehead and Lake