Is there a way (LotusScript or Formula Language) to obtain a list of document secret encryption keys in the current ID? - lotus-notes

I'd like to create a SecretEncryptionKeys dialog list field which prepopulates with the names of the available document keys in the current ID. Is there a way to do so? I cannot seem to find one in the documentation. (I can find #Command([UserIDEncryptionKeys]), but that just opens the Encryption dialog.)
This is a follow-on to Is it possible to programmatically tell Lotus Notes to generate a new secret key? , since I don't want the people who instantiate the new database to have to edit the forms involved to set the default encryption key. If they do, the next time the design on the database instance is refreshed from the template the settings will be overwritten.

The last time I checked in with IBM engineers about this, the answer was no. That was probably about 10 years ago, however I just took a quick look at the Notes 9 API Reference and I don't see anything there that would expose the list of keys, so I suspect that the answer is still no.

Related

How can I trigger a NetSuite workflow on a Form Event (Client side event)

I want to trigger a NetSuite workflow when the user sets the value of a field, but I don't want to have them submit first. The Workflow state builder looks like it has useful options but I can't get it to work.
There's some useful looking blog posts around but a lot of them seem out of date.
Update - more info
My primary issue is this one: Restrict what customers an employee can see (NetSuite)
The hack I'm currently looking at is populating a custom Transaction Column Field that I've added to a custom Time Recording form. The idea is to load this field on the UI with only valid projects (not customers as well), and this I have been able to do.
The problem is I still (as far as I can tell) still need to populate the "Customer" field, which is mandatory; I'm also assuming that if I don't do that then any time that is recorded won't go against the project. I had thought that if the user selects the project they want then I can populate the customer field with that value. I hate this as an approach but I can't see how else to do it. I do have coding experience (including JavaScript) but haven't made the leap into SuiteScript yet.
You won't be able to do this in a Workflow, as they are currently limited to only work with body level fields and cannot modify Transaction Column Fields (aka sublists).
You should be able to achieve this with a Client Side Script though.
Source (Netsuite login required).
Sublist changes will be available for transactions in the 2018.1 release sometime in Feb/Mar.

MVC 5 Save Drafts While Ignoring Missing Required Fields

