Hi,
Can anyone point out why my SWUser field is blank?
I have 2 forms. The first form has a field SWUser [Names/Computed] where I can choose a user to email too using a simple formula
FIELD SWUser:=SWUser;
@SetField(“SWUser”; @PickList(( [Name] )));
The changes are then saved and so everytime this form is preview it shows the same user over and over which is what I want. On the second form I have added a field SWUser [Text/Computed when composed] and have tried to reference it by showing the user from the SWUser field on form 1. I have done this by putting “SWUser” in the default value but the field remains blank!!
The Forms inherit from selected documents option has also been selected.
This is my send email code adapted from someone elses code: -
if Trim(uidoc.FieldGetText(“SWUser”)) <> “” then
emailmsg.sendTo = uidoc.FieldGetText(“SWUser”)
emailmsg.subject = “FYI: Order Notification”
Set bodyRTF = emailMsg.CreateRichTextItem(“Body”)
Call bodyRTF.AddNewline(1)
Call bodyRTF.AppendText(“Hi,”)
Call bodyRTF.AddNewline(2)
Call bodyRTF.AppendText(“Your order enquiry has been submitted.”)
Call bodyRTF.AddNewline(2)
Call bodyRTF.AppendText(“This will be looked into within the next 24hrs”)
Call bodyRTF.AddNewline(2)
Call bodyRTF.AppendDocLink(uidoc.Document, “Please follow the link to view your order that you submitted”)
Call uidoc.save
Call emailMsg.Send(False)
Else
MsgBox(“SWUser is blank cannot send mail.”)
End if
Thanks a lot