How to fetch the Document/Assignment manager name using # formula - lotus-notes

I have a view in which I need to fetch the document manager name but not the hierarchical name. I need to fetch the last name and the first name. I have used the #Name function but I'm not sure how to use it. Any help will be appreciated.

Many people are under the impression that #Name([G];theName) will give the first name and #Name([S];theName) will give the last name -- because that's what the Lotus documentation says. That's actually true, but it only ever worked for hierarchical names that came in messages received via the old Lotus X.400 gateway, which could include G and S components (e.g., CN=first last/G=first/S=last/OU=ou1/O=org/C=US).
The best you can do with #Name for an ordinary Notes/Domino user is to use #Name([CN];theName), as suggested by #Mike Zens, and then if you need to separate first and last names you can use #Left and #Right. Unfortunately, there's no perfect way to do this because the CN could look like this: "Mary Ann Jones" where the first name might be "Mary" or it might be "Mary Ann". (And I've actually been confronted by a user with that name who was angry that a piece of software I was supporting made the assumption that "Ann" was her middle name!) Or you could run into a name like this: "Jose de la Madrid". There's just no possible algorithm that will always parse a name into the correct parts.
So if you really need to get first and last names separately, the best thing to do is use #NameLookup to retrieve the FirstName and LastName fields from the Domino Directory. Of course, that will only work if those fields are filled in, which isn't 100% guaranteed.

