Programming Reference Manual
 
Syntax
 
Result = RunWebForm( FormData )
 
Description
Creates an input web form, created using the Web Form Editor. Result is of a Variant type and will be an empty string if no reply was received. Else, it will contain all values that were entered in the controls, specified in FormData. The result is formatted in a XML-type structure, readable by Tradium XML classes and functions. Click here for an explaination of the Result value.
 
 
Parameter
Description
FormData
A formatted string, built using the Web Form Editor.
See Also
Example
 
Option Explicit
 
'-------------------------------------------------------
'Demonstratie Tradium Web Macro's
'-------------------------------------------------------
Sub Main
 
Dim Result As Variant
Dim myXML As New ChilkatXml
Dim arrPlaatsen() As String
Dim strPlaats As String
 
'Indien uitgevoerd vanuit de wachtrij, bevat de Commandstring als eerste woord de sessionID
If Len(Command$)> 0 Then
WebSessionID Split(Command$)(0)
End If
 
Result = RunWebForm("0#Keuzemenu##OK||Annuleren#3#Maak svp een keuze van welk onderdeel u een overzicht wenst:#Artikelen#Klanten|Leveranciers|Orders|Artikelen#")
If Len("" & Result) = 0 Then Exit Sub
 
myXML.LoadXml CStr(Result)
Select Case myXML.FindChild("response").FindChild("value").Content
Case "Klanten"
SQL.RunQueryLoadArray "SELECT DISTINCT REPLACE(REPLACE(REPLACE(Woonplaats, '&', '&amp;'), '<', ''), '>', '') FROM Klanten WHERE Admin =1 AND Deleted = 0 ORDER BY 1 ", arrPlaatsen()
 
Result = RunWebForm("0#U heeft voor Klanten gekozen##Toon lijst||Annuleren#2#Selecteer een woonplaats:##" & Join$(arrPlaatsen,"|") & "#")
If Len("" & Result) = 0 Then Exit Sub
 
myXML.LoadXml CStr(Result)
strPlaats = myXML.FindChild("response").FindChild("value").Content
 
RunWebData "Klanten in " & strPlaats _
, "Dit is een overzicht van alle klanten die gevestigd zijn in " & strPlaats & ". U kunt door deze lijst bladeren totdat u door het formulier gesloten heeft. Daarna dient u de macro uit te voeren om een andere lijst op te maken." _
, "SELECT Code AS KlantCode, Bedrijfsnaam, Adres, Postcode, Woonplaats, Website, Email, Telefoon FROM Klanten WITH (READUNCOMMITTED) " _
& "WHERE Woonplaats = " & SQL.TextValue(strPlaats) & " ORDER BY Bedrijfsnaam"
 
Case "Leveranciers"
Result = RunWebForm("0#Bedankt voor uw keuze##Sluiten||#1#Sorry, leveranciers hebben we nog niet online#label|999#")
 
Case "Orders"
Result = RunWebForm("0#Bedankt voor uw keuze##Sluiten||#1#U heeft gekozen voor orders: #www.tradiummobile.eu/actuele-orders#label|999#")
 
Case "Artikelen"
Result = RunWebForm("0#Bedankt voor uw keuze##Sluiten||#1#U heeft gekozen voor artikelen: #www.tradiummobile.eu/productoverzicht#label|999#")
 
End Select
 
End Sub