You need to sign in to do that
Don't have an account?
jucuzoglu
How do I pass a static URL to a class property?
I have the following Class
public class linkListItem { public string title {get;set;} public url value {get;set;} public linkListItem(string gsTitle, url gsValue) { title = gsTitle; value = gsValue; } }
And I want to create a list of this new linkListItem and add elements to the list. Passing the string in the constructor is easy, but I can't figure out how to pass the URL.
I'm using code similar to:
mylinkListItemList.add(new linkListItem('My Link Title','/apex/somepage?id=' + myObj.Id);
The problem is it sees the constructor as (String),(String) rather than (String), (Url).
How do I pass the second part as a URL?
I believe that all URLs are strings, maybe this will work for you