If you are looking for ways to just format the name, as mentioned already you can use the #Name formula:
#Name([CN]; DocumentManager);
If you are looking for specific information on that user, you can use the #NameLookup formula:
lastNameList := #NameLookup([ForceUpdate]; DocumentManager; "Lastname");
(where DocumentManager is the item that has your user's name, and "Lastname" is the value from the Person doc you are trying to retrieve);

This example returns "Mary Tsen" if the AUTHOR field in the document contains "CN=Mary Tsen/OU=Illustration/O=Acme":
#Name([CN]; AUTHOR)
Replace AUTHOR with the field name storing the document managers name.

Related

Replace Parameter Value in Dialogflow

Currently, I am training my agent and I am wondering if someone asks a question is it possible to change a parameter value to what you know it would be. So for example if someone asks do you have any beers can I can change the parameter to be beer instead of beers. Another example is if someone asks do you have any Johnny can I change the parameter to be Johnnie Walker instead of Johnny
If this can be done how can I do it?
The easiest way to do this is by creating developer entities for the different beverage types. This way you would define one "standard" term, and then add the other terms that alias to it.
In a developer entity, always the highlighted value in the sample image is the value identified.
In your case, you can have the word "beer" and "beer","beers" as synonyms of it. So that when a user says beers/beer the identified keyword will be "beer".

How can I display the Author's bio on the Author's View page?

I'm new to TPL (Smarty) but have been using PHP for years.
Is there a roadmap/guide for customising OJS?
As far as I understand this would involve a PHP script to retrieve/assign the information and then a TPL script to actually display the information.
Thanks
Petras
For references, have a look at the OJS Quick Reference and the OJS Technical Reference, both available here: https://pkp.sfu.ca/wiki/index.php?title=OJS_Documentation
By "Author's View Page", I'm assuming that you mean the pages with a URLs like http://.../index.php/[journalPath]/authors/view. Modifying these to include an author biography may be difficult because of the way OJS stores author records.
Each article may have several authors, and author records are not disambiguated -- for two articles with "Joe Smith" as an author, there will be two different entries in the authors table. Currently on the author listing the disambiguation is done by matching the same first name, last name, affiliation, and country. (See pages/search/SearchHandler.inc.php in the authors function for the code that does this.) Many author records may match this set of data, each potentially with its own biography data.
The reason the data is stored this way is to permit users' identities to evolve -- they may change last names, move between institutions, etc. -- without affecting the metadata of existing publications, which should not change.
If you want to determine a single biography statement, you'll need to decide how to pick a bio statement from among potentially many that match the set of data described above. Once you've done that, displaying it will be as simple as assigning the value to the template:
$templateMgr->assign('myVariableName', $somePhpVariable);
...and then using that variable in the templates/search/authorDetails.tpl template:
{$myVariableName|strip_usnafe_html}
FYI, our future plans include using third-party identifiers such as ORCiDs to disambiguate author identities; however, thus far our ORCiD integration is pretty limited. In the current release it's possible for users and authors to enter their ORCiDs so that they're stored with user and author records.

NameLookup does not pull Phone number

I have 2 fields that looks for username, the gets the email address and phone number from user's person document.
Creator_Email: #NameLookup([NoUpdate]; #UserName; "OfficePhoneNumber")
Creator_Ext: #NameLookup([NoUpdate]; #UserName; "OfficePhoneNumber")
The problem is there is one user reported that the extension did not pull out. It came out blank
I have checked on the person document and the phone number is there
the email address pull out correctly, but when I tested changing the first letter of first and last name to lower case (ie. Test.User#domain.com to test.user#domain.com), the field that pulls the email address still show up with Upper case.
I have tried to take the user.id and test it on a different PC and the problem persists.
Any idea why this happens? I know there are 2 address books set up in the company and that is not ideal but I have checked the 2 address books and make sure all the needed information are there.
The #NameLookup formula does a look up to a hidden view on the database, and sometimes you run into a situation where the index for that view isn't up-to-date. You can go to the database and press CTRL+SHIFT+F9 to rebuild all the views, or you can try to use the FORCEUPDATE flag in your formula.
I think you'll find that the #NameLookup call is finding people who have created entries for themselves in their personal address books. If those entries are incomplete, the lookups will fail to find the missing fields.
The #NameLookup will use the parameter...
Go to /File/Preferences/Location then is the current location find the Server Tab and check that you defined Domino Directory server (if empty user search on local)
Check also in the Mail tab, Recipient Name lookup that could "stop after first march" or exhaustively search ALL the names known on the client.
In #NameLookup you can also use [NoUpdate]:[Exhaustive]
be aware as mention before that view may be not up to date, that caching can occurs in the #NameLookup.
In place of this, I suggest to use:
#DbLookup("":"";YourServer:"names.nsf" ; "($VIMPeople)" ; #Name([ABBREVIATE] ;#UserName) ; "OfficePhoneNumber");

Custom memo field isn't copied to Reply or Forward in Lotus Notes 6.5

I work in a development/support team which has a shared Lotus Notes mailbox. We need to be able to associate an issue ID with each email. We started by adding this ID to the subject line (eg. "Something doesn't work [ID12345]"). For performance reasons, our IT dept don't allow indexing of shared mailboxes, so it takes a long time to search for a particular ID.
I decided to add a new ID field, which can be shown as a sortable column in views and folders. I put this field to the visible header (just below 'Subject') in the ($All) view and the ($Inbox) folder, and copied the ($Inbox) design to all the other folders in the database. That much was easy.
My problem is that when we reply or forward, this custom field is not carried over to the new memo, so we have to manually add it again before sending. And of course when the user responds, the field is again missing and must be manually added. I have searched the docs and the internet and haven't found any information on this. Either I have to declare this field as something which persists across replies and forwards, or I have to add a line somewhere which explicitly copies the field contents to the new memo.
fsw,
We do exactly this with our complaint system however our database is indexed although this should not be an issue to you. We created a view that is sorted by ID by extracting just the ID from the subject line, order it by ID and then by date descending. Base it on the $ALL folder view so you get both incoming and sent emails.
We then altered the memo form to include an embedded view single category of the new view that sits above the body which shows all other documents linked to the ticket.
This should avoid having to delve to far into the very complex mail template any further. One thing is to make sure you have a copy of the changes you made and a bit of doco re deploying as you can guarantee that one day your template will be completely overwritten in an upgrade and all your good work will be gone.
As the additional field would have to incorporated into all Memo forms in mail templates in your corporation and as these fields do not easily travel via SMTP, you should stick with the ID in the subject.
What you could do is to parse the subject (#Mid, #Right, ...) in the column formula in the view and only display the ID there (like you did with the additional field).
The other option I envision if having a field is required is to have an agent that processes the incoming message(reply) to have it parse out the issue ID from the subject and write it to the field. You could also do that with queryopen or postopen if running an agent is not possible

How can I create human readable key for notes documents

For the documents stored in the database, I would like to create a human readable key to uniquely identify the document. e.g. PO20090110-001. How do I go about doing that?
When saving a document you can put together the first part of the number by using the date or any technique you like (ej. "PO" & format(date, "YYYYMMDD") & confDoc.getitemvalue("doccounter")).
As for the counter I like to store it in a configuration document and update it when each doc is saved. If there are lots of documents created during the day you can run into rep conflicts on you configuration document, if this is the case you can have an agent on the server do the actual assigning of the number, the drawback to this is that you don't get the number right away when saving.
Hope this helps.
One solution used in our help desk is to take the initials of the current user and add it to the a number in the last document in a view. Add one to the number and store that it the new document along with the ititals and the new number as the key.
It's not simply.
Create field for uniquely key and this key saving onSave (or other event), but you must protect this number to be unique.
You can create agent, which checking number on domino server and if agent find conflict then notify application administrator or other responsibility person to resolve this.
Or each replica generate own number and after replicate on domino, agent assign number in right format.
You can create a "nearly" unique key in Domino simply by using the #Unique function, with no arguments. This will generate a string key, based on the current user's first and last name and the current clock time. You will end up with a string something like: "ESCR-12345678".
I say "nearly" unique, because it is not really like an identity column in SQL - Domino does not guarantee it will only give out a particular string once. If you use #unique in a server-side agent which generates many id's at once - for example, and agent that loops and uses #unique within the loop, you can get into a situation where #unique will return a duplicate - because you create 2 docs within the same second and because your "username" is always the server's canonical name. But, outside of that scenario, #unique is generally safe to use.
If you then need to open or reference docs by this ID, just create a view sorted by that ID and you can a url in the form ../myView/id?readDocument.

Resources