Reading form data using javascript

Hello.
I want to go over the data received from the context to the PDF file using JavaScript, without binding it to any elements on the form.
How can I access the data?
I've tried using xfa.data or xfa.dataset, but didn't manage to get to it.
How can it be done?
Thanks.

The following applies if it's a PDF generated from ABAP :
Let's say a simple type parameter from context is named EBELN. To get it from javascript, you must use :
$data.data.EBELN.value
or
$record.EBELN.value
(it's the same)
For example, to display the value, use:
xfa.host.messageBox( $data.data.EBELN.value );
Edited by: Sandra Rossi on Jan 28, 2009 7:34 PM : added $record line

Similar Messages

  • Error in reading form data

    Hi,
    I have a workflow task to insert records into a table. On execution, i get the following error message "Erro in reading form data"
    Could anyone tell me why this is so?
    Thanks,
    Prasy

    Hi,
    I'm using BUS7051 and created a copy of it to include a method createrecord. This method uses function module as template. Function mudle has notification number as import parameter.
    BEGIN_METHOD ZMCREATEVERECORDS CHANGING CONTAINER.
    DATA:
          NOTIFNO TYPE VIQMEL-QMNUM.
      SWC_GET_ELEMENT CONTAINER 'NotifNo' NOTIFNO.
      CALL FUNCTION 'Z_M_CREATE_VE_RECORDS'
        EXPORTING
          NOTIF_NO = NOTIFNO
        EXCEPTIONS
          OTHERS = 01.
      CASE SY-SUBRC.
        WHEN 0.            " OK
        WHEN OTHERS.       " to be implemented
      ENDCASE.
    END_METHOD.

  • How to compare dates using javascript?

    Hi,
    I have to compare dates using javascript. The dates are in format "mm/dd/yy" for eg "10/09/06".
    I have written a script to compare the dates but the problem I 'm facing is with the year.
    For example if I compare "10/09/06" with "10/04/98", then "10/04/98" is coming out to be greater than "10/09/06" because it is considering year "98" to be greater than "06".
    Please advice/suggest.
    Thanks in advance...

    Dude, you're here in a Java forum, not in a Javascript forum. Those are two entirely different languages.
    The answer in Java is to use java.text.SimpleDateFormat to convert String to Date and use java.util.Date and/or java.util.Calendar to compare dates.

  • Can't read form data from newer version

    I can't read form data I filled in with older version of reader after I upgraded to a newer version reader. please help. thank you.

    On Sun, 16 Apr 2006 11:45:51 +0000 (UTC), "Pedro_3"
    <[email protected]> wrote:
    > <form method="post"
    action="mailto:[email protected]">
    See
    http://apptools.com/rants/mailto.php
    Gary

  • How reset Acrobat form field using javascript API

    How reset Acrobat form field using javascript API

    There are several ways:
    resetForm(["Text1"]);
    or
    getField("Text1").value = getField("Text1").defaultValue;
    George

  • Adobe Reader Submit Button using JavaScript

    We have a form that when submitted it needs to use javascript to update the Subject Line of the email message for our workflow process. This process works absolutely great when using Acrobat. However, when sent to someone using Reader (even with JavaScript enabled through preferences) nothing happens when the button is clicked. The form was designed in Acrobat 10 Professional.
    Here is the JavaScript we are using...
    var wsuid = this.getField ("mywsuid");
    var d = new Date();
    var month = d.getMonth()+1;
    var day = d.getDate();
    var year = d.getFullYear();
    var today = ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + '/' + day +  year;
    var name = this.getField("name");
    var subject = "subject: " + (wsuid.valueAsString) + ":" + (name.valueAsString) + ":" + (today);
    this.mailDoc({
        bUI: true,
        cTo: "[email protected]",
        cCc: "",
        cSubject: subject,
    Suggestions on getting this to work with Acrobat Reader is much appreciated.
    Dawn Bleuel
    Wichita State University

    I was able to open the JavaScript debugger in Acrobat Pro. When the document is Reader Enabled, I get the following message:
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    NotAllowedError: Security settings prevent access to this property or method.
    Doc.subject:15:Field Submit:Mouse Up
    And in Acrobat Pro - I now see Protected View is set to Off.

  • Multipart/form-data using HTTPService, sending a binary file and some text in the same request.

    Hi There,
             I am new to FLEX and also new to writing a client for a web service.
    My question is more about flex (Flash builder 4.5) APIs, what APIs to use.
    I want to access a web service, that's published here.
    https://build.phonegap.com/docs/write_api
    here is the description of webservice
    ===========
    1) I have to do a post on POST https://build.phonegap.com/api/v1/apps
    2) content type has to be "multipart/form-data"
    3) JSON bodies of requests are expected to have the name 'data'
      data will be someting like this
    'data={"title":"API V1 App","package":"com.alunny.apiv1","version":"0.1.0","create_method":"file"}'
    4) include a zip file in the multipart body of your post, with the parameter name 'file'.
    ===========
    I want to make a 'multipart/form-data' Post and send
    one string and one zip file.
    My first question to self was If i send both string + binary data in the body ...
    how will server understand where string end and where zip file starts?
    Then read on W3.org( http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 )
    How is text + binary data can be sent through "multipart/form-data" post requst.
    there has to be some boundries.
    After this I read and example in flex and  tried following it.
    http://codeio.wordpress.com/2010/04/03/5-minutes-on-adobe-flex-mimic-file-upload-for-in-me mory-contents/
    but it doesn't seems to be working for me.
                        public function createNewApp(cb:Function , appFile : File):void
                                  var service:HTTPService = new HTTPService();
                                  service.url = ROOT+"apps";
                                  service.showBusyCursor = true;
                                  service.addEventListener(ResultEvent.RESULT, function(e:ResultEvent):void {
                                            //translate JSON
                                            trace(e.result);
                                            var result:String = e.result.toString();
                                            var data:Object = JSON.parse(result);
                                            cb(data.link);
                                  service.addEventListener(FaultEvent.FAULT, defaultFaultHandler); //todo : allow user to add his own as well
                                  authAndUploadNewApp(service,appFile);
                        private function authAndUploadNewApp(service:HTTPService,appFile : File):void {
                                  var encoder:Base64Encoder = new Base64Encoder();
                                  encoder.encode(username + ":"+password);
                                  service.headers = {Accept:"application/json", Authorization:"Basic " + encoder.toString()};
                                  service.method ="POST";
                                  var boundary:String = UIDUtil.createUID();
                                  service.contentType = "multipart/form-data; boundary=—————————" + boundary;
                                  var stream:FileStream = new FileStream();
                                  stream.open(appFile, FileMode.READ);
                                  var binaryData:ByteArray = new ByteArray();
                                  var fileData : String = new String();
                                  stream.readBytes(binaryData);
                                  stream.close();
                                  fileData = binaryData.readUTFBytes(binaryData.bytesAvailable); // I think this is where I have problem.... how do
                           //how do i converrt this bytearray/stream of data to string and send it in my post request's body - i guess if this step work rest should work..  
                                  var params: String = new String();
                                  var content:String = "—————————" + boundary + "nr";
                                  content += 'Content-Disposition: form-data; name="data";' + '{"title":"ELS test app 2","package":"com.elsapp.captivate","version":"12.3.09","create_method":"file"}' + "nr";
                                  content += "—————————" + boundary + "nr";
                                  content += 'Content-Disposition: form-data; name="file";' + fileData  + "nr";
                                  content += "—————————–" + boundary + "–nr";
                                  service.request = content;
                                  service.send();

    In the past I have used URLVariables with URLRequest and URLLoader to achieve this kind of requirement.
    Check out http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_3 .html which should be useful. My preference has always been to use this style instead of HTTPService objects, giving you a little more control which is what you need here.
    Let me know if you need any more assistance.

  • HTMLB Form Validation using JavaScript

    Hi All,
    <b>
    I have created a portal appliaction using JspDynPage.
    I have created a form using HTMLB tags. I want to validate the inputfields before sending it to the server for processing.
    The validation has to be done using Javascript
    </b>
    <b> How do i got about this ??? </b>
    regards
    Brahmachaitanya

    I have written the following code to perform the validation.......
    <b>
    function validate()
              var funcName=htmlb_formid+"_getHtmlbElementId";
                func=window[funcName];
              var inpBox1 = eval(func('if1'));
              var eno=inpBox1.getValue();
              if(eno=='' || eno==null)
                   alert('Please Enter Employee Number');
                   htmlbevent.cancelSubmit=true;
              var inpBox2 = eval(func('if2'));
              var ename=inpBox2.getValue();
              alert(ename);
              if(ename=='' || ename==null)
                   alert('Please Enter Employee Name');
                   htmlbevent.cancelSubmit=true;
              var inpBox3 = eval(func('absencetype'));
              var atype=inpBox3.getValue();
              if(atype=='' || atype==null)
                   alert('Please Enter Absence Type');
                   htmlbevent.cancelSubmit=true;
              var inpBox4 = eval(func('if4'));
              var from=inpBox4.getValue();
              if(from=='' || from==null)
                   alert('Please Enter From Date');
                   htmlbevent.cancelSubmit=true;
              var inpBox5 = eval(func('if5'));
              var to=inpBox5.getValue();
              if(to=='' || to==null)
                   alert('Please Enter To Date');
                   htmlbevent.cancelSubmit=true;
              var inpBox6 = eval(func('if6'));
              var approve=inpBox6.getValue();
              if(approve=='' || approve==null)
                   alert('Please Enter Approver Name');
                   htmlbevent.cancelSubmit=true;
    </b>
    The problem now is that i am getting the <b> alert message only for Employee Number.</b>
    <b> I am not getting the alerts if I leave the the other fields blank </b>
    <b> How do i go about this ????????? </b>
    regards
    Brahmachaitanya

  • Change Data Using Javascript

    Hi Guys,
        I'm wondering can I change a data in the data view without binding it to a UI using javascript?
        Thanks,
    Mao

    Hi,
    I mean in the hierarchy node select the field to which you want to populate the value. And in the script editor write this.rawValue = <your value>.
    Regards,
    Vidya Chowdhary A.

  • Submitting html form data using ajax

    Hi all
    I am new to ajax..
    i want to save my html form data into DB.
    i usually do it in jsp by submiting data throug form action..
    how can this be done using ajax..pls help me in this case.
    thanx in advance

    This forum is about Sun Studio program development tools for C, C++, and Fortran programming.
    You should ask your question in an appropriate Java forum. At the Sun Forums main page, click the "Java" or "Java ES" tab.

  • Read 32kHz data using 8451

    I need to read 32kHz data coming in synchronization with 32kHz clock. Can I use 2 digital i/o lines of 8451 and poll continuously to be able to read it? Is there a better way of reading data? I have LabVIEW 8.5.
    Any comments or ideas welcome.
    Thank you.

    Hi,
    You will not be able to use the NI-8451 for this application since it is software timed.
    You need a Data Acquisition card that would be able to do hardware timing.
    Please include an email address or phone number if you'd like me to have your territory rep. contact you to help you pick a module out of the huge variety of DAQ cards that NI sells.
    What form factor do you prefer?  (PCI is the most economical way to go.)
    Rergards,
    Sammy

  • How do i read form data into subject lines of email?

    I'm having a problem pulling form data and putting it in the subject line of my email.
    "mailto:[email protected]?subject=Formform form+ F_Name.rawValue + L_Name.rawValue";
    I thought this would read text fields from the form and print them in my subject line. Instead it tprints it without the data.
    I was wondering if someone could point me in the right directon on what i am doing wrong.
    Button2.event__click.submit.target  "mailto:[email protected]?subject=Formform form" + F_Name.rawValue + L_Name.rawValue;
    Button2.execEvent("click");
    Any help would be appreciated.
    jj
    Also if anyone would happen to know if there is a way to bypass the two email prompts and choose to directly send it using the users local email client would help or maybe its impossible.

    Button2.event__click.submit.target ="mailto:xxxxx.com?subject=FORM Form Form for " + topmostSubform.firstName.value;
    Can i use rawValue or value like this? Right after i put anything after those quotation marks that aren't more quotatin marks my button stops workin.

  • Error While updating Process form data Using Scheduler

    Hi All,
    I am trying to update Process form data (ex : lastname) using a scheduled task Code. I am getting Error while updating Field.
    Code :
    HashMap<String, String> map = new HashMap<String, String>();
    map.put("UD_EBS_PF_LASTNAME", "lastname");
    formintf.setProcessFormData(instancekey, map);  //I AM GETTING AT THIS LINE
    Saying
    Thor.API.Exceptions.tcAPIException: The following required fields have not been given values:EBS IT Resource : The following required fields have not been given values:EBS IT Resource
        at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
        at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
        at Thor.API.Operations.tcFormInstanceOperationsIntfEJB_h6wb8n_tcFormInstanceOperationsIntfRemoteImpl_1036_WLStub.setProcessFormDatax(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
        at $Proxy2.setProcessFormDatax(Unknown Source)
        at Thor.API.Operations.tcFormInstanceOperationsIntfDelegate.setProcessFormData(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.security.Security.runAs(Security.java:41)
        at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
        at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
        at $Proxy3.setProcessFormData(Unknown Source)
        at com.wyndham.tasks.AssignRandomPasswordToAllUsersSchedulerTest.execute(AssignRandomPasswordToAllUsersSchedulerTest.java:182)
        at com.wyndham.tasks.AssignRandomPasswordToAllUsersSchedulerTest.main(AssignRandomPasswordToAllUsersSchedulerTest.java:63)
    Caused by: Thor.API.Exceptions.tcAPIException: The following required fields have not been given values:EBS IT Resource : The following required fields have not been given values:EBS IT Resource
        at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(tcFormInstanceOperationsBean.java:761)
        at com.thortech.xl.ejb.beansimpl.tcFormInstanceOperationsBean.setProcessFormData(tcFormInstanceOperationsBean.java:426)
        at Thor.API.Operations.tcFormInstanceOperationsIntfEJB.setProcessFormDatax(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    Is that possible there was the field ZDATE in your form interface/ context and now it is not? I guess some source has changed so the field in the form (binding to the not existing field) cannot be processed. Otto

  • Is it possible to read digital data using an external clock (PCI-6259 M)?

    I’m using a NI PCI-6259 M Series card and trying to write my program in VC++6.0 using the functions in the DAQmx driver.
    Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?
    Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present.
    Example 1
    // Create tasks
    Status = DAQmxCreateTask("", &m_ReadTrimTask);
    // Set up read task
    status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
    status = DAQmxCfgChangeDetectionTiming(m_ReadTrimTask,"Dev1/port2/line6","Dev1/port2/line6",DAQmx_Val_FiniteSamps, 10);
    // Read data
    int32 sampsPerChanRead, numBytesPerSamp;
    status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);
    Example 2
    // Create tasks
    Status = DAQmxCreateTask("", &m_ReadTrimTask);
    // Set up read task
    status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
    status = DAQmxSetSampTimingType(m_ReadTrimTask, DAQmx_Val_SampClk);
    status = DAQmxSetSampClkRate(m_ReadTrimTask, 1000.0);
    status = DAQmxSetSampClkActiveEdge(m_ReadTrimTask, DAQmx_Val_Falling);
    status = DAQmxSetSampClkSrc(m_ReadTrimTask, " Dev1/port2/line6");
    // Read data
    int32 sampsPerChanRead, numBytesPerSamp;
    status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);

    Hello Magnus,
    Thank you for contacting National Instruments.
    "Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?"
    The best place to look for this information would be the M Series Help Manual. There you can find the features of your PCI-6259 and what operations it supports.
    "Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present."
    Look at the "ContReadDigChan-ExtClk_Fn.c" example project which ships with the NI-DAQ driver. This is located at: C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Cont Read Dig Chan-Ext Clk.
    You will have to make some minor modifications to convert this to a finite acquisition, but that is simply a matter of changing the "sampleMode" parameter of the DAQmxCfgSampClkTiming() function. You will also have to route your clock signal to a PFI line and specify which line in your code.
    I hope this helps.
    Sean C.
    Applications Engineering
    National Instruments

  • Writing the file using Write to SGL and reading the data using Read from SGL

    Hello Sir, I have a problem using the Write to SGL VI. When I am trying to write the captured data using DAQ board to a SGL file, I am unable to store the data as desired. There might be some problem with the VI which I am using to write the data to SGL file. I am not able to figure out the minor problem I am facing.  I am attaching a zip file which contains five files.
    1)      Acquire_Current_Binary_Exp.vi -> This is the VI which I used to store my data using Write to SGL file.
    2)      Retrive_BINARY_Data.vi -> This is the VI which I used to Read from SGL file and plot it
    3)      Binary_Capture -> This is the captured data using (1) which can be plotted using (2) and what I observed is the plot is different and also the time scare is not as expected.
    4)      Unexpected_Graph.png is the unexpected graph when I am using Write to SGL and Read from SGL to store and retrieve the data.
    5)      Expected_Graph.png -> This is the expected data format I supposed to get. I have obtained this plot when I have used write to LVM and read from LVM file to store and retrieve the data.
    I tried a lot modifying the sub VI’s but it doesn’t work for me. What I think is I am doing some mistake while I am writing the data to SGL and Reading the data from SGL. Also, I don’t know the reason why my graph is not like (5) rather I am getting something like its in (4). Its totally different. You can also observe the difference between the time scale of (4) and (5).
    Attachments:
    Krishna_Files.zip ‏552 KB

    The binary data file has no time axis information, it is pure y data. Only the LVM file contains information about t(0) and dt. Since you throw away this information before saving to the binary file, it cannot be retrieved.
    Did you try wiring a 2 as suggested?
    (see also http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=925 )
    Message Edited by altenbach on 07-29-2005 11:35 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Retrive_BINARY_DataMOD2.vi ‏1982 KB

Maybe you are looking for

  • Managed Client running under root

    Hi Can any one of you here tell me what is Managed Client??? I saw that one in the Activity Monitor and it is running under root account. Is this one of the Apple Remote Desktop? Or other Application is running.

  • Bridge suddenly appearing in Russian instead of English

    By opening Bridge (CS4) yesterday, it suddenly appeared in Russian, instead of English. How to change this back? Cascam. (Photoshop CS4 is normally running in English) Casper Cammeraat

  • Organizing photos on iPod

    I notice that when youare viewing your thumbnails on the iPod there is the month and year at the top of the screen. Is there a way to put them in the right place? ie. Jan 2004, feb 2004, mar 2004 and so on. Right now the month and years are all over

  • Import profit centers with DTW

    Hi All, Is it possible to import profit centers into the SAP B1 2007A with DTW, ? I have to create 50 profit centers in a company, I cannot find template to import profit centers in the DTW: Is it possible? Another way to use copy express, because th

  • Program in Dock Not Opening 'Drag & Drop' Files

    Recently my dock icon for Photoshop has stopped opening files when I drag a list of images onto it. None of my other dock Applications seem to be having this problem and still open any document or photo I drag onto it. I love the drag&drop feature an