I have searched for current solutions, but can't find a set of guidelines or examples as to how to achieve the following:
The original requirements involved models with required fields, so we included annotations to those fields. As usual, there is a last-minute change and we are being asked to allow the users to save drafts. These drafts must allow the user to save the forms without any of the required fields.
I would like to know what the best practices for this problem are.
Solutions I am considering, but I accept they might be a hack (and that's why I am asking the experts)
If the user clicks "Save as Draft" I can capture the fields that have information in another ActionResult and run basic validation on those fields. Since there is a chance that required fields are missing, I am thinking in storing the captured info in a temporal model (without any required annotations). If the user decides to edit such form, I can populate fields in the view with the temp. model until the user clicks on "Submit"
Another option is to remove all required annotations and run client-side validations... but am wondering on the amount of work required to do so.
Any thoughts are very much appreciated.
Just have 2 save methods. 1 which is called from the autosave and 1 that is used to submit the process. In the autosave method do not check if(ModelState.IsValid).
Whether you choose to save the incomplete objects to the same table or a different table is your choice. In a relational world I would likely use a separate table, in a non-relational world I would use a singular object collection.
This will allow you to keep the same set of original models. There is a very high cost to duplicating your models, there are certainly times that warrants pass by value/copy but make sure the cost of mapping is there. In this situtation I do not believe there is value in mapping, except perhaps at the persistence level if you need to map to a different object because of an ORM's constraints.
There is deep value in these partial forms. Recording this on the server will allow you to apply analytics to learn why your users abandon your processes. It also gives you the ability to follow up on users who leave incomplete forms such as sending a reminder (nag) email.
You don't want to save anything to your database until it is complete. Having a duplicate table where everything is nullable is cludgy as hell. Before HTML5, the typical path was to save the information to the session, which you could then pull from to refill the fields, but that's requires having a session with a relatively high expiry to be useful.
Thankfully, HTML5 has local storage, which is really the best way to handle this now. You just watch for onchange events on your fields and then insert that value into local storage. If the user submits the form successfully, you destroy the local storage values. Otherwise, you attempt to read those values from local storage when the page loads and refill the fields.
See: http://diveintohtml5.info/storage.html
There's pretty broad support, so unless you need to worry about IE6 or IE7, you won't have any issues.
Another option (depending on your data obviously) would be to comply with the database but not the model. By this I mean ignore Model.isValid and disable Javascript validation on the front end but then satisfy the database table. In a form, you mostly have:
textboxes - default to "" or " "
checkboxes - easy true/false default
radio buttons - one is probably already selected
dates - default to DateTime.MinValue (or DateTimeUTC)
enums - default to 0 (usually for 'unspecified')
Hopefully you are also saving a flag designating that it is in Draft state so that you know you need to interpret the 'null codes' you have set when it comes to displaying the semi-populated form again.

Controlling an NSArrayController and Core data relations

I am new to stackoverflow because I almost never ask questions in forums as there are plenty of questions out there already answered. However my head is about to explode from trying to figure out how to do this app.
First I do this using XCode 4.5.2 for OSX 10.8 deployment of a personal (that is for my use only) double entry accounting software.
Each accounting entry consists of a header of various text fields such as the entry date, a serial number, etc. which I created an Entity called "Entry". Also each such entry has multiple lines such as the various accounts related to that entry, amounts, etc. called an Entity "EntryLine" linked in the model nice and easy.
The thing is that I intended to use text field for the basic header info and below it a linked Table View for each of the line. Being an accounting software there are several checks (validations) that I need to make and I need full control of what is going on. Already tried binding two array controllers, one for each entity and linking the two and saving them to the sqlite file but to no avail!
Now I have an app with just the header up and running by manually getting and setting the info in the top text fields as I please and saving them to the file. But I have no idea how to do the part with the Entry Lines in the Table view. Can I do that manually too or is it better to do bindings through an array controller?
Also tried already with array controller but I get "Table View Cell" when I add a new line in the table. Any ideas on that?
In the Table View there is also an "Account Name" part that is NOT part of the EntryLine entity but my intention is to obtain this information from another entity called "Account" that stores the Account Number and Account Name. On input of the account number that is, the app would skip the name field and move to particulars for input but also bring up the name of the account already inputted. Is this even possible?
Sorry for being a bit vague in my questions but I come from routine program oriented languages and not object oriented one, though I have some Java experience. Any help would be appreciated. No screenshot sorry as I am not yet allowed:(

Creating Lotus Notes documents with specific created/modified/last accessed dates for testing

I'm currently writing an application that moves Notes documents between databases based on the amount of days that have elapsed from the creation/modified/last accessed dates. I would just like to get ideas on a simple and convenient way to create documents with specific dates, without having to change the time on the Domino server, so that I could test out my application.
The best way I found so far was to create a local replica and change the system clock to the date I want. Unfortunately there are problems associated with this method. It does not work on the modified date - I'm not sure how it is getting the modified date information when the location is set to Island (Disconnected) - and it also changes the modified and last accessed dates when the documents are replicated to the server replica.
Someone suggested trying to create a DXL of the document, modify the date time in the DXL file, then import it back into the database as a Notes document; but that does not work. It just takes on the date-time that it was created.
Can anyone offer any other suggestions?
You can set the created date for a document by setting the UNID (which is fundamentally a struct of timestamps, although the actual implementation has changed in recent versions). Accessed and modified times, though, would be unsettable from within the Notes/Domino environment, since the changes you make would be overwritten by the process of saving the changes. If you have a flair for adventure and a need to run with scissors, you could make the changes in the database file itself either programmatically from an external application, or manually with a hex editor. (Editing the binary will work -- folks have been using hex editors to clear the "hide design" flag safely for years. Keep in mind that signed docs will blow up badly, and that you need to ensure that local encryption is off for the database file.)
There's actually a very simple way to spoof the creation date/time: just add a field called $Created with whatever date/time you want. This is alluded to in the Notes C API header file nsfdata.h:
Time/dates associated with notes:
OID.Note Can be Timedate when the note was created
(but not guaranteed to be - look for $CREATED
item first for note creation time)
Obtained by NSFNoteGetInfo(_NOTE_OID) or
OID in SEARCH_MATCH.
Unfortunately, there's no analogous technique for spoofing the mod or access dates. At least none that's ever been documented, as far as I know.
I imagine given how dependent Lotus Notes is on timestamps (for replication, mainly), there isn't an API call that allows you to change the modified, created, or last access dates of a note. (More on the internals of Lotus Notes can be found here.)
I dug around the Notes C API documentation, and found only one mention on how to get/set information in the note's header, including the modified date. However, the documentation states that when you try to update that note (i.e. write it to disk), the last modified date will be overwritten with the date/time it is written to disk.
As an alternative, I would suggest creating your own set of date items within the documents that only you control, for example MyCreated, MyModified, and MyAccessed, and reference those in your code that moves documents based on dates. You would then be able to change these dates as easily as changing any other document item (via agents, forms, etc.)
For MyCreated, create a hidden calculated form field with the formula of #CREATED or #NOW. Set the type to computed when composed.
For MyModified, create a hidden calculated form field with the formula #NOW, and set the type to computed.
MyAccessed gets a bit tricky. If you can do without it, I suggest you live work with just the MyCreated and MyModified. If you need it, you should be able to manage it by setting a field value within the QueryOpen or PostOpen events. Problems occur if your users have only read access to a document - the code to update the MyAccessed field won't be able to store that value.
Hope this helps!

Sharepoint custom user and document library specific properties

Is there a standard way to associate custom properties with a user? I need to store the number of items per page a user selected in a grid of a document library separately for each user and document library.
Edit:
Sorry about this vagueness, I wanted to do it programmatically. It seems like I've found the solution, it is UserProfileManager class, though I'm now looking into whether there is a limitation on the number of properties you can save this way for a user, because the easiest way of saving page sizes on per user+document library basis seems to be using GUIDs of Views as property names and numbers of pages as values. Though I don't know if it is more efficient or not, depends on how sharepoint stores these properties.
No, you would need to create custom code to store the data.
Given the potential amount of data created, it may be wise to store it in a separate database.
This would give greater flexibility in the way the data can be manipulated and retrieved.
Your question is a bit vague. Are you looking to do any custom code? You could do this many ways so it is difficult without knowing more of what you want.
Using custom code you could set up a workflow or event handler to respond to item events and record the information and store it using the User's Profile or as an SPPersistedObject.
If you want a less developer centric way to do it you can use auditing and simply do reporting on your audit results.
You could set up a list to store the selection data, then use events/AJAX on the document list to push tick/untick items into the selection list (store user, library and document as a minimum.
If you don't want a separate list, you could create a field in your document library that stores which users have a given document tagged... You'll still need some kind of event/AJAX to update the list when a user ticks/unticks the box. Crude :)

Resources