Hi,
I have been working on lotus notes databases for a few months now and am getting on well with @functions. However i have come to a point where i require lotusscript and need some help.
I have created a page, where a click of a button will launch a form, prompt for information and then autofill certain fields.
The idea behind this is so that the original form can remain the same without changes in the code.
The code for the page is below:
FIELD ShortDescription := ShortDescription;
@Command([Compose]; “Requirement3”);
@UpdateFormulaContext;
@SetField(“ShortDescription”; “Access to Machine Room”);
FIELD MacAccessName := MacAccessName;
FIELD MacAccessRoom := MacAccessRoom;
FIELD MacAccessText := MacAccessText;
@SetField(“MacAccessName”;@Prompt([OkCancelEdit]; “Enter Name” ; “Please type the name of the person who requires machine room access:” ; “”));
@SetField(“MacAccessRoom”; @Prompt([OkCancelListMult]; “Select Required Access”; “Please select the machine rooms that " + MacAccessName + " requires access to:” ; “” ; “Black Room” : “Blue Room” : “Green Room” : “Inner Red Room” : “Outer Red Room” ));
@SetField(“MacAccessText”; @NewLine + MacAccessName + " requires access to the following machine rooms:"+ @NewLine + @NewLine + @Implode(MacAccessRoom ; @NewLine) + @NewLine +@NewLine )
The field ‘MacAccessText’ that i have specified needs to be set in a field called ‘Description’. Unfortunately this is a rich text field so @SetField will not work.
However i have found some lotusscript which i have tested and works a treat! Only problem is “How do i put the @functions and lotusscript together?”
My first thought was to write everything in lotusscript, but obviously that requires more knowledge than i have ![]()
Below is the lotusscript that i need:
Sub Click(Source As Button)
Dim uiw As New notesuiworkspace
Dim uidoc As NotesUIDocument
Set uidoc = uiw.CurrentDocument
Call uidoc.FieldSetText("Description",MacAccessText)
'take fieldappendtext to append if other data exist in the rtffield
Call uidoc.Refresh(True)
End Sub
Oh, and i also tried running this code by calling an agent, but it would not work because the document wasn’t saved - which it can’t be at this point.
Any help would be appreciated,
Richard