Reputation: 63
I have a Master Detial with 2 interactive grids. I would like to be able to genrate a link based on user input....is that at all possible? To give a simple example: Lets say I have website like https://www.google.com/ I would like a user to enter anything...for example "Prague" Once this is entered, I would like APEX to generate a URL from it to result in: https://www.google.com/Prague
Now I know that Google search does not work like that, but I need that sort of mechanism for our internal company app. Is this possible? Ideally , once the grid is saved the link in the Interactive grid only said "Prague" but if I click it, it would direct me to https://www.google.com/Prague
Upvotes: 1
Views: 1049
Reputation: 18640
This can be achieved using the "JavaScript Initialization Code" attribute of the column. Example on the EMP sample table (*). Functionality is that when a user enters a value in the ENAME column, it is converted to a google search url.
EMP
function(config) {
config.defaultGridColumnOptions = {
cellTemplate: '<a href="https://www.google.com/search?q=&ENAME." target="_blank">&ENAME.</a>'
};
return config;
}
Notice that the column now is a link. A user will have to open in new window to get the actual link value, since clicking the column will active the edit mode.
(*) Sample dataset can be installed using SQL Workshop > UTILITIES > Sample Data Sets > EMP/DEPT
Upvotes: 2
Reputation: 2105
yes, you can let user enter the value and by creating a dynamic action(choose the when attribute as whatever suits you) you can take that value and on another column, use that column as &Columnvalue. for example and concatanate it by using to base url using ||
Upvotes: 0