In place variable substitution form1.page2.variable.rawValue

Hello everyone,
I am trying to do this using formcalc:
var boostDate = "boosterDate1"
form1.page2.invoiceTable.row1.boostDate.rawValue = Num2Date(Date2Num(form1.page2.page2Date.formattedValue, "MM/DD/YYYY") + (firstRowWeek * 7)
+ (firstRowYear * 365), "MM/DD/YYYY")
I want to use a variable in place of the object name but for the life of me I can't get it to work using formcalc.
Thank you for any and all help.
Justin

Form, schema, datafile
https://docs.google.com/file/d/0B851Fdu_42hLOS1OU0QtcmVfYjA/edit?usp=sharing
https://docs.google.com/file/d/0B851Fdu_42hLTnNYZjdFeHFQM3c/edit?usp=sharing
https://docs.google.com/file/d/0B851Fdu_42hLeERHTnZPN2VQYm8/edit?usp=sharing
The 4 text fields are bound to 4 fields in the schema. I also created a list in the schema and bound a drop down list's items to that. By default, you can't bind the list items that way. You have to turn that feature on in Designer's settings. The Sample data for the list contains TextField1, TextField2 and TextField3 for list items. You can see in the calculate event of TextField4, that it's value is derived from whichever TextField you choose in the drop down. The visible/invisible stuff is because I am also posting these in response to someone else.

