How to get the view name of the form by using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2014 03:41 AM
Hi All,
For change table we are having two different views.So I want to get the view name by using script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2014 04:52 AM
I tried this already it is not working.
It is not going to that view loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2014 05:26 AM
When you think about it, view is not saved in the database, it is just a clinet component and hence you cannot get the view in server side scripting.
Workaround:
Step 1: Create a text type field on the form/table that will store the view
Create an onSubmit Client script on the table and use the below code(Replace feild_name with the variable name )
var view = g_form.getParameter('view');
if(view == ''){ // for default view this will return an empty string
view = 'default';
}
g_form.setValue('field_name', view);
Step 2:
in your Business Rule you can use this variable to add conditions to your query.
if(current.feild_name == "default") {
current.addQuery("u_change_type", "Infrastructure");
} else if(current.feild_name == "itcc") {
current.addQuery("u_change_type", "itcc");
}
This should work .
Hope that helps !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2014 06:26 AM
I tried this in same way by using a differentiation filed for two views
We are having one common differentiation field for two views by using that tried in BR but it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2014 06:28 AM
What are you trying to achieve?
Can you elaborate your requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2014 06:44 AM
actually we are having two views for change request table and fields are different in two views.
So we created two modules for checking all change requests for two different views
In first module I want to show default view changes---for this I want to put a default filter and that should not editable
In second module I want to show 'itcc' view changes -- for this I want to put a default filter and that should not editable