Signing a part of my Form - InfoPath Dev
in

InfoPath Dev

Signing a part of my Form

Last post 07-13-2006 08:36 AM by fredarwin. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-11-2006 06:51 AM

    Signing a part of my Form

    I have a form published in a form library. my fields published are:
    name, department, position, authorized.
    I am using a main database connection to storege data.

    when i submit data: firts save data to my database and then are sent to the form library

    I am using Signatures by section and the fields that are signed are:
    name, department, position.

    Well, i need to update the authorized field after i sign the other fields and save changes.

    This is possible?

    I need do this because i need to show in my form library view the authorized field.
  • 07-12-2006 03:01 AM In reply to

    Re: Signing a part of my Form

    Hello,

    Did you try using OnAfterChange event handler on the authorized field. The field is updated when the changes happen in the xml. Please read the link below.
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdevtOnAfterChange_HV01021366.asp
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 07-12-2006 07:21 AM In reply to

    Re: Signing a part of my Form

    Thanks for the advise, i did change of the field on ip but cant change the database field.
    my code:
    //*****Execute Signature wizard*********///
    XDocument.UI.ShowSignatureDialog();
    ///////////////////change ip field after sing//////////
    XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:SolicitudesMS/@authorize").text="1";
    ///////change database field//////
    var objADOAdapter;
    var id=XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:SolicitudesMS/@id").text;
    objADOAdapter = XDocument.DataObjects("sample").QueryAdapter;
    objADOAdapter.Command='execute "SP_AUTORIZA" ' + id;
    objADOAdapter.Command.Execute;
    //////////send to mform library-------->
    var oXDocument2= XDocument.DataAdapters("SendToSP");
    oXDocument2.Submit();
    ////////////

    This is executed without problems, but my database field never is updated why??.
    I never get a message error.
  • 07-13-2006 08:36 AM In reply to

    Re: Signing a part of my Form

    Well, i got a solution
    if u´are working with signed forms, form library and sql database and you need change some field in the Document after u're sign the form and save this change to datasources do the nex code:

    function XDocument::OnSign(eventObj)
    {

    var Signature = eventObj.SignedDataBlock.Signatures.Create();

    Signature.Sign();
    eventObj.ReturnStatus = true;

    if (XDocument.IsSigned)
    {
    XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:SolicitudesMS/@autorizado").text="1";

    var idsolicitud=XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:SolicitudesMS/@idsolicitudesMS").text;

    try
    {

    XDocument.QueryAdapter.Command = 'execute "sp_autoriza" ' + idsolicitud;
    XDocument.Query();

    var oXDocument2= XDocument.DataAdapters("Enviar a SP");
    oXDocument2.Submit();
    }
    catch (ex)
    {
    Xdocument.UI.Alert(ex.description);
    eventObj.ReturnStatus = false;
    }
    }
    }

    the master tip for execute the sp is include the sentence:
    SET IMPLICIT_TRANSACTIONS off
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.