Having downloaded the source files this should help get things started:
1. Import the business service and the workflow process.
2. Add the following line to the config file in the appropriate place (in the [SWE] section)
ClientBusinessServiceXX = "MFramework"
3. Check in and Deploy the WF Process "MFramework Service Wrapper WF" (if you want to use the asynch business service calling feature).
4. Add the following to the
server script declarations section of the application you are using:
var oBS:Service = this.GetService("MFramework");
oBS.InvokeMethod ("BuildFramework", NewPropertySet(), NewPropertySet());
5. Add the following as a new method in the
server script of the application you are using:
function FrameworkHandle()
{
return this.GetService("MFramework").frameworkHandle();
}
This acts as a wrapper for BCs, BSs etc to get a reference to the Framework object.
6. Add the following to the
browser script declarations section of the application you are using:
setTimeout("BuildFramework()", 1000);
7. Add the following as a new method in the
browser script of the application you are using:
function BuildFramework()
{
var bsUi = theApplication().GetService("MFramework");
bsUi.InvokeMethod("BuildBsFramework",NewPropertySet());
};
8. Compile and generate browser scripts.
Run the application.
To test we'll run some of the browser side functionality (which in turn runs the server side, so is a good way to smoke test)... so when the application is running copy and paste the following into the address bar:
javascript:alert(top.oFramework.BusComp.getRecord("Employee.Employee", "0-1", ["Full Name"])["Full Name"]);
//
Hopefully you'll get an alert with "SADMIN SADMIN" here, if so, great, it works!
Some more tests:
javascript:alert(top.oFramework.BusComp.getRecord("Employee.Employee", "0-1", ["Full Name"]).Full_Name);
//
Same result as above, just accessing the value in a subtly different way.
javascript:alert(top.oFramework.Lov.getDescription("LOV_TYPE","LOV_TYPE"));
//
Here you should get a description of the LOV_TYPE lov.
javascript:alert(top.oFramework.BusComp.getRecord("Employee.Employee", "0-1","").Created);
//
So that should give the Date of when the SADMIN Employee record was created.
javascript:alert(top.oFramework.BusComp.getRecord("Employee.Employee", "0-1","").Created.toDb());
//
Same as last test but displays in DD/MM/YYYY format. This makes use of two features of framework - new methods added to JS datatypes, and optional typing of fields in the BusComp.getRecord() method.
So hopefully that all works, let me know if not and I'll try and figure out why.
For info., I use 7.7 and the ST engine - I did have strong typing in the code, which I have removed to allow this work in the T engine, but there may be some other problems with the way I use the JS objects, so let me know if you've any issues or thoughts.
And let me know if it works too, of course!
Matt