CodeActivity, how to Get the OrganizationService URL?

Hello,
I'm developing a CodeActivity and I need to know which environment I'm using. To acomplish this task I need to know what is the Server URL that the IOrganizationService is using. Do you know how to do this in a CodeActivity?, is the URL in some place inside
the CodeActivityContext?, this is my code:
protected override void Execute(CodeActivityContext executionContext)
try
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();//String orgURL = ...
Just Programming

function () {
///<summary>/// Returns the URL for the SOAP endpoint using the context information available in the form/// or HTML Web resource.///</summary>var OrgServicePath = "/XRMServices/2011/Organization.svc/web";
var serverUrl = "";
if (typeof GetGlobalContext == "function") {
var context = GetGlobalContext();
serverUrl = context.getServerUrl();
else {
if (typeof Xrm.Page.context == "object") {
serverUrl = Xrm.Page.context.getServerUrl();
else
{ thrownew Error("Unable to access the server URL"); }
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
return serverUrl + OrgServicePath;
Theres a SDK function that grabs the URL ...not sure if it can be called in that context but figured i'd throw it out there just in case.

Similar Messages

  • How to get the customize url of an portlet using PLSQL

    How to get the customize url of an portlet using PLSQL.

    Are you trying to call the portlet Customization form directly from the browser?

  • How to get the current URL in UIX

    I've tried:
    ${pageContext.request.requestedURL}
    ${uix.bajaContex.servletRquest.requestURL} (works but returns .uix, I want .do links)
    They didn't work.
    Thanks,
    Eduardo

    Eduardo,
    I guess that this has to do with the way that Struts and UIX controllers work together. My assumption is that though you see .do in teh URL, its actually .uix that is processed at last.
    Can't you get the request URL from the findForward method in the Struts DataAction ?
    Frank

  • How to get the server URL?

    I am running WLS server on my machine to host a web app in ADF. How can I get the server name in my manged bean. I dont want to hardcode. The URL is something like this
    http://<my-machine-name>:<port>/epmos/faces/myapp/MyPage.jspx
    How can I retrieve the part
    http://<my-machine-name>:<port>

    In JSFUtils there is a getPageURL method. it will give the whole URL of your page. you can play with the URL string to get the part you need.
       * Method to create a redirect URL. The assumption is that the JSF servlet mapping is
       * "faces", which is the default
       * @param view the JSP or JSPX page to redirect to
       * @return a URL to redirect to
      public static String getPageURL(String view)
        FacesContext facesContext = getFacesContext();
        ExternalContext externalContext = facesContext.getExternalContext();
        String url =
          ((HttpServletRequest) externalContext.getRequest()).getRequestURL().toString();
        StringBuffer newUrlBuffer = new StringBuffer();
        newUrlBuffer.append(url.substring(0, url.lastIndexOf("faces/")));
        newUrlBuffer.append("faces");
        String targetPageUrl = view.startsWith("/")? view: "/" + view;
        newUrlBuffer.append(targetPageUrl);
        return newUrlBuffer.toString();
      }

  • How to get the base url

    Hi,
    when configure the BPM, we set the base url (http://host:port/), which will be used in the default notification sent by bpm.
    now we want to include that url in our notification step. is there a way to get that url?
    Best regards,
    John

    Hi John,
    Would you please share the solution you found for this problem, maybe the EJB source codes or something like that? It would really help the ones like me who have the same problem and looking for a solution.
    Thanks in advance...
    Best regards,
    Utku.

  • How to get the page url

    Hi,
    I have a form and a dynamic page for displaying error. If error occurs I want to go to the dynamic page , display the error and go back to the previous page with same session. I want the url to go back to the previous page with session.
    Thanks,
    Sumita

    Hi,
    You can try using this
    wwa_app_module.set_target('<portalschema>.dynamic_page.show?p_redirect_url=<portalschema>.wwa_app_module.show?p_sessionid=','CALL');
    Thanks,
    Sharmila

  • How to get the Real Path of a file which is accessed  by URL?

    iam using tomcat6.0.
    I have a file xyz.xml at the top of the webapplication HFUSE which i can able to access by URL
    http://localhost:8080/HFUSE/xyz.xml
    My problem is how to get the realpath of the file "xyz.xml" for reading and writing purposes.
    I tried various things but i could not able to successfully solved the problem?
    1) File f = new File("/xyz.xml");
    print(f.getAbsolutePath()) ============== it is not fetching the file @ http://localhost:8080/HFUSE/xyz.xml rather it is creating a file
    at the root of the drive where eclipse is running.
    2) File f = new File("xyz.xml");============> this is also not working , it is creating the file xyz.xml in the eclipse directory ..................
    Can anyone please guide on this problem?

    RevertInIslam wrote:
    If you want your context root(i.e HFUSE)
    use this:
    request.getContextPath() //where request is HttpServletRequest object to get the needful path.
    e.g:
    File f = new File(request.getContextPath()+"/xyz.xml");//it will create the file inside HFUSE.
    Hope this helps.
    Regards
    BWrong. The File constructor expects an absolute filesystem path. The HttpServletRequest#getContextPath() doesn't return the absolute filesystem path, it only returns the relative path from the current context root. Use ServletContext#getRealPath() instead, it returns the absolute filesystem path for the given relative path from the current context root.
    File file = new File(servletContext.getRealPath("/"), "xyz.xml");

  • How to get the current page URL

    HI All
    I am working in oracle apps 4.0
    I have one page called history in that i have one page item called Application url. My application id is 122 but its a copy of application 106
    How to get the current page url for the page item.
    Any steps should be help ful
    Thanks & Regards
    Srikkanth.M

    I'm not 100% clear on what the requirement is from the description, however it does sound like you are making things unnecessarily complicated.
    If you want permanent/ID-independent links then use application and page aliases.
    so here we used to display the url like this: <tt>{noformat}http://81.131.254.171:8080/apex/f?p=122{noformat}</tt>
    Do you mean that the URL is displayed like that? If so that doesn't seem particularly helpful. How is anyone supposed to know what it is?
    There are many ways to provide links in APEX&mdash;including lists and nav bars.
    Where the link is to another resource located on the same server (such as another page in the same app, or a different app in the workspace), relative addressing can be used, making it unecessary to include scheme, domain and port information in the URL. For example, if the page to be linked to has a page alias <tt>ABOUT</tt> in an application with alias <tt>UNITY</tt>, and the apps share an authentication scheme/cookie to permit shared sessions, then the link URL is simply
    f?p=UNITY:ABOUT:&APP_SESSION.

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How can I get the whole URL to my BSP Controller

    Hi,
    I need to build up a html-link with my bsp-url. How can I get the whole url to a specific controller, but without the session-id (sap(id))?
    I need something like the following:
    http://server:port/sap/bc/bsp/sap/<application>/<controller>.do
    Thank You!

    Hi Arne,
    you can create the URL with the method:
    CALL METHOD cl_bsp_runtime=>if_bsp_runtime~construct_bsp_url
       EXPORTING
          in_application_ns = ...
          in_application    = ...
          in_page           = ...
          in_parameters     = ...
        IMPORTING
          out_abs_url    = ....
    Regards,
    Rainer

  • How can I don't get the gatewayed url?

    I integrated a customized application into my portal.
    but ,portal always generates gatewayed url,
    for example
    http://demo:80/portal/server.pt/gateway/PTARGS_0_200_359_207_0_43/http%3B/demo%3B80/tpl/abc/totalReport.do?method=drawPieChart&type=16
    I only want to get the true url,that is
    http:/demo:80/tpl/abc/totalReport.do?method=drawPieChart&type=16
    How can I set the portal not to gateway the url?
    thanks for any ideas.

    Adjust the webservice that you are using so that it doesn't gateway that URL.
    This is set on the HTTP Configuration page of a webservice.
    It would appear that your is set to something like:
    http://demo:80/portal/server.pt/(perhaps more path here/).
    so just remove that

  • On my iPad, when I try to open a movie I purchased from iTunes, I get "The requested URL was not found on this server."

    On my iPad, when I try to open a movie I purchased from iTunes, I get "The requested URL was not found on this server."  It's on my laptop but when I play it there, it 'jerks' every couple of seconds.  How can I fix both these issues?  Thanks!!

    Select the content which is causing a problem and use the 'Report a problem' button in Your Purchase History on your computer.

  • Not able to get the complete URL in mail content

    Hi All,
    I want to give the below link in mail which is sent from workflow, so on click of it, the user will be able to open the particular opportunity directly.
    https://<sys_host>%3Fcrm-object-type%3DBT111_OPPT%26crm-object-action%3DB%26crm-object-keyname%3DGUID%26crm-object-value%3DXXXXXXXXXXXX
    XXXXX here is GUID of the Opportunity of 32 character.
    For this, I have created a attribute of type BAPITGB-LINE. When inserting this expression into the mail activity of the WF, I have chosen the data to be exported as "All lines as cont. text".
    In this attribute, when I concatenate the values and the guid, I get only part of the link as below which is 133 characters.
    https://<sys_host>%3fcrm-object-type%3dbt111_oppt%26crm-object-action%3db%26crm-object-keyname%3dguid%26cr
    When I try to append it in a internal table of type BAPITGB, I am getting the complete URL but with a space between every line in the internal table as below.
    https://<sys_host>%3Fcrm-object-type%3DBT111_OPPT[SPACE]%26crm-object-action%3DB[SPACE]
    %26crm-object-keyname%3DGUID[SPACE]%26crm-object-value%3D
    DFD60A8AD0E53DF1918F0050569F0324
    Please let me know, how to avoid this space in append statements. Also, the concatenate is taking only 132 characters, after which it cuts the URL, leaving it incomplete.Kindly correct me if I was wrong somewhere.
    Thanks,
    Ramya
    Edited by: Gali Kling Schneider on Jul 11, 2011 9:47 AM

    Hi Sanjay,
    As suggested, I have split the URL into 3 links in WF container having the initial values as below.
    Link1 -> <sys_host>.%3Fcrm-object-type%3DBT111_OPPT
    Link2 -> %26crm-object-action%3DB %26crm-object-keyname%3DGUID
    Link3 -> %26crm-object-value%3D
    In the mail activity, I have given the link as: &LINK1&&LINK2&&LINK3&&GUID&
    &GUID&-> GUID of the opportunity.
    When I tested this in log-> List with technical details-> mail, it had the correct value without space as below.
    https://<sys_host>.%3Fcrm-object
    -type%3DBT111_OPPT%26crm-object-action%3DB
    %26crm-object-keyname%3DGUID%26crm-object-value%3DDFD60A8AD0E53DF1918F00505
    69F0324
    But in SOST, when I checked for the link it is having spaces as below:
    https://<sys_host>%20%3Fcrm-object-type%3DBT111_OPPT%20%26crm-object-action%3DB%26crm-object-keyname%3DGUID%20%26crm-object-value%3D%20DFD60A8AD0E53DF1918F0050569F0324
    Kindly advice.
    Thanks,
    Ramya
    Edited by: Gali Kling Schneider on Jul 11, 2011 9:48 AM

  • How to get the device token in windows phone 8 sliverlight application?

    Hi,
    I am developing a windows phone 8 silverlight application . For my application I want to add push notification service , for this service I have to call one web service in my app . This api requires device token , device id ..etc , I am able to get the all
    the things except devicetoken .
    How to get the device token of a device ?
    any help?
    Thanks...
    Suresh.M

    Most probably device token is the push channel url which is returned by MPNS when a request is made to it.
    Step 3 here: Push notifications for Windows Phone 8
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • How to get the location of a jarfile in the java 1.6 cache

    In 1.5 i am using getResource() to get the location of the jarfile i need, but in 1.6 this does not work anymore. I found a webpage with a workaround for this, but unfortunately i did not bookmark it and i can't find it again. Does anybody know how to get a file url instead of an http url to the jar file?
    I need the location to this jarfile. There is no other workaround and please DO NOT respond and tell me, that i don't need the location in the cache! I read all threads on the java forums to this issue and i didn't find a good answer.

    java.io.File class can be used.
    File f = new File("filename");
    S.O.P(f.canRead());
    S.O.P(f.canWrite());You can set the attribute using Runtime class.
    Runtime r = Runtime.getRuntime();
    Process p =r.exec("attrib -r file");If you are working with unix,
    r.exec("chmod -permissionoptions file");

Maybe you are looking for

  • OfficeJet Pro L7680 not printing the colour red: it comes out as brown

    Running Windows XP. OfficeJet Pro L7680. Using HP inks + quality paper. Model number CB038a The colour red is printed as a distinct brown. All other colours/shades/tints/alignments etc are absolutely fine. Have done the obvious: changed cartridges fo

  • Method for storing a session id that works on all browsers

    How do I store a simple text session id on the browser, and makes sure it works on all browsers? Cokies can be turned off, and it does not work on WAP phones at all. URL-rewrinting is souch a clumpsy method, I think. Is it possible to make my own HTT

  • Changing colour settings on Qosmio X500/02G

    How do I change the colour settings on my X500/02G running Windows Home? At present the colours are way too bright and saturated - similar to the way tvs are set up in stores. I've changed the brightness to no effect. I've checked the NVIDIA software

  • Installing  Reader and Flash Player

    I am trying to install Reader and Flash Player on my Mac but it asks for a password, but it rejects both my Adobe password and my Apple password.  How do I install these products?

  • ITunes 10.7.0.21 choppy audio playback

    After upgrading my Windows 7 PC to iTunes 10.7.0.21, the audio is incredibly choppy. I cannot do anything else on my computer without the sound going haywire. It only plays smoothly if iTunes is constantly on top. I can't even simply type a web addre