Archive

Archive for March, 2011

Send Email with Form Script

March 8th, 2011 No comments

Below is a pretty useful Form Script Function that can be used to send out email.  You can trigger this by any event. 

PublicSub SendEmail()
Dim EmailBody AsString
Dim toAddress AsNew Net.Mail.MailAddress(ThisForm.PrimaryIDOCollection .GetCurrentObjectProperty("your_email_field"))
Dim FromAddress AsNew Net.Mail.MailAddress("me@company.com", "Display Name")
EmailBody = "Some text:" & ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("some_property") & vbNewLine _
& "Some more stuff: " & vbNewLine & ThisForm.PrimaryIDOCollection.GetCurrentObjectProp erty("description")
Dim msg AsNew Net.Mail.MailMessage(FromAddress, toAddress)
msg.Body = EmailBody
msg.IsBodyHtml = False
msg.Subject = "Some subject:" & ThisForm.PrimaryIDOCollection.GetCurrentObjectProp erty("some_property")
Try
Dim mySmtp AsNew Net.Mail.SmtpClient("IP address of your SMPT server")
mySmtp.Send(msg)
Catch ex As Exception
MsgBox(ex.Message)
End Try
EndSub

Default some fields value in "Filter in Place" mode

March 1st, 2011 No comments

When a Syteline form open in “filter in place” mode, you may want some of the fields already have frequently use value there.  For example, you may want the warehouse field has default filter value of “Main”.

To do that, it is pretty simple.  In the form you want to set this up, add a new event handler for event: StdFormFilterInPlaceBeginCompleted.  The Handler will be: Set Value, SETPROPVALUES(Whse=MAIN).

That will do the trick.

Categories: Development, VB .Net Tags: