Click or drag to resize

IDatabaseSubstituteTemplateVarsUrlEncoding Method

Substitute template variables based on an associateid, with the selected url encoding, returning the result.

This function will replace template variables in a string with the specified information, e.g. replace the <name> template variable with the text "SuperOffice AS". If you want to create your own template systems, you can access our substitution engine using this function. This will fill the values based on the logged in user.

Read More

This function will replace template variables in a string with the specified information, e.g. replace the <name> template variable with the text "SuperOffice AS". If you want to create your own template systems, you can access our substitution engine using this function. This will fill the values based on the logged in user.

Read More

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
string SubstituteTemplateVarsUrlEncoding(
	string SourceString,
	int lContactId,
	int lPersonId,
	int lProjectId,
	int lSelectionId = 0,
	int lAppointmentId = 0,
	int lDocumentId = 0,
	int lSaleId = 0,
	int lAssociateId = 0,
	bool bIsMailMergeDraft = false,
	bool bUseHtmlBrackets = false,
	EnUrlEncoding i_enUrlEncoding = EnUrlEncoding.enUrlEncodingNone,
	bool bUseHtmlBreak = false
)

Parameters

SourceString
Type: SystemString
The string containing the template variables The string containing the template variables
lContactId
Type: SystemInt32
Contact id of the contact you want info about
lPersonId
Type: SystemInt32
Person Id of the person you want info about
lProjectId
Type: SystemInt32
Project Id of the project you want info about
lSelectionId (Optional)
Type: SystemInt32
Selection Id of the selection you want info about
lAppointmentId (Optional)
Type: SystemInt32
Appointment Id of the appointment you want info about
lDocumentId (Optional)
Type: SystemInt32
Document Id of the document you want info about
lSaleId (Optional)
Type: SystemInt32
Sale id of the sale you want info about
lAssociateId (Optional)
Type: SystemInt32
Associate id of the associate you want info about
bIsMailMergeDraft (Optional)
Type: SystemBoolean
Default FALSE, TRUE if merge draft. Will not replace all template variables, only the SourceString
bUseHtmlBrackets (Optional)
Type: SystemBoolean
Default FALSE, TRUE if you use { and } instead of &lt; and &gt;
i_enUrlEncoding (Optional)
Type: SuperOffice.COM.SuperOfficeDBEnUrlEncoding
Type of urlencoding, unknown, ansi or unicode
bUseHtmlBreak (Optional)
Type: SystemBoolean
Default FALSE, TRUE if linebreaks are to be replaced with &lt;BR&gt; for use in mail and on web

Return Value

Type: String
String – the text with the template variables replaced
Examples

Replace template variables

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

VB
dim objSO
set objSO = CreateObject("SuperOfficeDB.Database")
enUrlEncodingANSI = 2
enUrlEncodingUnicode = 3
If not (objSO is nothing) Then
    objSO.Login "USERNAME", "PASSWORD"
    str = "Dear <atfn>, have <name> received our offer? " & vbCrLf & "Best regards <auth>"
    MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, False),, "Url encoding template variables false"
    MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, True),, "Url encoding template variables true"

    MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, false, false),, "Url encoding template variables false"
    MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, true, false),, "Url encoding template variables true"

    MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingANSI, false),, "Url encoding template variables ansi"
    MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingUnicode, false),, "Url encoding template variables unicode"    

else
    msgbox "unable to connect to database"
end if
set objso = nothing

VB
dim objSO
set objSO = CreateObject("SuperOfficeDB.Database")
enUrlEncodingANSI = 2
enUrlEncodingUnicode = 3
If not (objSO is nothing) Then
    objSO.Login "USERNAME", "PASSWORD"
    str = "Dear <atfn>, have <name> received our offer? " & vbCrLf & "Best regards <auth>"
    MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, False),, "Url encoding template variables false"
    MsgBox objSO.SubstituteTemplateVars(str,2,2,1,1, False, False, True),, "Url encoding template variables true"

    MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, false, false),, "Url encoding template variables false"
    MsgBox objSO.SubstituteTemplateVarsEx (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, true, false),, "Url encoding template variables true"

    MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingANSI, false),, "Url encoding template variables ansi"
    MsgBox objSO.SubstituteTemplateVarsUrlEncoding (str, 2, 2, 1, 1, 0, 0, 0, 4, false, false, enUrlEncodingUnicode, false),, "Url encoding template variables unicode"    

else
    msgbox "unable to connect to database"
end if
set objso = nothing
See Also