Difference between action.setRedirectURL() vs. gs.setRedirect()?

geoffcox
Giga Guru

Is there any significant difference between these two calls?

 

action.setRedirectURL(url);

vs.

gs.setRedirect(url);

3 REPLIES 3

geoff3
Giga Expert

I think action.setRedirectURL() is used in UI Actions, and gs.setRedirect() is used in Business Rules. Other than that, they look like they do the same thing.


action.setRedirectURL() works in my business rule....



Can you confirm anything else that you said?



This is in curiosity to my thread that I've posted here:


Redirect to current after submission


salemsap
Tera Expert

As per wiki,
gs.setRedirect(url);
        Sets the redirect URI for this transaction. This determines the next page the user will see.
action.setRedirectURL(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);


I think,no difference in this two except the difference which Sage mentioned above.