developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




Email with button in BlackBerry
Estelle 2 Morin 02/16/2012 01:28 PM
Domino Designer 7.0.2 Windows XP


Hi!

I want to send a button in a email to a blackberry and it doesn't appear. When a send the button in a email to a computer, it work.

Is someone can help me?

This is my code:
Sub Click(Source As Button)
Dim newdoc As notesdocument
Dim liendoc As notesdocument
Dim stream As NotesStream
Dim uidb As notesuidatabase
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim ws As New NotesUIWorkspace
Set uidb = ws.CurrentDatabase
Dim uidoc As notesuidocument
Set uidoc = ws.CurrentDocument
Dim doc As NotesDocument
Set doc = uidoc.Document
Dim view As notesview
Set view = db.GetView("Memo")
Set dc = view.GetAllDocumentsByKey("Memo")
Call dc.removeall(True)

Set workspace = New NotesUIWorkspace
Set db=session.CurrentDatabase
laction_num=Cint(uidoc.FieldGetText("curact_num"))
Set dialogNote = New NotesDocument ( session.CurrentDatabase )
Select Case laction_num
Case 1 : flag=workspace.Dialogbox("DialogBox1", True, True,,,,, "" ,dialogNote)
Case 2 : flag=workspace.Dialogbox("DialogBox2", True, True,,,,, "" ,dialogNote)
Case 3 : flag=workspace.Dialogbox("DialogBox3", True, True,,,,, "" ,dialogNote)
End Select
cuser=dialogNote.current_user
cuserNomComplet=dialogNote.current_userNomComplet
Set newdoc=db.CreateDocument

Set stream = session.CreateStream

stream.WriteText ({<?xml version='1.0' encoding='utf-8'?>})
stream.WriteText ({<!DOCTYPE document SYSTEM 'xmlschemas/domino_7_0_1.dtd'>})
stream.WriteText ({<document xmlns='http://www.lotus.com/dxl' version='7.0' maintenanceversion='1.0' })
stream.WriteText ({replicaid='8525715600467D15' form='Memo'>})
If cuserNomComplet(0) = "" Then
stream.WriteText ({<item name='sendTo'><text>} + cuser(0) + {</text></item>})
Else
stream.WriteText ({<item name='sendTo'><text>} + cuserNomComplet(0) + {</text></item>})
End If
stream.WriteText ({<item name='subject'><text>} + "Le dossier " & doc.emprunteur(0) & " amendement " & doc.amendement(0) & " vous a été recommandé" + {</text></item>})
stream.WriteText ({<item name='typeEntreprise'><text>} + doc.typeEntreprise(0) + {</text></item>})
stream.WriteText ({<item name='emprunteur'><text>} + doc.emprunteur(0) + {</text></item>})
stream.WriteText ({<item name='amendement'><text>} + doc.amendement(0) + {</text></item>})
stream.WriteText ({<item name='Body'><richtext>})
stream.WriteText ({<par def='1'><button width='2in' widthtype='maximum' maxlines='1' wraptext='true' bgcolor='system'>})
stream.WriteText ({Recommander au Crédit<code event='click'>})
stream.WriteText ({<lotusscript>})
Call stream.WriteText ({Sub Click(Source As Button)},0)
Call stream.WriteText ({Dim db as NotesDatabase},0)
Call stream.WriteText ({Dim session as new notessession},0)
Call stream.WriteText ({Dim ws As New NotesUIWorkspace},0)
Call stream.WriteText ({Dim uidoc as Notesuidocument},0)
Call stream.WriteText ({set db = session.CurrentDatabase},0)
Call stream.WriteText ({set uidoc = ws.currentdocument},0)
Call stream.WriteText ({set doc = uidoc.Document},0)
Call stream.WriteText ({Set newdoc = New NotesDocument(db)},0)
Call stream.WriteText ({newdoc.form = "Memo"},0)
Call stream.WriteText ({newdoc.subject = "Dossier recommandé"},0)
Call stream.WriteText ({newdoc.emprunteur = doc.emprunteur(0)},0)
Call stream.WriteText ({newdoc.amendement = doc.amendement(0)},0)
Call stream.WriteText ({newdoc.sendTo ="Estelle MORIN/CCD/Desjardins"},0)
Call stream.WriteText ({Call newdoc.Send(False)},0)
Call stream.WriteText ({Messagebox "La recommendation a été envoyée"},0)
Call stream.WriteText ({End Sub},0)
stream.WriteText ({</lotusscript></code></button></par>})
stream.WriteText ({</richtext></item></document>})

Set dmp = session.CreateDXLImporter(stream, db)
dmp.DocumentImportOption = DXLIMPORTOPTION_CREATE
dmp.Process
Set body = newdoc.CreateMIMEEntity
Call body.SetContentFromText (stream, "text/html;charset=iso-8859-1",ENC_NONE)

Call view.Refresh
Set lienDoc = view.GetFirstDocument
If lienDoc Is Nothing Then
Messagebox "Le courriel n'a pas été crée"
Else
Call uidoc.Close
Set uidoc = ws.EditDocument(True,liendoc)
If cuserNomComplet(0) = "" Then
Call uidoc.fieldsettext("sendTo",cuser(0))
Else
Call uidoc.fieldsettext("sendTo",cuserNomComplet(0))
End If
Set doc = uidoc.Document
doc.sendto = "Estelle MORIN/CCD/Desjardins"
Call uidoc.Close
Call doc.Send(False)
End If
End Sub

Go back