qrules - Using CopyTable in DB based Forms - InfoPath Dev
in

InfoPath Dev

qrules - Using CopyTable in DB based Forms

Last post 05-15-2009 05:15 AM by ErnestoM. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-11-2009 09:51 PM

    • alphaeri
    • Not Ranked
      Female
    • Joined on 05-11-2009
    • Brazil
    • Posts 4

    qrules - Using CopyTable in DB based Forms

    Hello all,

    I'm a newbie with Infopath. Actually I am not even remotely IT, I'm mechanical engineer, but I like to try new things. So, I'm experimenting with the creation of forms in Infopath to retrieve data from a SQL DataBase that currently manage our engineering files. My goal is to create a form template that I can publish to our SharePoint collaboration site to be used by all the CAD team to send a list of CAD files that will be used for construction of tooling. I mean they will fill out the form and then with a workflow in sharepoint an email will be sent to someperson with a link to the form (read-only) 

    I wanted to know if it's possible to use "qrules" (Qdabra), specially the function "CopyTable" in a Template Form based on DB. What I would like to accomplish is...

    1) to use the preconfigured "Run Query" option of the template to get only some records (I mean I'll be filtering using the query fields)

    2) and after the query completes, let the user decide if the results will be inserted in to a Final Table. (which will be basically a list of files, having the names and their corresponding hyperlinks) 

    Why using another table? because I want to be able to append the data that I searched with the Query, and I couldn't figured why the repeating table of the Data Fields (the results of the Query) disapear everytime I want to search more records using other filters.

    I already have the form, and all works fine, I can filter data with no problem. But when I try to copy the data from repeating Table1 (the query results, or DataFileds) using the "CopyTable" function of Qdabra qrules, it doesn't seem to work properly. I mean it does not appear any error code or message, but no value is inserted in Table2, it only inserts the correct amount of rows, but all fields in Table2 are empty. What am I missing, I started to think is not possible to use qrules with this kind of Form.  

    Thanks in advance!

    PS. My form won't be browser enabled, as everybody who will use it has infopath installed. And also, according to our IT staff we don't have sharepoint license to use that kind of forms.

  • 05-13-2009 05:25 AM In reply to

    Re: qrules - Using CopyTable in DB based Forms

    Hi alphaeri. Thank you for trying qRules.

    Without seeing your form it will be difficult to troubleshoot this. I haven't tried qRules on a template based on a DB, but I don't see why it wouldn't work. If the form is InfoPath 2007, not a browser form and codeless, then qRules should work.

    Could you share with us the following?

    1. The xml structure of both the source and destination tables

    2. The command you are using.

    Thanks.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 05-13-2009 06:18 AM In reply to

    • alphaeri
    • Not Ranked
      Female
    • Joined on 05-11-2009
    • Brazil
    • Posts 4

    Re: qrules - Using CopyTable in DB based Forms

    Hi Ernesto! Thanks for your reply.

    • Heres the XML Structure of my Template....

    <?xml version="1.0" encoding="UTF-8"?>
    <?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:Alpha-s-Documents:-dataFormSolution" href="manifest.xsf" solutionVersion="1.0.0.21" initialView="Modo de exibição 1" productVersion="12.0.0" PIVersion="1.0.0.0" ?>
    <?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
    <dfs:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:q="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields" xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:xdado="http://schemas.microsoft.com/office/infopath/2003/adomapping" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-05-12T00:07:03" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003">

     <my:Cliente></my:Cliente>
     <my:Producto></my:Producto>
     <my:Proceso></my:Proceso>
     <my:TipoProyecto></my:TipoProyecto>
     <my:Proyecto></my:Proyecto>
     <my:TipoFormato></my:TipoFormato>
     <my:Elemento></my:Elemento>
     <my:StatusDoc></my:StatusDoc>

     <dfs:queryFields>
              <q:Documentos Status="" NomeDocumento="" CodigoCliente="" CodigoProduto="" CodigoProjeto="" CodigoElemento="" CodigoTipoDocumento="" CodigoUsuario="" DataHoraCriacao="" Path="" Comentario=""></q:Documentos>
     </dfs:queryFields>
     
     <dfs:dataFields>
              <d:Documentos Status="" NomeDocumento="" CodigoCliente="" CodigoProduto="" CodigoProjeto="" CodigoElemento="" CodigoTipoDocumento="" CodigoUsuario="" DataHoraCriacao="" Path="" Comentario=""></d:Documentos>
     </dfs:dataFields>

     <my:Final>
               <my:TablaFinal my:FinalStatus="" my:FinalNomeDocumento="" my:FinalCodigoCliente="" my:FinalCodigoProduto="" my:FinalCodigoProjeto="" my:FinalCodigoElemento="" my:FinalCodigoTipoDocumento="" my:FinalCodigoUsuario="" my:FinalDataHoraCriacao="" my:FinalPath="" my:FinalComentario=""></my:TablaFinal>
    </my:Final>

    </dfs:myFields>

    •  ...and this is the Command that I am Using (as a Rule in a Button)...

    ACTION>  Set a field's value

    FIELD:      Command

    VALUE:    CopyTable /tablesrc=/dfs:myFields/dfs:dataFields /rowsrc=d:Documentos /tabledest=/dfs:myFields/my:Final /rowdest=my:TablaFinal

    PS1.  I  use the first 8 fields for filtering the query. They are all List Boxes connected to the same DataBase (SQL) but each one is accessing a different table, so I have 8 secondary sources. Each of those tables have basically 2 fields a CODE and a NAME. I have a Rule for each of the ListBoxes that define the value (selected CODE in the ListBox) for the corresponding Query Field. I chose to do it this way because I think the presentation of the form is more user friendly.

    PS2.  I set the Fields in the Table "TablaFinal" to be "Field(attribute)" type, cause the Data Fields were that type. I've also tried setting the fields as "Field(Element)" but would give me an error, something related to qrules and the structure of the tables, I don't remember exactly the Message displayed in the error window.

    Please let me know if this is what you asked me for. Thank you very much in advance,

    Alpha 

  • 05-13-2009 07:43 AM In reply to

    Re: qrules - Using CopyTable in DB based Forms

    The first thing that catches my attention is /rowsrc=d:Documentos. What exactly is this source?

    Maybe I misunderstood your original question. qRules' CopyTable will copy data from one xml group to another, so yes, all the data needs to be in the InfoPath form before it can be moved around.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 05-13-2009 08:35 AM In reply to

    • alphaeri
    • Not Ranked
      Female
    • Joined on 05-11-2009
    • Brazil
    • Posts 4

    Re: qrules - Using CopyTable in DB based Forms

    Regarding     /rowsrc=d:Documentos

    "Documentos" is the Name of the SQL Table that contains the Data that I want to be Displayed in my Final Table.

    When I first created the Form Template (based on a DataBase), inside the wizard "Design a Form Template" of Infopath I click on "Select DataBase", I created a New Data Connection and after created a .ODC file,  the wizard asked me for a Table to connect with, so I selected that Table "Documentos".

    Automatically, infopath created for me the 2 Groups "queryFields" and "dataFields" based on that table, and inside each of these also created a repeating group called "q:Documentos" and "d:Documentos", respectively. So, d:Documentos is the relative xPath I guess for the repeating table that keep the results of the Query.

    Actually I have 3 Buttons,

    1. New Record (created by default for forms based on DB, but I am not Using it)
    2. Run Query (also by Default, using it to search Data inside "Documentos" Table based on my selected Filters, the 8 fields at the beggining of my XML structure-on the previous message)
    3. Insert (custom buton, I mean I inserted it, there's no code in it, only rules) 

    Here I am using the qrule "CopyTable" to copy data...

    • FROM>    "d:Documentos" repeating table, which is the Result of the Query as I mentioned.
    • TO>         "TablaFinal" repating table, which is the table where I want to append all data that user decide to Insert . I mean, they only will click on "Insert" button after they found (by clicking on the Run Query button) the Data they want to insert into Final Table, so, I am Sure that I have data inside the "d:Documentos" before trying to copy the values.

    The issue is that while testing the form, after I found the data I want to insert into "TablaFinal", when I click on "Insert" it only insert the rows into the "TablaFinal" table, but there isn't any value in any of the fields. Hope I am being clear enough.

    THANK YOU :)

     

  • 05-14-2009 06:45 AM In reply to

    Re: qrules - Using CopyTable in DB based Forms

    Hi Alpha, here is an update. I have been able to reproduce this issue locally. The cause might be because this is a repeating field with attributes, whereas CopyTable was developed with a different structure in mind (not attributes). I am investigating whether this can be fixed in qRules and will update this post once I have an answer. Thanks for your patience.
    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 05-14-2009 09:21 AM In reply to

    • alphaeri
    • Not Ranked
      Female
    • Joined on 05-11-2009
    • Brazil
    • Posts 4

    Re: qrules - Using CopyTable in DB based Forms

    Hi Ernesto,

    I look forward to hear your news. Hopefully is possible to work with attributes also, as I'm not able to make any changes to the DataBase I'm accessing to. 

    THANKS TO YOU FOR YOUR HELP :)

    Alpha

  • 05-15-2009 05:15 AM In reply to

    Re: qrules - Using CopyTable in DB based Forms

    Hi Alpha, we have noted this as a fix for the next release, but I don't have a date for that at the moment. I will post in this thread once it's fixed to let you know.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.