Syntax to pass parameter value to jsp using href in out.println

Hi,
I have the URL in the form as mentioned below:
<a href="b2c/marketing/showDocDetail.jsp"> <%=doc_no%></a>
I've created the hyperlink using href tag to the document number in the jsp using the below syntax.
<% String a1 = "Document ";
       String a2 = "<a href=\"";
       String a3 = "marketing/showDocDetail.jsp\">";
       String a4 = doc_no;
       String a5 = "</a>";
out.println(a1a2a3a4a5);
%>
When clicked the doc_no is passed to backend RFC and export parameter is retrieved to result.jsp where values along with doc_no are displayed.
the value after clicked is not being passed to action.java class that does the retreival.
Needful, backend class, bom, entry in config.xml is all maintained.
Please help me out with the syntax to pass the parameter value into java class

Hi Bharathi,
try below.
<%
       String a1 = "Document ";
       String a2 = "<a href=\"";
       String a3 = "marketing/showDocDetail.do?docNo=";
       String a4 = doc_no;
       String a5 = " \">";
       String a6 = doc_no;
       String a7 = "</a>";
out.println(a1+a2+a3+a4+a5+a6+a7);
%>
I assume doc_no is java variable contains value of document number
Now create action entry in config.xml file. Suppose "actionDoc.java" class process it.
<action path="/marketing/showDocDetail" type="com.xyz.actions.actionDoc">
               <forward name="success" path="/marketing/showDocDetail.jsp"/>
               <forward name="error" path="/marketing/showDocDetail.jsp"/>
</action>
We are passing parameter docNo=doc_no to action class actionDoc.java in this class you can retrieve request parameter docNo from request object and then process it as you want.
Let me know if you face any problem or error.
eCommerce Developer
Edited by: Ecommerce Developer on Nov 9, 2009 8:35 AM

