Lotus Notes formula language : Compose document with default values - lotus-domino

What I need is ,
I have a button in a form where
with formula language (not in lotus script)
I compose a new form using #Command([Compose]; ""; "myForm");
but I need to pass some field value from current form .
The #SetField works for current form.
Is there any option ;
If I run Agent #command is possible to run with parameter in order to send current document ID and to create myForm , having values from current form ?
Thanks to advice me !

If document A with current form is selected, when you create document B with another form, then you simply enable the FORM- Property "Formulas Inherit Values from selected document" on the second tab of the properties.
In the field- formulas of form B just enter the name of the Field in Form A as Formula. e.G.: If the field in Form A is named "AEmail" then enter AEmail in the Value of field "BEmail" of Form B.
Beware: this "inheritance" is only done ONCE when the document is created, there will be no relation between the two documents to update BEmail, if AEmail changes. To update the values dependantly you would need to construct something like #GetDocField( unidOfDocA; "AEmail" ) but that would need some more knowledge of the formula language.

Related

Script to extract and assign values from a nested JS object

I presently have a nested JS object of the format:
var oNames = {
Adobe:{LastUpdate:'03/09/2022',Website:'adobe.com',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'',SecondaryCC:'',PrimaryBank:'',SecondaryBank:'',SQ1:'First girlfriend',SA1:'Denise',SQ2:'Grade school attended',SA2:'OLPH',Notes1:'',Notes2:''},
Amazon:{LastUpdate:'10/06/2020',Website:'amazon.com',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'Discover',SecondaryCC:'Capital One',PrimaryBank:'',SecondaryBank:'',SQ1:'',SA1:'',SQ2:'',SA2:'',Notes1:'',Notes2:''},
AmericanGiant:{LastUpdate:'01/25/2022',Website:'american-giant.com',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'',SecondaryCC:'',PrimaryBank:'',SecondaryBank:'',SQ1:'',SA1:'',SQ2:'',SA2:'',Notes1:'Best Hoodies Made in the USA',Notes2:''},
Asus:{LastUpdate:'11/05/2022',Website:'https://www.asus.com/us/',UserID:'jdoe#gmail.com',PWD:'1234567',PrimaryCC:'',SecondaryCC:'',PrimaryBank:'',SecondaryBank:'',SQ1:'',SA1:'',SQ2:'',SA2:'',Notes1:'Goto for MB & Laptop Computers',Notes2:''},
.
.
.
]
Can someone please provide me with a sample script that loops through the object above to obtain the values for the properties in the object above associated with each name using the variable, cName, that derives its value from a selection made by an end user from a drop-down box form field that resides on a PDF form. In short, the value provided by the variable 'cName' will be one to match any one of the name values in the object, i.e., Adobe, Amazon, AmericanGiant, Asus in which event the remaining fields residing on the PDF form will be populated with those property values associated with the name selected. Hope this explanation is clear. Unfortunately, I am not as familiar working with object pairs as I am with arrays and as such am stuck creating a script that works with a nested object as provided above. Thank you ahead of time.
for(j=0;j<15;j++){
f=getField("inf."+j);
cName = oVendors[event.value][j];
}
"inf."+j denotes 1 of 15 PDF form fields to be populated from the values in the object associated
with the name in the object equal to 'cName', the name selected in the combo box that resides on the PDF form.
Upon further study of the JS object and its methods, the following script is
required to extract names stored inside a JS data object in a hidden text field
used to populate a drop-down box on the PDF form as follows:
dsFld =getField("dataSrc");// call getField method used to obtain the stored
data value in the hidden text field that resides on the PDF form
oVendors = JSON.parse(dsFld.value);// parse the JSON string to convert to a JS
object to complete tasks to follow
f = getField("cbNames");// call the getField method to get the
drop-down combo box field or later use
aNames=new Array();// create the temp array
for(var key in oVendors){// script to populate the temp array from names
taken from/stored in oVendors data object
aNames.push(key);
}
aNames.sort();// sort the names alphabetically in the temp array
f.setItems(aNames);// assign names from the array to the drop-down
Combo Box field on the PDF form
f.insertItemAt("Add or lookup and select a name");// Insert text item at
the topmost item provided in the drop-down combo box list
dsFld.value=JSON.stringify(oVendors);// convert JS obj back to a JSON
string value stored in the hidden text field
Sorry for the initial ambiguous post and any inconvenience to the forum.

Attach user form to UDF which is created in system form

I'm learning sap b1. I have created a field in marketing document. When I enter any value in this field and press on tab button, my user defined form should be open with the data from OITM table and find textbox and highlight the record with value which I entered in UDF.I already seen sample of SimpleForm but not getting anything from it. How can I achieve this?I'm using C# in VS. Plz help me with some examples/hints/code. I would be really grateful for your help!
Thanks.
You need to use choosefromlist controll, you should set Choosefromlist to item object 4, then in EditText properties choose this CFL and in the Alias field enter table filed which you want to filter when tab is pressed.

Populating values in the continuous Form after pressing a command button in Ms Access 2016

I have continuous Form (part of the Main Form)
I need to create a button after pressing on which - only specific values should populate across the entire Form.
The Form tied to Category-Objective table with the following values -
My YesNoFK field has values Yes = 1, No=2
In my Form, when user will click "Comma" button I want him to see all "Yes" values auto-populated into
Complaint (it is the caption of YesNoFk field):
Please, HELP!
If everyone wants this set, have you considered setting the default value for the compliant combo box in the table design?

Add a field value to text box

I have an Access Table named Count. It has one field named Anz and it has only 1 record. I want to Show this record in a TextBox on a form named overview. So in the design mode of the form inside the TextBox I use the code
[Count]![Anz]
but it Returns me #Name? error when I Switch back to form mode. Where am I going wrong?
You can use in Control Source of your unbound text box =Dlookup("[Anz]","[Count]")
Also you can bound your form to Count table and use for text box control source Anz

MS-Access - Open a form from a hyperlink data click

I have a table and number of forms in my access database.The table has a column of type hyperlink. When i click a value in this column, one of my form in the database should be opened .
How can i proceed?
First off, you shouldn't give your users access to the tables in your database.
Create a form, in datasheet view, based on the table. This allows you to control what your users can do with the data; under Form Properties -> Data you can choose whether users can add, edit, delete and filter the records.
The second form, which is to be opened from the first, should be set up so that the user cannot add records or move between them; ie. no Record Selectors and no Navigation Buttons.
I would advise against using the Hyperlink field type for this, it is not what it is designed for. The Hyperlink field type is for linking to external files, either local or online -- not for navigation around the current database. Use whatever field type best suits the data in the field.
Instead, I would assign an On Dbl Click event to the field you wish to use for linking to the form. Open the datasheet form. Switch to design view, open the property sheet for the form and set HasModule (under Other) to Yes to allow use of VBA on this datasheet form.
Open the property sheet for the field, and under Event click the three dots by On Dbl Click, then Code Builder.
We now must add code to open the other form (showing a single record) at the correct record. This will look something like the following:
Private Sub [field to double click]_DblClick(Cancel As Integer)
'When [field to double click] is double clicked, open [single-record form name] at record
DoCmd.OpenForm "[single-record form name]", , , "[unique field] = " & Me![unique field]
End Sub
Two things should be noted here:
The field to be double clicked does not have to be the field that the record is selected with. In fact, you could put similar code on each field so that, wherever the user double clicks on the record, the other form is opened.
The [unique field] must be unique to each record for this to work properly. I'd use an autonumber ID field.