The intended audience for this document is OBSYDIAN (Cool:Plex) developers with intermediate and advance experience and who have already covered the introductory lessons on Websydian. Items, terms, and words in italics are concepts that can be found in Windows/Cool:Plex (Advantage Plex)/Websydian documentation
Click here to add PLEX WORLD. WEBSYPLEX: SOLUTIONS TO COMMON PLEX/WEBSYDIAN TASKS to your list of favorites
If you cannot find the solution to your problem try the online Websydian Documentation.
If you have questions, don't hesitate to drop me an email. I provide on-demand remote (100% via the internet) hourly consulting for the entire Development and Project Lifecycles at the best cost in the market.
Developed by: Lucio Gayosso, MIS/M, BS, PLEX Expert (1999-2010)
On the HTML Form add a button and define the link as a JavaScript function.
Look at the following example:
<a href="JavaScript:bEmail();"><img src="images/_fnavEmail.jpg"
border="0" onMouseOver="window.status='';return true;"
onMouseOut="window.status='';return true;">
Somehwere on your form the function bEmail() needs to be defined:
function bEmail() {
SelectOrder(document.OrderGrid);
document.BBp9F.submit();
}
In this case "BBp9" is the Implementation Name of the Event Handler not associated Originally to the calling Page Generator. Obviously, there must be a call from the Dispatcher for the Event Handler to be used.
Note:
Messaging services (MAPI)
COOL:Plex class library analogue: These patterns provide much of the same functionality as the OBMAPI class library. The message system is the backbone for all e-mail and network communication on Windows. The message system is a collection of Windows operating system objects and dynamic link libraries.
The MAPI dynamic link library is a central component in the message system. This library contains programs that serve as the glue between message stores, address books, service providers, the MAPI client, and end-user applications.
Message stores are files containing e-mail messages. Address books contain user specified e-mail address information. Service providers are software applications that are the gateways to and from the message system. Microsoft Mail, Microsoft Fax, and Microsoft Network are examples of service providers.
The messaging services in the WINAPI pattern library enable COOL:Plex applications to create and send e-mail messages through the same interface as the Microsoft Exchange client.
The messaging patterns are:
function bCancel() {
SelectOrder(document.OrderGrid);
document.Process.ChngType.value="4";
document.Process.submit();
}
function bPickUp() {
SelectOrder(document.OrderGrid);
document.Process.ChngType.value="5";
document.Process.submit();
}
function bReinstate() {
SelectOrder(document.OrderGrid);
document.Process.ChngType.value="8";
document.Process.submit();
}
</SCRIPT>
The detailed steps are:
Example:
Test of email that changes its contents based on input parameters.
Inc. /(Incident) with Priority /(IPriority) was created for /(Customer).
Where:
/(Incident), /(IPriority), /(Customer) are three parameters that will be substituted at run-time.
Websydian Functions.Websydian Common Ojects.Send E-mail Message.Send Dynamic Email Script Engine VBSCript
Source Code:
mFileName = trim(&(1:))
Set mFSO = CreateObject("Scripting.FileSystemObject")
Set mFile = mFSO.OpenTextFile(mFileName, ForReading, True)
mBody = mFile.ReadAll
mFile.Close
eMailSubject = "Management Notification"
eMailFrom = trim(&(2:))
eMailTo = trim(&(3:))
eMailCC = trim(&(4:))
mBody = Replace(mBody, "/(Incident)", trim(&(5:)))
mBody = Replace(mBody, "/(IPriority)", trim(&(6:)))
mBody = Replace(mBody, "/(Customer)", trim(&(7:)))
If eMailCC <> "" Then objNewMail.Cc = eMailCC
objNewMail.From = eMailFrom
objNewMail.To = eMailTo
objNewMail.Subject = eMailSubject
objNewMail.Body = chr(10) & chr(13) & mBody
Where:
mFileName = trim(&(1:)) gets the Path for locating the Text File that contains the body of the email (template)
and
&(1:) = Mgr Notes Critical Inc Path (Fields/FullPath). THis parameter
stores the fully qualified path to the "template" file.
&(2:) = The FROM e-mail address (OBMAPI/Address)
&(3:) = The TO e-mail address (OBMAPI/Address)
&(4:) = The CC e-mail address (OBMAPI/Address)
&(5:), &(6:), &(7:) = The input parametersthat will be dinamically
replaced on the body of the message
Finally. in order to use the previous Source Code the VBScript variables must be initialized:
Make an API CALL to "Websydian Functions.Websydian Common Ojects.Send E-mail Message.Initialize VBScript Variables"
Source Code:
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Dim mFileName
Dim mBody
Dim eMailFrom
Dim eMailTo
Dim eMailSubject
Dim mFSO
Dim eMailCC
Set objNewMail = CreateObject("CDONTS.NewMail")
Solution: This will require some work on the generated HTML forms.
Example:
<form method="post" action="./webfulf.exe" name="BBp7F">
<input type="HIDDEN" name="WSYD_SID" value="/(WSYDHIDDEN)/(WSYD_SID)">
<input type="HIDDEN" name="WSYD_EVENT" value="BBp7F">
<input type="HIDDEN" name="OrderNum" value="0">
<input type="HIDDEN" name="SkuNum" value="">
<input type="HIDDEN" name="Size" value="">
<input type="HIDDEN" name="ProdColor" value="">
<input type="HIDDEN" name="WtOrderd" value="0">
<input type="HIDDEN" name="PosOrder" value="/(PosOrder)">
<input type="HIDDEN" name="StoreID" value="/(StoreID)">
<input type="HIDDEN" name="SchPckDt" value="/(WebDat1)">
<input type="HIDDEN" name="SchPckTm" value="/(WebTim1)">
<input type="HIDDEN" name="CartAct" value="/(CartAct)">
<input type="HIDDEN" name="ProdDs1" value="/(ProdDs1)">
<td><a href="JavaScript:Substitute()"><IMG SRC="images/_fnavSub.jpg"
border="0"></a></TD>
Where BBp7F is the Implementation Name of the Event Handler that will trigger a new HTML Page load based on the values of the selected GRID record. The TAG <a href="JavaScript:Substitute()"> represents the call to the Substitute() function in JavaScript code.
<SCRIPT LANGUAGE="JavaScript">
function Substitute() {
SelectItem(document.GRID);
document.BBp7F.submit();
}
function SelectItem(form) {
if (form.SkuNum.length)
{
for (Count = 0; Count < form.SkuNum.length; Count++) {
if (form.SkuNum[Count].checked)
break;
}
document.BBp7F.SkuNum.value=form.SkuNum[Count].value;
document.BBp7F.WtOrderd.value=form.WtOrderd[Count].value;
document.BBp7F.ProdColor.value=form.ProdColor[Count].value;
document.BBp7F.Size.value=form.Size[Count].value;
document.BBp7F.OrderNum.value=form.OrderNum[Count].value;
document.BBp7F.ProdDs1.value=form.ProdDs1[Count].value;
document.CANCEL.SkuNum.value=form.SkuNum[Count].value;
document.CANCEL.WtOrderd.value=form.WtOrderd[Count].value;
document.CANCEL.ProdColor.value=form.ProdColor[Count].value;
document.CANCEL.Size.value=form.Size[Count].value;
document.CANCEL.OrderNum.value=form.OrderNum[Count].value;
document.NOT.SkuNum.value=form.SkuNum[Count].value;
document.NOT.WtOrderd.value=form.WtOrderd[Count].value;
document.NOT.ProdColor.value=form.ProdColor[Count].value;
document.NOT.Size.value=form.Size[Count].value;
document.NOT.OrderNum.value=form.OrderNum[Count].value;
}
else
{
document.BBp7F.SkuNum.value=form.SkuNum.value;
document.BBp7F.WtOrderd.value=form.WtOrderd.value;
document.BBp7F.ProdColor.value=form.ProdColor.value;
document.BBp7F.Size.value=form.Size.value;
document.BBp7F.OrderNum.value=form.OrderNum.value;
document.BBp7F.ProdDs1.value=form.ProdDs1.value;
document.CANCEL.SkuNum.value=form.SkuNum.value;
document.CANCEL.WtOrderd.value=form.WtOrderd.value;
document.CANCEL.ProdColor.value=form.ProdColor.value;
document.CANCEL.Size.value=form.Size.value;
document.CANCEL.OrderNum.value=form.OrderNum.value;
document.NOT.SkuNum.value=form.SkuNum.value;
document.NOT.WtOrderd.value=form.WtOrderd.value;
document.NOT.ProdColor.value=form.ProdColor.value;
document.NOT.Size.value=form.Size.value;
document.NOT.OrderNum.value=form.OrderNum.value;
}
}
</SCRIPT>
Several things need to be noted:
Solution: There are 4 ways in which WEBSYDIAN presents data on an HTML page: Read only data, Empty fields for Input, Populated fields fo Input, and Hidden fields. The variables that need to be populated on each case:
DATA TYPE |
WHEN TO USE |
VARIABLES TO MODIFY |
Read-only fields | To display data (informational use) | Populate WSYDETAIS on Page Generators |
Empty fields for Input | End-user data maintenance (creation) | Populate WebInput on Event Handler |
Pre-loaded fields for Input | End-user data maitenance (update) | Populate WebInput on Event Handler |
Hidden values | To pass values from page to page or change the state of fields | Populate Webinput on Event Handler |
Solution: Some Plex run-time file (for the tool execution) was conflicting
with IIS. Just closed Plex and the application executed correctly.
This message was generic but it could also be produced if some Plex run-time
for the web application are missing. Additional information can be obtained
per these Websydian notes:
If you receive a CGI error or experience other problems when you try to run your Websydian application on a Windows-based Web Server, this might be caused by missing COOL:Plex run-time DLL's and language files. The CGI error message could e.g. be:
The specified CGI application misbehaved by not returning a complete set
of HTTP headers.
The headers it did return are:
Consult your COOL:Plex manual chapter 17 "Deploying Windows client application" to learn which DLL's and other files are needed in your run-time environment. These files must be copied to a folder, from where they can be loaded, e.g. the same folder where your Websydian EXE-file is located.
Try to run the COOL:Plex Websydian application directly through NT Explorer (or a similar file browser). Then the exact name of any missing DLL's or other load problems will be reported in an error dialog box.
Solution: Use the following VBScript Source Code
Check valid Email structure
&(1:) = 0
&(1:) = instr(1,&(2:),"@")
if &(1:) > 0 then
&(1:) = instr(1,&(2:),".")
end if
Where:
&(1:) = Email Validity (FIELDS/Number)
&(2:) = Email Address (OBMAPI/Address)
The Source Code will check validity based on the structure: string@string.string
Why does opening a Websydian Function Action Diagram takes much more than other Plex functions? (Plex 4.5 and previous versions, Websydian 3.0 and previous releases)
Solution: Analyzis by some developers is pointing out into some of the metalogic used in the validation. Follow these thread (EDGE Forums) to update on this issue and check some proposed worked arounds: Time to open AD or time to generate
Do you have any problem/solution you would like to share? Send me an e-mail
and I'll get it posted.
If you found any information interesting or useful please mention it on
the Guestbook on the main page of Plex world.
If you could contribute to keep this site free, personal checks
or paypal payment are gladly accepted (no matter how small the
contribution)
Developed by: Lucio Gayosso (1999-2004)
Background music: Tangerine Dream's "Riding the Lizard overland"
Use the controls to Stop, Start, Play the music
Listen to: R@DIO
DIMENSION and let your mind fly... |
||
Escucha: R@DIO
DIMENSION y deja a tu mente volar...
|