on 04-16-2014 3:35 PM
Hi Experts,
I got a table from oracle db, and i have deployed it and MBO is generated.
That table contains the login credentials which i am giving in the login page.
I have created a login page with user id and password when i am trying to login by using the credentials which i have registered earlier the credentials are being checked in the table and it should return me yes or no if yes i have to move to next screen if no i should display some alert . My problem is that i am not knowing how to get that verified credentials and display them in my code. I am writing this line of code in java script and i am unable to know, how to handle the data after being checked from the MBO .. please help me out of this ..
Try changing this function in your custom.js file
function customBeforeSubmit(screenKey, actionName, workflowMessageToSend) {
if(screenKey === 'SCREENKEYNAME')
{
var form = document.forms[screenKey + "Form"];
if (form) {
/*User_Name is username edit box key name*/
var username = form.User_Name.value;
/*password is password edit box key name*/
var password = form.password.value;
}
}
return true;
}
change the SCREENKEYNAME ,User_Name ,password, hardcoded username, hardcoded password accordingly
Now the user name and password entered by user are in variables username and password. play with that accordingly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lokesh,
You can write an object query for checking the credentials details.
e.g. select x.username, y.password from ABC where x.username=:usernameParam and y.password=:passwordParam
(assuming username and password are the parameters defined in the mbo ABC.)
For verification, if details are/not available in backend
You have to write some piece of code in customBeforeNavigateForward
e.g.
hwc.customBeforeNavigateForward = function(screenKey, destScreenKey) {
if(destScreenKey="Employee" && screenKey=="Start"){
//Here Employee is the MBO name
alert("test");
var message = getCurrentMessageValueCollection();
alert("test1");
var itemList = message.getData("Employee");
alert("test2");
var items = itemList.getValue();
var noOfItems = items.length;
alert("noOfItems="+noOfItems);
if(noOfItems==0){
alert("Invalid input");
return false;
}
}
Rgrds,
Jitendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jitendra,
What were told above,i have through parameters and again, i am not getting any output with code.
I am getting the error below shown,
cannot call method 'get value' of undefined.
How to resolve the above error,if u have any options to send please let me know.
Thanks & Regards,
Lokesh Reddy G.
9700414490.
Hi Jitendra,
This is the code in Custom.js as below shown,
if(destScreenKey="Third_Screen" && screenKey=="Start"){
try {
//Here Employee is the MBO name
alert("test");
var message = getCurrentMessageValueCollection();
alert("test1");
var itemList = message.getData("Registration");
alert("test2");
var items = itemList.getValue();
var noOfItems = items.length;
alert("noOfItems="+noOfItems);
if(noOfItems==0){
alert("Invalid input");
return false;
}
} catch (e) {
alert(e);
// TODO: handle exception
}
}
This is process we have done,but we are not getting,please let me know if u have any solutions ASAP.
Thanks & Regards,
Lokesh Reddy G,
9700414490.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.