Personalised field.

In my notes app I'm sending a document as an attachment to a bunch of users. In the document
I have a field called "TO" which should have the name of the person that recieved the email.
I do I code this field so that when a person recieves the document the Field "TO" contains their name.
LVL 5
apparitionAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
p_parthaConnect With a Mentor Commented:
Is users a multivalue field, if yes then try this

Sub Click(Source As Button)
    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim composed As String
    Set uidoc = workspace.CurrentDocument
set doc = uidoc.document
   
     
    Forall x In doc.Users
         Msgbox x
    End Forall
   
End Sub
0
 
HemanthaKumarCommented:
So what is the problem here ?

Simply make it a computed field , with @UserName as the default value formula

~Hemanth
0
 
apparitionAuthor Commented:
I did but it does not show the user's name...It shows the senders name.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
HemanthaKumarCommented:
Do you include this form while sending the mail ?

Can you give more details on how you are sending this mail.. If you can store the form with mail then you can see that field computing by itself when he/she opens.
0
 
p_parthaCommented:
Create a computed when composed field name and give @username as the default value

Partha
0
 
apparitionAuthor Commented:
Nope does not work
0
 
apparitionAuthor Commented:
I'm send the mail using a simple action.
the action takes the values from a text box and sends the mail
to the users specified in the text box.
0
 
apparitionAuthor Commented:
ok this is what I think I need to do
0
 
apparitionAuthor Commented:
ok this is what I think I need to do

Read the users name from the text box
and go through a loop for each user
For each user name in the text box
Change the TO field
Send Email.

The user names are sperated by ";" How would I be able to accomplish this loop code?
0
 
p_parthaCommented:
I am not sure what u are trying to accomplish, but to loop thru a field of names separated by ";" u can use forall.
Forall x in <yourfieldname>
msgbox x
end forall

Partha
0
 
apparitionAuthor Commented:
in formula language please?
0
 
p_parthaCommented:
there are no looping mechanism in formulas uptil R5, but u can always use

@explode(<yourfieldname>;";"), this will give u the list of all the names


Partha
0
 
apparitionAuthor Commented:
how do I retrieve the list?
0
 
apparitionAuthor Commented:
how Would I go thru the list ?
0
 
p_parthaCommented:
Can u paste your current formula

Partha
0
 
apparitionAuthor Commented:
This is what I'm doing I'm getting a type mismatch error
Sub Click(Source As Button)
      Dim workspace As New NotesUIWorkspace
      Dim uidoc As NotesUIDocument
      Dim composed As String
      Set uidoc = workspace.CurrentDocument
      Users = uidoc.FieldGetText( "Users" )
      
      
      Forall x In Users
            Msgbox x
      End Forall
      
End Sub
0
 
apparitionAuthor Commented:
This what I want to do

Sub Click(Source As Button)
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Dim composed As String
     Set uidoc = workspace.CurrentDocument
     Users = uidoc.FieldGetText( "Users" )
     
     
     Forall x In Users
          Set a field "TO"
          Send the document as an email to the person in TO field
     End Forall
     
End Sub
0
 
apparitionAuthor Commented:
whats the code to Send the document as an email to the person in the TO field
0
 
apparitionAuthor Commented:
The Loop worked
0
 
p_parthaCommented:
what is that "To" needs to be set, it has to be set to the value in Users

if htat is teh case


Forall x in users
doc.to = x
doc.sendto = x
end forall

0
 
apparitionAuthor Commented:
I just used
Call doc.Send( True, x)

It works but theres one last problem. Sorry.
But for some reason when I open the email from my notes client the
User set headers Don't show. Is theres parameter I'm forgetting to set?
0
 
p_parthaCommented:
can u be little clear, what do u mean by "user set headers don't show"

Partha
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.