list view should appear after selecting submit button on a form ?

sk227
Kilo Explorer

Once i enter data and select submit button on a form , list of all particular records should appear instead of blank form ?

thanks in avance !

1 ACCEPTED SOLUTION

india
Tera Guru

Hi sarath



Either use this or that



answer = current.insert();


gs.include('ActionUtils');


var au = new ActionUtils();


au.postInsert(current);



Or



Using a UI Action to Redirect to a URL

As part of a UI action, you may want to redirect a user to a URL. For example, you might add links to a form or open a new record after it is created from a UI action.


To redirect a user to a URL from a UI action, use this syntax to define the redirect link:



action.setRedirectURL('http://www.mysite.com/mypage.htm');


To direct a user to a record, use this syntax, where new_record is the variable name for the GlideRecord:



action.setRedirectURL(new_record);


regards'
Kirtesh


Pls mark as correct/helpful/like


View solution in original post

3 REPLIES 3

srinivasthelu
Tera Guru

Hi Sarath,



Normally the submit button will redirect to the last page in the stack.   You can edit the submit button code and add Redirect URL. Check below for more information



http://wiki.servicenow.com/index.php?title=UI_Actions


india
Tera Guru

Hi sarath



Either use this or that



answer = current.insert();


gs.include('ActionUtils');


var au = new ActionUtils();


au.postInsert(current);



Or



Using a UI Action to Redirect to a URL

As part of a UI action, you may want to redirect a user to a URL. For example, you might add links to a form or open a new record after it is created from a UI action.


To redirect a user to a URL from a UI action, use this syntax to define the redirect link:



action.setRedirectURL('http://www.mysite.com/mypage.htm');


To direct a user to a record, use this syntax, where new_record is the variable name for the GlideRecord:



action.setRedirectURL(new_record);


regards'
Kirtesh


Pls mark as correct/helpful/like


sk227
Kilo Explorer

Thanks for the responses !


I have given a button as "view list" but once i select the action it is asking me fill the mandatory fields of the current form.


how to overcome this issue without filling mandatory field.it should take me to the list view.


appreciate your response.