cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in opening an URL from UI

Former Member
0 Kudos

Hi Experts,

When clicking button in an assignment block of campaign screen, it should open an URL (SRM screen) in new window.

I have written the following code in htm page inside script tag.

window.open("lv_url").focus();

lv_url is obtained from the eventhandler onclick.

First time, when I click on the button, the URL is opened in the new window successfully. If I close that window (SRM screen),

and click on the button again, it is executing the code window.open but not opening a new window. Please help.

Thanks,

Ramya

Accepted Solutions (1)

Accepted Solutions (1)

former_member192716
Contributor
0 Kudos

Hi Ramya,

The problem is with the window handler. That is the window handler doesnt terminate even when you manually close the new window and so when attempting to open a same url it doesnt show up.

One solution is to generate a guid and pass it with the url so that the url will differ (since the guid differes the url will not be the same). Check the below sample code,


<%
CALL FUNCTION 'GUID_CREATE'
   IMPORTING
     EV_GUID_32       = lv_guid.

  CONCATENATE 'guid=' lv_guid INTO lv_query.

  CALL METHOD cl_crm_web_utility=>create_url
    EXPORTING
      iv_path                     = lc_path
      iv_query                   = lv_query
      iv_absolute               = lc_flag
      iv_in_same_session = lc_flag
      iv_server_object      = server
      iv_no_cookie            = 'X'
    RECEIVING
      ev_url                       = lv_url.
%>  

<scirpt language="javascirpt">
     window.open(' <%= lv_url %> ');
     window.close();
</script>

Regards,

Arun

Former Member
0 Kudos

Thanks Arun. It worked.

Regards,

Ramya

Answers (0)