Use the GenerateComponentPortalURL, as follows
URL = GenerateComponentPortalURL(%Portal, %Node, MenuName.NAME MENU, %Market, Component.COMP NAME, Page.PAGE NAME, "U");
Yes, i use this method. What i need to do is change the URL of %portal. I change it in url text of local node. But it does not take effect.
Can you explain more what you do exactly, because GenerateComponentPortalURL will always create an URL based on your current environment:
Use the GenerateComponentPortalURL function to create a URL string that represents an absolute reference to the specified component for the portal servlet. The PortalURI of the node that hosts the specified portal is used in the generated URL. The URL contains a reference to the portal service (psp) servlet.
I imagine you do something with Find and Replace after you generate the URL, but please elaborate more on what you try to do.
I want to replace the url with the one generated from GenerateComponentPortalURL method. Basiclly , it should be the url text of local node. But i changed it and the url does not change.
That's because the node is not what you are trying to change.
You have this (bold is of interest):
And you changed this (bold):
http://Portal URI of host node/portal/node/c/menu.component.market?parameters
So essentially you changed HRMS. You want to change a part of the Portal URI which is automaticly taken from the function GenerateComponentPortalURL when you call it. After that you need to find the starting position of DEV in your URL string with Find and then use Replace to change it to TST.
Thanks for the quick response, John.
You mean i need to change it by peoplecode ??
I traced the GenerateComponentPortalURL and found te protal is EMPLOYEE and node is HRMS. What i change is the url text on the HRMS node.
What did you change exactly?
I would do something like this:
Local string &URL, &output;/* Rest of code sending e-mail etc */
&URL = GenerateComponentPortalURL(%Portal, %Node, MenuName.NAME MENU, %Market, Component.COMP NAME, Page.PAGE NAME, "U");
&output = Replace(&URL, Find("DEV", &URL), 3, "TST");
i changed the portal url text of the local node definition.
The approach you suggested is the bottom option we have.