Similar Messages

  • Pass Parameter to second.jsp using "form & action"

    I wrote a JSP Portlet. Like the sample, multipage. But, I need to use <form> to pass the parameter to second.jsp
    The first.jsp include:
    <form name="parameters" method="POST" action="<%= HttpPortletRendererUtil.htmlFormActionLink(request,PortletRendererUtil.PAGE_LINK) + "?" + HttpPortletRendererUtil.portletParameter(request, "next_page") + "=second.jsp" %>" >
    The provider.xml include:
    <pageParameterName>next_page</pageParameterName>
    But, error occur and show as following:
    Wed, 21 Mar 2001 10:20:02 GMT
    No DAD configuration Found
    DAD name:
    PROCEDURE : !null.wwpob_page.show
    URL : http://oraas2:80/pls/null/!null.wwpob_page.show?_pageid=null
    PARAMETERS :
    ===========
    ENVIRONMENT:
    ============
    Do I have to do something with next_page or pageID?
    I have run the first.jsp in the sample that JPDK provided. After each click, the screen will refresh.
    null

    Leo,
    The error you are getting is actually a portal error, you have an incorrect URL.
    http://oraas2:80/pls/null/!null.wwpob_page.show?_pageid=null
    If you notice, after pls, you should have a DAD name such as portal30. Instead you have null. Take a look at your Database access descriptors in Portal and update your URL.
    Sue

  • Passing parameter values to jsp

    hi i have got a slight probelm that my jsp doesnt print out teh value that is being to it from teh wml
    my wml file is:
    <b><big> Subject:</big></b>
                             <input type ="text" name="srch" height="20" format="*X,*x"/>
                             <do type="accept" label="Search">
                             <go href="http://localhost:8080/srch2.jsp" method="post">
                             <postfield name="Subject" value="$srch"/>
    jsp:
    <?xml version="1.0" encoding="utf-8"?>
         <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
              "http://www.wapforum.org/DTD/wml13.dtd">
    <%@ page language="java" contentType="text/vnd.wap.wml"%>
    <wml>
    <card id="srch" title="Search">
         <p>
              <%
                   String Search;
                   Search=(String)request.getParameter("srch");
                   out.println("<br/>Search is"+Search);
              %>
              </p>
         </card>
    the reulst i get is Search isnull, where is the probelm?
    thank you very much

    hi thanks for replying
    my form is here:
    <?xml version="1.0" encoding="utf-8"?>
         <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
              "http://www.wapforum.org/DTD/wml13.dtd">
    <wml>
         <card id="search" title="Search">
                   <p align="left">
                        <fieldset title="subject">
                             <b><big> Subject:</big></b>
                             <input type ="text" name="srch" height="20" format="*X,*x"/>
                             <do type="accept" label="Search">
                             <go href="http://localhost:8080/srch2.jsp" method="post">
                             <postfield name="Subject" value="$srch"/>
                             </go>
                             </do>
                        </fieldset>     
                   </p>
         </card>
    </wml>
    would you be bale to tell what is worng anfd why it doesnt print?
    thank you

  • Passing Parameter  values

    Hi,
    Iam trying to print a crystal report, but it is not prompting me to pass the parameter values.
    i want  user to pass parameter values.
    Iam using VB.Net code to generate the reports.
    Could plz help me
    Thanks
    Ravi

    assuming v_seqprocess_id takes the process_id, I'd probably go with something like:
    cursor sum_cur(p_process_id number) is
    select sum(cheque_amt), sum(balance)
    from   table
    where  process_id = p_process_id;and call the cursor passing v_seqprocess_id into it.
    That's if I had to do extra processing on top of getting the values, etc.
    Otherwise, I'd go with:
    insert into table2
    select sum(cheque_amt), sum(balance)
    from   table
    where  process_id = v_seqprocess_id;Message was edited by:
    Boneist
    Added in the insert version

  • To pass parameter values to the object reference of action step in sequence file of teststand programatically using C#.

    //Initialize the Engine
                EngineClass myEngine = new EngineClass();
                myEngine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
                Step myStep = myEngine.NewStep(AdapterKeyNames.DotNetAdapterKeyname,StepTypes.StepType_Action);
                myStep.Name = "object";
                DotNetModule dotnetmodule = myStep.Module as DotNetModule;
                dotnetmodule.SetAssembly(DotNetModuleAssemblyLocations.DotNetModule_AssemblyLocation_File,@"C:sequence.dll");
                dotnetmodule.ClassName = "CN";
                dotnetmodule.MemberType = DotNetModuleMemberTypes.DotNetMember_GetProperty;
                dotnetmodule.MemberName = "ISI";  
    mySequence.Locals.NewSubProperty("object", PropertyValueTypes.PropValType_Reference, false, "", 0);        
    Sequence mySequence = myEngine.NewSequence();
                mySequence.Locals.NewSubProperty(varName, PropertyValueTypes.PropValType_Reference, false, String.Empty, 0);
    mySequence.InsertStep(myStep, 0, StepGroups.StepGroup_Main);
                SequenceFile seqFile = myEngine.NewSequenceFile();
                seqFile.InsertSequence(mySequence);
    seqFile.Save("C:\\mySeq.seq");
    I have done this,dynamically creating a sequence file in teststand programatically through c#.
    Problem is
    1.I created an action step and object Reference variable for the step, but i am not able to pass  parameter values to the objectReference 
    2.I am not able to load the sequence in to the main Sequence of the sequence file in the teststand. How can I do these two things.

    Hi,
    have you ever followed on my Links ?!?!?
    If not please jump to this one
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26880 
    and read the the answer from Mannoch
    starting with this words:
    Anthony -
    Currently, functionality for retrieving the Metadata Token for a class constructor or member is not fully provided in the TestStand .NET Adapter API. The DotNetModule.GetConstructorMetadataToken() and DotNetModule.GetMetadataToken() methods only return the correct Metadata Token when the member/constructor prototypes have already been loaded. Thus, in the case of your code, when you call DotNetModule.GetMetadataToken(), the method is returning -1 because the member prototype for the Step you are referring to has not yet been loaded.
    That means have to do a workaround for your stuff.
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How to pass parameter to intro.jsp page ?

    Hi all,
    Anybody please tell me how to pass parameter to intro.jsp page.
    Is there any param name defined in <forward > syntax ?
    I have made following configuration in struts-config.xml file.
    I want to pass parameter to intro.jsp page
    <global-forwards>
              <forward name="invalidsession" path="/intro.jsp" redirect="true" />
    </global-forwards>
    please reply soon.
    Thanking you.

    Hi all,
    I have a similar kind of question..
    Iam trying to pass a string variable from JSP to servlet thro URL..
    Im using tomcat5
    COde:
    String fname=request.getParamter("filename");
    <jsp:forward page="/servlet/coreservlets.filedownload?name=" +fname />
    It is generating a unterminated tag error..Please help..

  • Passing JavaScript value to Jsp

    Hi,
    Any idea how to pass a value from javascript to jsp page when the page gets load on browser.
    I use below code but an event is require to pass the value. Is there any code that pass automatically the value from javascript to jsp.
    <html>
    <head>
    <title>Passing Javascript value to Jsp</title>
    <script type="text/javascript" language="javascript">
    var scriptVar = "Noy"
    var WinNetwork = new ActiveXObject("WScript.Network")
    document.write (WinNetwork.username)
    document.index.hiddenTextBox.value = WinNetwork.username
    </script>
    </head>
    <%
    String jspVar = null;
    if(request.getParameter("submit") != null){
         jspVar = request.getParameter("hiddenTextBox");
         out.println("Jsp Var : " + jspVar);
    %>
    <body>
    <form name="index" onSubmit="index.jsp" method="post">
    <input type="hidden" name="hiddenTextBox"><br>
    <input type="submit" name="submit" value="Submit">
    </form>
    </body>
    </html>
    Thanks,
    ~ukbasak

    JSP/Java runs at the server side, produces a HTML page, sends it to the client side and then stops running.
    HTML, containing under each CSS and JS, arrives at the client side and runs at the client side only.
    To invoke JSP/Java using HTML you need to fire a request to the server side. That can be either a plain vanilla <a> link, a <form> to be submitted or an asynchronous Ajaxical request.
    That said, the use of ActiveX in web applications is discouraged. It's a Microsoft IE proprietaty. With other words, it isn't and won't be supported by all alternative browsers which the other half of the world is using.

  • How to Pass Click Value to DB using Java

    How to Pass Click Value to DB using Java and display tat
    clicked value row data in flex
    i have created connection with Sql Server using java and drew
    pie chart from values fetched from XML file created by Java
    wat i need is when i click pie chart region (widget) i should
    display a alert by giving value of particular widget name and Value
    from Database and display in Flex Alert

    Use AddResource to add Javascript in your BackingBean Code and pass the value to your javascript code.
    JSCookMenu and other dynamic adding of javascript to a JSF-JSP page is done using AddResource....

  • Passing JavaScript values to JSP variables

    Can any body correct the follwing code
    <Script language="JavaScript">
    function test( x )
    <%
    int num = x;
    num = num * 2;
    %>
    v.value = "<%out.print(num);%>";
    <input type="button" name="b" value="test" onClick="test(5)">
    <input type="text" name="v" value="0">
    In short, I am trying to pass JavaScript value to JSP variable. I hope that it is possible to do that. If it is possible then how can I do it. I want to assing the variable x passed to the JavaScript function called test to the JSP variable called num.
    Regards,
    Ageel

    Thank you for your reply,,,
    I think then the only way to do it is to post the
    value on the server and then use request.getParameter
    method in jsp code
    but the question now how can I post values to the
    server using JavaScript without reloading the pageyes... you can to it by create a new popup window which will submit the value to server after page was loaded... then, server return a value to the same window in html/jsp page which then using javascript to set it back to the opener and close up the window... however, this is not a good choice unless you have no other alternative...
    >
    There is other possible solution
    if I can get the text field value from the same page
    without reloading it that would work fine and will
    solve my problem, is it possible?yes... you can get the value from the textfield...
    for example :
    function showValueInTextField()
        alert(document.forms[0].elements["mytextfieldname"].value);
    >
    My final question> can jsp change things on the same
    page without reloading it. I mean can it work like
    JavaScript so that I can use it's internal functions
    instead of using java script :S
    not really know what you trying to say here...

  • Passing parameter values to another report using URL actions (reportserver)

    Hi guys,
    I have two reports that I link with eachother. For report A - B everything works perfect. When I try to do the same for report B - A it works, but the parameter value is not filled in.
    =Iif(
    Parameters!PAR_LinksEnabled.Value, 
    Globals!ReportServerUrl & "?" & Replace(Globals!ReportServerUrl, "_vti_bin/ReportServer", "")
    & "Reporting/POS Reporting/Reports/POS Report.rdl&POS_ID=" & Parameters!CONNECTION_ID.Value & "&POS_LANG=" & Parameters!POS_LANG.Value & "&PAR_Date=%5BDate invoice%5D.%5BBonus Calendar - Week%5D.%5BBonus
    week of year%5D.%26%5B" & Left(Parameters!YEAR_WEEK.Label, 4) + "%5D%26%5B" & CInt(Right(Parameters!YEAR_WEEK.Label, 2)) & "%5D",
    Nothing
    Even tho I specify the parameter he has to pass through, the report opens with parameter period : <select a value>. Anyone has an idea why such behaviour happens?
    Thanks!

    Hi Yvanlathem,
    Per my understanding that you want to use the expression above to conditional add the hyperlink to pass the value to the parameter of anpother rreport via the URL in the SharePoint integrated mode report server, right?
    I have check the expression you have provided and the issue can be caused by the wrong way you have write the expression to pass the parameter, please check detais information below to make sure you have pass parameter in the URL correctly:
    Please modify the expression to below structure :
     =Iif( Parameters!PAR_LinksEnabled.Value="Enabled", "URL",Nothing)
    I saw you have use expression like "&POS_ID=" & Parameters!CONNECTION_ID.Value & "" which is incorrect, we need to set a report parameter within a URL, use the following syntax:
     parameter=value(not Value=Parameter)
    If you are using the following syntax like "Parameter1=Parameter2", both parameters and from different report, if you have add the "Go to URL" action from  report2 to Report1, please make sure Parameter1 is from the Report1
    and Parameter2 is from Report2, change the order will not work
    More detail information:
    Pass a Report Parameter Within a URL
    So, In your scenario, please make sure the value is from one report's field (POS_ID) and the the parameter(CONNECTION_ID) is from another report (e.g:"&CONNECTION_ID=" &Fields!POS_ID.Value &"")
    Similar thread for your reference:
    SSRS 2012 Drill Through report cascading Parameters not refreshing
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Passing CURR value to screen using PARAMETER ID's

    Hi all,
    I need to pass a value which is of type CURR to a screen field which is of type DEC using parameter id. As of release 6.10 only character-type field is expected to pass to screen fileds. I tried converting the CURR field to char type and pass the same to screen field,but didnt work as in the screen filed it expects some value with typr DEC.
    Thanks in advance!

    Hi Rob,
    while debugging the code i can see the values of pid in SAP memory, but when i run the program to display those values on the screen field with type DEC,it kicks me out of the system.I commented that part of code and exceuted the program and then it went fine so i am for sure that it goes wrong at this part of the code.
    Regards,
    Sireesha
    Edited by: Sireesha on Sep 24, 2010 11:37 AM

  • How to pass parameter between two jsp pages using web link (not form)

    Hi Friends,
    I have two jsp pages and would like to pass a parameter from one JSP page (one.jsp) to another JPS page (two.jsp)
    in one.jsp
    <a href="two.jsp?ant="<%=ant%">"> <%=antName%> </a><br>
    I don't know how to pass value of parameter "ant" to two.jsp from one.jsp.
    Can anyone help this? Thank you in advance</a>

    Looks like you've got it almost right - just an extra unneeded "
    <a href="two.jsp"?ant=<%= ant %>"><%=antName%></a>
    which should render on the page as something like
    My Ant Task
    When you click the link, it should pass that parameter, and you can get it via request.getParameter().

  • Passing parameter value to embedded content.

    hi
    i am designing a dash board in which i pass a value (say id) from before screen. and in the next screen i displayed the value using narrative view.. now in the next section i have to embed a JSP page by passing that id as a parameter.....
    how to achieve this...........
    thanks
    Bala.

    Post Author: SKodidine
    CA Forum: Formula
    If you want to print the dates then you do not need variables, just create a formula with the following and place the formula in the report:
    "Date Range: " & minimum({?date range parameter}) & " to " & maximum({?date range parameter});

  • Passing Multiple values from jsp to servlet

    Dear all,
    I am trying to do a very simple thing. I need to pass names of all products that have been added to the cart.
    Below is my jsp. Basically I am trying to make something very basic using ajax, and later actually build it.
    heres my code with 2 questions... all I need to do is to pass the names of the products.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM Software Development Platform">
    <TITLE>ShowCart.jsp</TITLE>
    </HEAD>
    <script>
    xhr = null
    var flag = false;
    var amount = 0;
    function getData(url,divid,prodName){
              var as = "added"+divid // this is the divid
              if (document.getElementById(as)!=null)
                   document.getElementById(as).innerHTML ="adding"
           if (window.XMLHttpRequest){
             xhr=new XMLHttpRequest()
           else if (window.ActiveXObject){
             xhr=new ActiveXObject("Microsoft.XMLHTTP")
           if (xhr){
              xhr.onreadystatechange=callback       
             xhr.open("GET",url,true)
             xhr.send(null)
             setDivid(as);
             updateCart(divid,prodName);
           else{
             alert("XMLHTTP not supported")
    function setDivid(as){
    if(flag){
         document.getElementById(as     ).style.backgroundColor = "RED";
            document.getElementById(as).innerHTML = "item added";
    function updateCart(divid,prodName){
    amount += divid;
    document.getElementById("amount").innerHTML = "price is "+amount;
    udpateSubmitData(prodName);
    function updateSubmitData(prodName){
    var = document.getElementById("Hidden"+prodName).value;
    //do I need to do something here to submit the data ? ------------------1
    function callback(dd){
           // when finished
           if (xhr.readyState==4){
                  //  OK
                  if (xhr.status==200){
                 // process the result.
                  flag = true;
           else{
                  alert("error")
    </script>
    <BODY>
    <P>Place content here.</P>
    The products are :
    <%
    if(request.getAttribute("Products")!= null){
    java.util.ArrayList list = new java.util.ArrayList();
    list = (java.util.ArrayList)request.getAttribute("Products");
    for(int i=0; i<list.size(); i++){
    com.deere.sc.bean.ProductBean pb1 = new com.deere.sc.bean.ProductBean();
    pb1 = (com.deere.sc.bean.ProductBean)list.get(i);;
    %>
    <table>
    <td>
    <% out.println(pb1.getProductName());
         out.println(pb1.getProductPrice());
         %> <td> <div id="added<%= i %>"> </div> </td>
    <td>     <a href = "javaScript:getData('/SC/AddToCart?name=<%= pb1.getProductName() %>',<%= i %>,<%= pb1.getProductName() %>);"> add to cart</a>  </td>
         <input type="hidden" id="Hidden<%= pb1.getProductName() %>" value ="<%= pb1.getProductName() %>">
         </td>
         <%
    }//end for
    }//end if
    %>
    </table>
    Thank you for shopping at the looters .. heh ;)
    Total amount of money in your cart is <div id ="amount"> </div>
         <a href = "/SC/CheckOut">Check out cart</a>
    <!-- OR may be just add Hidden tags here ?  ______________________2 -->
    </BODY>
    </HTML>Any help on tips for proceeding from here will be helpful.
    thanks in advance

    Dear all,
    I am trying to do a very simple thing. I need to pass names of all products that have been added to the cart.
    Below is my jsp. Basically I am trying to make something very basic using ajax, and later actually build it.
    heres my code with 2 questions... all I need to do is to pass the names of the products.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM Software Development Platform">
    <TITLE>ShowCart.jsp</TITLE>
    </HEAD>
    <script>
    xhr = null
    var flag = false;
    var amount = 0;
    function getData(url,divid,prodName){
              var as = "added"+divid // this is the divid
              if (document.getElementById(as)!=null)
                   document.getElementById(as).innerHTML ="adding"
           if (window.XMLHttpRequest){
             xhr=new XMLHttpRequest()
           else if (window.ActiveXObject){
             xhr=new ActiveXObject("Microsoft.XMLHTTP")
           if (xhr){
              xhr.onreadystatechange=callback       
             xhr.open("GET",url,true)
             xhr.send(null)
             setDivid(as);
             updateCart(divid,prodName);
           else{
             alert("XMLHTTP not supported")
    function setDivid(as){
    if(flag){
         document.getElementById(as     ).style.backgroundColor = "RED";
            document.getElementById(as).innerHTML = "item added";
    function updateCart(divid,prodName){
    amount += divid;
    document.getElementById("amount").innerHTML = "price is "+amount;
    udpateSubmitData(prodName);
    function updateSubmitData(prodName){
    var = document.getElementById("Hidden"+prodName).value;
    //do I need to do something here to submit the data ? ------------------1
    function callback(dd){
           // when finished
           if (xhr.readyState==4){
                  //  OK
                  if (xhr.status==200){
                 // process the result.
                  flag = true;
           else{
                  alert("error")
    </script>
    <BODY>
    <P>Place content here.</P>
    The products are :
    <%
    if(request.getAttribute("Products")!= null){
    java.util.ArrayList list = new java.util.ArrayList();
    list = (java.util.ArrayList)request.getAttribute("Products");
    for(int i=0; i<list.size(); i++){
    com.deere.sc.bean.ProductBean pb1 = new com.deere.sc.bean.ProductBean();
    pb1 = (com.deere.sc.bean.ProductBean)list.get(i);;
    %>
    <table>
    <td>
    <% out.println(pb1.getProductName());
         out.println(pb1.getProductPrice());
         %> <td> <div id="added<%= i %>"> </div> </td>
    <td>     <a href = "javaScript:getData('/SC/AddToCart?name=<%= pb1.getProductName() %>',<%= i %>,<%= pb1.getProductName() %>);"> add to cart</a>  </td>
         <input type="hidden" id="Hidden<%= pb1.getProductName() %>" value ="<%= pb1.getProductName() %>">
         </td>
         <%
    }//end for
    }//end if
    %>
    </table>
    Thank you for shopping at the looters .. heh ;)
    Total amount of money in your cart is <div id ="amount"> </div>
         <a href = "/SC/CheckOut">Check out cart</a>
    <!-- OR may be just add Hidden tags here ?  ______________________2 -->
    </BODY>
    </HTML>Any help on tips for proceeding from here will be helpful.
    thanks in advance

  • Passing parameter values to powershell function from batch file

    Hello ,
       I haven't used powershell for a while and getting back to using it. I have a function and I want to figure out how to pass the parameter values to the function through batch file.
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    <#
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_011.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    #>
    The above code seems to be work when I call it. But when I try to call that script and try to pass the parameter values, I am doing something wrong but can't figure out what.
    powershell.exe -command " &{"C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"}"
    Write-Host "ReturnCode : $returncode"
    $file = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    powershell.exe -file "C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile $datafile
    Somehow the I can't get the datafile parameter value being passed to the function. Your help would be much appreciated.
    I90Runner

    I am not sure about calling a function in a script like how you want to. Also I see you are setting the values of the parameters, this is not needed unless you want default values if nothing is passed. The values for the parameters will be passed via the
    batch file. So for me the easiest way is as indicated.
    param
    [string]$DataFile
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    Write-Host "Return Code: $(Check-FileExists $DataFile)"
    Then you create a batch file that has
    start powershell.exe
    -ExecutionPolicy
    RemoteSigned -Command
    "& {<PathToScript>\MyScript.ps1 -DataFile 'C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile.txt'}"
    Double click the batch file, and it should open a powershell console, load your script and pass it the path specified, which then the script runs it and gives you your output
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

Maybe you are looking for

  • Interface not found in Recevier Determination

    Hi, I am trying find out why I cannot see the interface i created in the IR in ID.  The sceanio is IDOC via HTTP to XI to R/3. 2 Comm channels are setup, 1) HTTP sender for business service and 2) an IDoc recvier for the R3 system. The repository pro

  • Mod-osso agents session expiry - Query

    Hi, My setup details: 1) I have a OHS server configured with mod-osso agent. 2) There is a OAM server which has the profile created for this mod-osso agent.In the OAMConsole I set the 'SESSION LIFETIME'(under common settings) to 2min. 3) When I try t

  • Software won't inst

    Argh! Help! Having major problems trying to install my soundcard, I have a Audigy Platinum EX running Windows XP media 2005. Soundcard model SB0090. The drivers are installed can hear sound but when i try to install the software i get (Setup could no

  • Would like option 'Warn me when web sites try to redirect or reload a page'.

    I switched to Firefox from IE on my Samsung Galaxy note 4 - I read that firefox could help with this problem. Facebook is automatically refreshing. Need it to stop. Thanks.

  • CAF service...

    Hi All, How can I find the ABAP code (RFC)for the below scenerio ? First, when I submit some details from NWDS view..... It will store in a CAF service..... When I want to view, all the data will be retireved from the CAF service. Above is the basic