If i have 3 work attributes say :
Name , title , brand , and i want brand to be processed according to some predefined set of instructions, then the steps required to accompalish the same are :
1. In the brand work attribute , select the type attribute as "Advanced Javascript".
Add the following line to the javascript window:
ret.value = myScript(conn);
Now we need to define the function myScript. We are passing the current object in the same.
2. Go to Scripts on the left, and right click. Select New Script, and give it a name. This is not the script function, but we will we writing our script in it.
Now, we have to make our function:
Copy the following code :
function myScript(conn)
{
var n = conn.getAttribute("Name");
if (n !=null || n.toString()=="Deepak")
e = n;
else
e = conn.getAtribute("Name");
return e;
}
We are nearly done. If you try to run the program now, you will certainly have to deal with an incorrect code.
3. go to script function. select the config tab ,and check the check box -> implict included.
Run the program.
Yout javascript function is ready.
any errors/feedback/queries, drop a comment
No comments:
Post a Comment