Client Script : custom form update field - netsuite

Is it possible to retain all the data inside a form when the Custom form field is update? Currently, it reloads the page and all data will be gone.
THank you.

You could do :
On fields edit --> save field value to a cookie
And clear all those cookies on save.
That would be breaking normal functionality though...

I would have to test this, but you could make an array with all your field names, and do a validateField function (so it runs before the field is officially changed) where you get the values of every field in your array and store the values in a global array. Then have a fieldChanged function (so it runs after the field has changed) which loops back through resetting those values. This may most efficiently be done with an associative array

Related

LotusScript - Why do we use array index to access value of text field

I am working on some LotusScript code and came across this syntax to access a text field value: textField(0). I checked this field's properties in the design and it has the type of Text and doesn't allow multiple values. But why do we use the index to access this field value? I need to describe what the code is doing so it makes a difference between "get the value of textField then do something" vs. "get the first element of textField then do something".
The LotusScript expression document.textField is a shorthand form of document.GetItemValue("textField"). As explained in Designer Help, this expression always returns an array of strings for text or text list fields. That's why one has to use document.textField(0), or document.GetItemValue("textField")(0) for that matter, to access the first (and possibly only) element in the returned array.
An important thing to remember is that just because the field properties say that multiple values aren't allowed today, they might have been allowed in the past. Nothing gets "fixed up" in old documents if you change the properties in Domino Designer. Your code always has to consider that possibility.
And for that matter, even when the field properties do say that multiple values aren't allowed, those properties only apply when a user is editing the document using the defined form. An agent or code using any of the Notes APIs can always store multiple values in any text field.
That's why you always access item values through an array. It's not just a matter of "that's how the API works". It's a matter of how the underlying storage works.
And remember: Notes is schemaless. You have to always assume the following:
The item that corresponds to the field might not exist.
The item might be empty even if there's a validation formula that requires it to be filled in.
The item that corresponds to a text field might not actually be a text item.
The item can contain a list even if the multi-values property is not checked.

Kentico - Change Pagetype Field Name without blanking out current values

I have a custom page type for Staff and there's a field called Function. I have a WHERE condition in a repeater like this: Function LIKE '%insurance%' and got an error Incorrect syntax near the keyword 'Function'
From the error I guess Function is a reserved keyword, so I changed the field name to BusinessFunction. However right after changing the field name, I noticed all the values for that field become blank. If I changed it back, the values are back to normal. The question: is there a way to change the field name while keeping the values that are already there -- without access to the backend database?
Wrap the word Function in brackets like so should resolve the problem: [Function]
When you say the values of the field are blank do you mean on the display side in the repeater? Have you changed the transformation to use the new field name? Have you updated the Columns property of the repeater to use the new field name vs. the old one? It will not lose all the data, you just need to ensure all the values of the property/field name are updated everywhere including any custom code you might be using for this page type.

Forcing Computed Fields on a Document to Recalculate using SSJS

Is there a way to force a documents computed fields to recalculate from within an Xpage, without saving the document?
I have a subform on a Notes database with many computed fields, these contain some complex calculations involving time range calculations. The database is used as both a web and client application. For the custom control containing the fields I don't want to have to recreate all the calculations, so have a computed text value bound to the computed form on the document.
On the subform as you tab through entering the information the computed fields are recalculated. On the custom control I have a refresh button which saves the datasource and does a partial refresh of the data entry section, but this can cause some errors or document save conflicts.
I will recreate the calculations if need be, but I just wondered if there is a slicker way of achieving this before I start that process?
DominoDocumentData object has computeDocument() and doComputeDocument() methods. I'm not sure what they do. If you look at the class for your XPage / Custom Control under Local\xsp you can see them. Using the variable name for your datasource, e.g. document1, you will be able to get a hold of the DominoDocumentData object and case it to that class.
There is no such thing as "computed fields on a document". A document is completely unaware how its items got their values.
Computed fields live on forms. You have 2 options (you can use one or both).
when defining a documentDatasource you can specify that the formulas are executed on load and/or save.
use the document.computeWithForm method of the NotesDocument

How to select a field as input value in a CRM 2011 custom workflow activity

I need the end user to select which field he wants updated. Is there an option to have a lookup input parameter that let's the user select a field of the current entity?
I need it to perform operations on the value of the selected field.
As far as I know there isn't a custom type to handle a list of fields (or a list of strings) as InputParameter for a Custom Workflow Activity.
The (ugly) alternative is to use a string parameter where the user enters the field name.
If the list of fields isn't very big, you could add an optionset to the form with those field names and then your workflow could have If conditions based on that optionset.
I strongly suggest you to use a dialog to complete this. You can set the stage, the parameter and based on the situation the values to insert. Also you can execute workflows from the dialog itself.
If the record already exists, consider registering a plug-in on the update message. When in update the request InputParameter["Target"] contains only dirty fields changed by the user.
Instead of creating a list of fields you can create another (role) form to limit the fields the user can edit on the form.

Filtering a repeating table linked to a secondary datasource

I have an infopath form based on a sharepoint list (worktracker).
In that form there is a repeating section which holds data from a secondary source which is the worktracker list again.
I would like to filter that table using the value in a field on the form - this enables me to run a check on duplicate items on the list by using a calculated checking reference.
I have done this by using conditional formatting to hide the non-matching items but that this killing my form as IE throws tantrum as it takes too long.
Does anyone know another way to do this? I am stuck using IE8 - not my choice!
UPDATE:
So since posting the above, I had since tried using a REST connection which doesn't work as my list is too big. I have also tried using an XML connection to a filtered view and that didn't work either!
Cheers,
In the form, select the value field. Create a rule that sets the secondary data source's query field of the same name to that value. Then query the secondary data source. It will only return the items where the value matches.

Resources