Similar Messages

  • Using a field value as subject in Email Submit - help

    Hi there,
    I am new to the forums and very new to LiveCycle and XML and Java.
    All i need is some hopefully very simple help.
    I have a PDF form, and all i want is when i click the submit button it uses the value entered into the textbox called JobCode as the subject in the email.
    how to do i adapt it to this code:
    <event name="event__click" activity="click">
        <submit format="xml" textEncoding="UTF-8" target="mailto:[email protected]?subject="/>
    </event>
    What do i type or where do i put whatever to make it work. it should be simple.
    Thank you in advance
    Jason

    GOT IT...
    After a lot of mucking around and then leaving to watch a movie then coming back with a fresh mind i nailed it.. haha
    feel like a bit of a goose cause i couldnt figure it out earlier but i got now..
    i needed to use
    var oJobCode;
    var oSubmit;
    var oSubject;
    var oBody;
    oJobCode = form1.Page1.JobCode.rawValue;
    oSubmit = form1.Page2.TrdsRspn.rawValue;
    oSubject = "Job Code: "+ oJobCode;
    oBody = "Works Report Submitted by: " + oSubmit;
    event.target.mailDoc({bUI: true,cTo: "[email protected]",cCC: "",cSubject: oSubject,cMsg: oBody});
    AND BAM!
    Works perfectly.

  • Data Binding using XML as data connection

    I'm using an XML as my data connection. It has several order fields in various sections that have unique field identifiers. I have created a random order # script that runs fine inside of the form that occurs on the first order number field but I need that same number to populate into each of the additional order fields, again that have unique identifiers. Is there a way to combine data fields?
    Thanks!

    usually you can make the binding global and all same named fields will end up with the same value. You may not be able to do that if you have bound your field to a data node in your XML. If that is the case then you will have to do it programatically. Lets assume you have Order_Number on Page 1 and Order_Number2 on Page 2. You would code on the calculate event of the 1st Order_Number field (the one where the number is calculated) - form1.Page2.Order_Number2.rawValue = form1.Page1.Order_Number.rawValue;
    You can add multiple statements to equate that value to other instances of the field as you see fit. Now when any one of those values changes all of the others will be updated auto-magically!

  • CDA XML Schema Data Connection

    I have been experimenting in Adobe Designer 7.0 and want to create an CDA XML schema data connection. I used the directions in the help screen and was almost finished, but I got a pop up box that said that my XML schema file was too big. What are the size limits for XML schema files?
    Linda

    usually you can make the binding global and all same named fields will end up with the same value. You may not be able to do that if you have bound your field to a data node in your XML. If that is the case then you will have to do it programatically. Lets assume you have Order_Number on Page 1 and Order_Number2 on Page 2. You would code on the calculate event of the 1st Order_Number field (the one where the number is calculated) - form1.Page2.Order_Number2.rawValue = form1.Page1.Order_Number.rawValue;
    You can add multiple statements to equate that value to other instances of the field as you see fit. Now when any one of those values changes all of the others will be updated auto-magically!

  • Need to place a variable value at the end of report heading in BI 7

    Dear All,
    We have to place a variable value at the end of the report heading and the value should get refreshed whenever we change the variable by using "Change Variable Value". I have created a macro and the value will get triggered unless and until we click on any where on a sheet. But, we want to automate this one by using a macro.
    Ex: Quarterly TA Host Country Details As Of "Variable Date" Variable is created on TA Date characteristic. User can enter date on Pop up window box at the time of changing a variable TA Date. We need changed date at the end of the Report heading Qua----
    Please suggest me on how to place variable value at the end of report heading by using a macro.

    No need to use Macro. You can use text variable.
    Goto the Query Description and click on the Text variable icon.
    Create a text variable of processing type as REPLACEMENT PATH and replace it with the characteristic for which you have a ready for input variable that will be eneter by the user.
    This will populate the text variable with the value entered by teh user.
    Use this text variabkle along with the Query Description. So your description will look something like REPORT_TITLE&TXT_VAR&
    Hope this helps.

  • Using variables in aggregates

    Hi gurus!
    Is it possible to a place variable in aggregate?  I see you can use a fixed value within an aggregate, but I would like to create an aggregate based on Calendar Month variable which could be detected from the system.
    I suspect that it is not possible, but I was wondering if anyone attempted or accomplished this feat.
    Thanks....John

    Hi,
    no, this is not possible. The only variable you can enter in aggregate is the "key date" used for time dependent attribute / hierarchy  or texts.
    hope this helps...
    Olivier.

  • How can I do a multiple record data merge, but specify that a specific text frame with variable data only merges on the first record?

    I'm doing a multiple record data merge, I have 2 frames both with variable data placed inside.
    I would like to specify that one of the text frames only merges once(first record) and the other frame multiple times for each record in the data file.
    Is it possible?
    I thought that perhaps if I place the text frame that must merge once on the master page, it would work.  But you are not allowed to place variable text on the master and on the document page.
    I'm going to try it through scripting next, but thought that perhaps there is an easier way that I'm not aware of.
    Thanks,
    Suzanne

    Suzanne,
    If you were trying to post a screen shot, you would need to return to the forum and post it using the "camera" icon at the top of the post editing windows.
    I use a plug-in from Em Software called InData. One of the benefits for what I do is there are no individual frames on a page to deal with post-merge. Individual frames are great for simple merges (address labels, post cards, etc.). But I typically do more other types of merges.
    That said, there is a drawback--one needs to come to an understanding of writing expressions that actually parse the incoming data. So in the spice price list example, that looks like:
    It's reasonably easy once one does it a few times. And it can be far more complicated. The above is from Em Software's samples that has been tweaked. The best thing I can recommend would be to download the trial and see for yourself. They are good at responding to specific questions if you get stumped.
    I imagine this all could be scripted somehow in ID. But I have no idea how and the plug-in just lets me keep working.
    Mike

  • Variable scope issue - EWS

    Hi everyone,
    So I have a funny issue. From line 8 to line 37 I declare a set of variables, most of them with null values. Then I call a function: SetupEWSAndFolder (line 88) which sets a lot of these variables. Once the function exits, the variables are empty.
    How come ? I thought that variables defined at script level would be updated in child functions ? Is it because of the null value ? I have another script with the same kind of setup but the variables are not set to null and it works perfectly fine.
    And for the fun, i tested echoing the value at the end of the function of some variables and then outside and the one outside are not updated
    I also tested using: $global:mb for instance, I still have the initial value set in the script and not the one updated in the function
    Thanks for helping me clear up my misunderstanding of the issue
    Olivier
    # Using Export - Import would be easier but since we do not have the rights for it and it requires a specific role being assigned to us... here goes EWS!!!
    # Include the Exchange Web Service DLL
    Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll"
    # Import the logwrite ability
    . .\LogWrite.ps1
    ################################################### INITIAL VARIABLES SETUP ###################################################
    #Setting up the log file
    #$userLogon = $args[0]
    $userLogon = "olivraga"
    $Logfile = "$userLogon.log"
    #setting up the name of the top folder in which to transfer #Inbox#, #SentItems#, #DeletedItems#
    $folderName = "_AutoOffBoardingArchiveFolder"
    #get the current username
    $credUserName = Get-Content env:username
    #Setting the mailbox variable for the folder binds in EWS
    $mailbox = $null
    #Setting up the Exchange Web Services connection
    $ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2
    $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($ExchangeVersion)
    $mb = $null
    #Setting up the folder variables for general calls
    $rootFolderID = $null
    $topFolder = $null
    $iFolder = $null
    $dFolder = $null
    $sFolder = $null
    #Setting up the folder ID to the targetted mailbox
    #(otherwise we would target the mailbox of the current account which we do not want :))
    $inboxID = $null
    $deletedItemsID = $null
    $sentItemsID = $null
    #Setting up the #Inbox# , #SentItems# , #DeletedItems# folder variables
    $inbox = $null
    $deletedItems = $null
    $sentItems = $null
    ############################ Function that moves a folder to another folder, including sub folders ############################
    function MoveItems(){
    $source, $dest, $path = $args[0]
    LogWrite "Copying/Moving $path"
    #Pulls items by thousands at a time
    $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000)
    $fiItems = $null
    do{
    #Get the 1000 items present in the source folder
    $fiItems = $service.FindItems($source.Id,$ivItemView)
    foreach($Item in $fiItems.Items){
    # Copy the Message
    $Item.Copy($dest.Id) | out-null
    # If you want to switch to a move instead use:
    #$Item.Move($dest.Id)
    $ivItemView.Offset += $fiItems.Items.Count
    }while($fiItems.MoreAvailable -eq $true)
    #Do the subfolders now
    if ($source.ChildFolderCount -gt 0)
    # Deal with any subfolders first
    $folderView = New-Object Microsoft.Exchange.WebServices.Data.FolderView(1000)
    $foldersFound = $source.FindFolders($folderView)
    ForEach ($subFolder in $foldersFound.Folders)
    $subFolderToCreate = New-Object Microsoft.Exchange.WebServices.Data.Folder($service)
    $subFolderToCreate.DisplayName = $subFolder.DisplayName
    $subFolderToCreate.Save($dest.Id)
    MoveItems($subFolder, $subFolderToCreate, $path+"\"+$subFolder.DisplayName)
    ################################# Initial necessary setup like full access and EWS connection #################################
    function SetupEWSAndFolder(){
    $mailbox = (Get-ADUser $userLogon -Properties mail).mail
    # Giving the current account Full Access to the Mailbox
    Add-MailboxPermission -Identity $mailbox -User $credUserName -AccessRights FullAccess -InheritanceType All -Confirm:$false
    $service.Url = "https://webmail.brookfieldrenewable.com/EWS/Exchange.asmx"
    #$service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials($userLogon,$userPassword,"hydro")
    #$service.Credentials = $creds.GetNetworkCredential()
    $service.UseDefaultCredentials = $true
    $service.AutodiscoverUrl($mailbox)
    $mb = new-object Microsoft.Exchange.WebServices.Data.Mailbox("$mailbox")
    #Get the root folder ID of the targetted mailbox
    $rootFolderID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::msgfolderroot, $mb)
    #Create new top folder to contain the Inbox, DeletedItems and SentItems folder
    $topFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $topFolder.DisplayName = "$folderName"
    $topFolder.Save($rootFolderID)
    #Create the subfolders to the topFolder to copy or move the emails in #Inbox# , #SentItems# , #DeletedItems#
    $iFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $iFolder.DisplayName = "Inbox"
    $iFolder.Save($topFolder.Id)
    $sFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $sFolder.DisplayName = "SentItems"
    $sFolder.Save($topFolder.Id)
    $dFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $dFolder.DisplayName = "DeletedItems"
    $dFolder.Save($topFolder.Id)
    #Just to make sure that the folder is created and everything is updated nicely
    Start-Sleep 5
    $inboxID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$mb)
    $deletedItemsID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::DeletedItems,$mb)
    $sentItemsID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::SentItems,$mb)
    $inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $inboxID )
    $deletedItems = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $deletedItemsID)
    $sentItems = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $sentItemsID)
    SetupEWSAndFolder #setup the EWS connections and the folders
    MoveItems ($inbox, $iFolder, "Inbox") #Copy (not move yet) Inbox to the archive folder
    MoveItems ($deletedItems, $dFolder, "DeletedItems") #Same but for deleted items
    MoveItems ($sentItems, $sFolder, "SentItems") #Same but for sent items
    ##################################################### Helper Code Blocks ######################################################
    <#
    #Block of code in case one does not know the ID of the folder, but since we just created the topFolder, we do not need to search for it :)
    #Bind to the MSGFolder Root
    $rootFolderId = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,"hydro\$userLogon")
    #Setup the retrieval of the folder ID just created
    $targetFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$rootFolderId)
    $searchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName,$folderName)
    $folderView = new-object Microsoft.Exchange.WebServices.Data.FolderView(1)
    $findFolderResults = $service.FindFolders($rootFolderId, $searchFilter, $folderView)
    #>

    When you read the about_scope you see:
            - An item you include in a scope is visible in the scope in which it
              was created and in any child scope, unless you explicitly make it
              private. You can place variables, aliases, functions, or Windows
              PowerShell drives in one or more scopes.
    To me, it means that if you define a variable at the script level, it is going to be availble at the function level. To me, the function scope level is a child of the script scope level.
    So I did a check and it works like you say. But it is annoying, look at the following script and result:
    #This is a scope test:
    $nbErrors = "script";
    Function DoErrorTest(){
    $nbErrors
    $nbErrors = "inside"
    $nbErrors
    DoErrorTest
    $nbErrors
    Result:
    script
    inside
    script
    Which logical and totally annoying at the same time. And, to me, it means that you can never assign a value in a child scope by using the name of the variable. But you can display the value of the parent scope variable as long as you don't give a value to
    a same name variable in a child scope....
    This is gonna be annoying...
    Thanks

  • Bussiness Place (BUPLA) in documents posted through REFX

    Dear All,
    The bussiness place is not getting updated in documents posted through REFX, even though their is a option to assign Section Code (SECCO) in Bussiness Entity Master data (from T.Code REBDBE) their is no feild available to assing the bussiness place. So do anybody have any solution to populate  the bussiness place in documents while posting through REFX.
    Regards
    JKT.

    Hi,
    Business place has to field by manually. But if you want you can restrict through Validation and substitutions. here what we are doing maintaing both section code and business place. what substitution we are created so far here when section code this one then business place is this. like that we are created.
    Depend upon configuration you might be create any validation.
    Hope this is clear, if yes assign points. Any problem revert me.
    Regards,
    Sankar

  • Intial/Default Business Place in F-32

    Hi,
    While doing F-32 transaction in the "Clear Customer Correct Customer Item", how do i change the default (initial) values populated in 'Business Place".
    Where can i change the intial/default values in the img.
    Please advise.
    Thanks,
    Safi

    Hi,
    Business place has to field by manually. But if you want you can restrict through Validation and substitutions. here what we are doing maintaing both section code and business place. what substitution we are created so far here when section code this one then business place is this. like that we are created.
    Depend upon configuration you might be create any validation.
    Hope this is clear, if yes assign points. Any problem revert me.
    Regards,
    Sankar

  • Form where testing if radiobuttonlist is null and then display message

    I created a test form to try to get this work and can't seem to make it work. In my form I have a ddlist on page 1. on page 2 I have a subform that the selection in the ddl makes visible--that's working.
    There is a radiobuttonlist in the subform. I'd like to check on the submit button if ddl == 2 and radiobuttonlist == null then display a message. Here is my script:
    //Create a variable to hold the document object
    var 
    v3 = form1.page1.division.rawValue;
    var 
    v15 = form1.page2.pcEquip.dirAbove.RadioButtonList.rawValue;  
    if 
    ((v3 == 2) && (v15 == null)) {
    xfa.host.messageBox( "Please indicate whether the associate is a director or above" );
    xfa.host.setFocus("form1.page2.pcEquip.dirAbove.RadioButtonList");
    else 
    Button3.execEvent("click");
    The script is finishing as desired with the email window, but doesn't catch that the radiobuttonlist is null. Any help would be appreciated.
    Thanks,
    MDawn

    Hi,
    Test the radio button exclusion group against an emply string. For example:
    if (v15 == "")
         // your script here.
    Hope that helps,
    Niall

  • Problem in Parsing an XML

    I have saved the XML data into a variable and want to retrive the values in XML and store them in separate variables.While trying to do this with Parsing I encounter an error in DOM creation.I have tried out following codes in Form:Ready event.But those are not working.
    When I place a messagebox on top of the line which creates DOM its displaying the message.But it is not displaying when I place it in line next to line which creates DOM.So i think it is problem with the line of Creating DOM.Please help me out.Its very urgent.I have delivery in 2 days.
    var temp = xfa.resolveNode("$data.nodes.item(0)");
    var test = temp.saveXML();
    // Now create the DOM:
    var x = XML.parse(test);
    var policy = x.resolveNodes("policies");
    var number = policy.item(0);
    var company = number.getElement("CNACompany").value;
    var temp = xfa.resolveNode("$data.nodes.item(0)");
    var test = temp.saveXML();
    // Now create the DOM:
    var x = XMLData.parse(test,false);
    var xPathExpr = "//data/policies/[PolicyNumber='WC 1234567890']";
    var number = XMLData.applyXPath(x, xPathExpr);
    With this code for creating DOM we are getting some junk value for 'x' as 57.13mm.
    Thanks in Advance...
    Pavan.

    Hi,
    I'm not familiar with the XML.parse() or XMLData.parse() functions. I can't identify the XML or XMLData objects. They are not declared and they are not XFA objects.
    Still, it looks like you need to get and set a form/data value.
    Here is an example getting the value of a form field:
    Your have the following form:
      someText
      otherText
    Use the SOM expression of the CNACompany field to access its value:
    var CNAValue = form1.policies.CNACompany.rawValue;
    If the value is not merged in the form, try searching the data DOM instead. For example:
    var CNAValue = xfa.record.policies.CNACompany.value;
    To set the value of a form field or data value, do as follows:
    form1.policies.CNACompany.rawValue = newValue;
    xfa.record.policies.CNACompany.value = "newValue";
    Note: to get/set a value from the data file use the value property. To get/set a value from a form field, use the rawValue property.
    Hope this helps,
    Hélène
    Adobe Systems Inc.
    FYI
    The Adobe XML Form Object Model Reference posted on the Developer Center contains several scripting examples in Appendix A.
    LiveCycle Developer Center
    http://www.adobe.com/devnet/livecycle/designing_forms.html
    Adobe XML Form Object Model Reference
    http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf

  • Instance value

    I am trying to understand how to create an instance of a sub form.  That I am able to do the problem is that I need to click the approved denied drop down on page 1 that takes information from Reviewer value and put it in page 2 text area that is the top right box.  The first box is a date that is automatically entered when it is initiated.  If the engineering approved denied is click then I want to initiate the sub form and enter another set of items.  The problem I am having is figuring out how to get the instance array of data to enter each data from the list on the form.  If any one can help with code snips would be great this is what I have and what I want is to assign the [*] to be the next instance value because not every approved/denied will occur. 
    if($.boundItem(xfa.event.newText) == "Denied") {
    this.resolveNode('Page2._reviewDept').addInstance(1);
    if (xfa.host.version < 8) {
      xfa.form.recalculate(1);
    this.resolveNodes("form1.Page2.reviewDept[*].dept").rawValue = "Comm. Bld/Fire/Mech/Cab Departments";
    this.resolveNodes("form1.Page2.reviewDept[*].enterdDate").rawValue = month+"/"+day+"/"+year+"    "+hours+":"+minutes;
    this.resolveNodes("form1.Page2.reviewDept[*].planReviewer").rawValue = this.resolveNode("comBldReviewer").rawValue;
    form1.Page1.Table1.Row3.comBldDateApp.rawValue=month+"/"+day+"/"+year+"    "+hours+":"+minutes;
      xfa.host.currentPage =1;
    else if($.boundItem(xfa.event.newText) == "Approved"){
    form1.Page1.Table1.Row3.comBldDateApp.rawValue=month+"/"+day+"/"+year+"    "+hours+":"+minutes;
    this.resolveNode("form1.Page2.reviewDept[*].deptComments").rawValue = "No Comments.";

    radzmar,
    thanks for the response.  I figured out that the resolve Node method is needed, what I am trying to figure out is the [*] to be assigned a value every time a new instance is created, so that the comments form can be created in any arrangement.  I can change the * to 0, 1, 2, 3, 4, 5 for each instance and as long as I start with the first one Zoning and go down the list it will create the list.  It is when the list is not created in order when I get errors.  This has been driving me crazy for the past 3 days.  example:
    this.resolveNode("form1.Page2.reviewDept[0].dept").rawValue
    this.resolveNodes("form1.Page2.reviewDept[1].dept").rawValue
    this.resolveNodes("form1.Page2.reviewDept[2].dept").rawValue
    I am guessing that I need a variable for each of the instance and somehow count the instances created and put into this variable and replace each number.  I just cannot figure it out.  I am new to Javascript.

  • How to reference JavaScript functions stored in a script object on a different page?

    Hi,
    I have a form which has 2 pages. I have a bunch of JavaScript functions under script objects on page 1. How can I access these functions from page 2?
    I tried the following but none of it work:
    form1.page2.#variables[0].testScript.doThisNow();
    form1.page2.variables[0].testScript.doThisNow();
    form1.page2.variables.testScript.doThisNow();
    Please help.

    Hi,
    Simplest way would be to drag the script object to be under the root node (form1). On both pages would would then be able to reference the function by:
    testScript.doThisNow();
    If you leave the script object under page1, then from page2, the following should work:
    page1.testScript.doThisNow();
    Hope that helps,
    Niall

  • 'Inserting' text into a Text Field on event trigger in a static form

    Sorry if this seems like a silly question, but I've been struggling with it for a bit and I'm new to Adobe/JavaScript.
    I am building a static form (it must be static), and I want to have text appear/disapear based on an event trigger (mouseclick). I tried creating a floating text object inside of a static text object, but I'm not sure how I can make the string value for this change based on the event trigger. The only advice in the Adobe help was purely regarding FormCalc, which I can't use as this must be a static form. I tried using this code in the <script>, but it obviously didn't work as it was written from FormCalc code versus JaveScript;
    TextField.rawvalue = variable.value;
    What do you suggest in terms of being able to script this, so my static form will work? Thanks a billion if you can help!
    PS: I'm using Adobe 9, LiveCycle ES 8.2
    PPS: Also tried inserting the following into my trigger script;
                        xfa.resolveNode("form1.subform.TestField").rawValue= "Please Work";
                        xfa.layout.relayout("form1.subform.TestField");
    It also did not work.

    Hi,
    If the button and the textfield are on in the same subform then this code should work in the click event of the button
    (This is JavaScript code so make sure the code is set to JavaScript and Client on the drop downs in the script window)
    (assuming the name of the textfield is TextField1)
    TextField1.rawValue = "some value";
    If they are in different subforms then you have 2 options
    Please note in both these options it is easier if the subforms have names ( I am assuming this to keep samples simple)
    option 1 -
    use the parent object to move up the tree till you are at the same level as that of the subform that contains the textfield
    e.g. 
    (Click Event of the button)
    this.parent.subformname.TextField1.rawValue = "some value";
    option 2 -
    Use the resolve node to make your way down from the top level of the form
    xfa.resolveNode ("form1.subformname.TextField1").rawValue = "some value";
    Hope this helps
    Malcolm
    p.s. I am making assumptions as the image/file you attached did not appear for me.

Maybe you are looking for