Add task link in InfoPath Form - InfoPath Dev
in

InfoPath Dev

Add task link in InfoPath Form

Last post 03-13-2012 09:09 AM by bsieloff. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 03-09-2012 02:35 PM

    Add task link in InfoPath Form

    Greetings,

    I have a form that is more or less a status screen for a workflow process.  In the process the users are assigned tasks.  When I look at the task list in SharePoint I see that the "Title" field says something like "Workflow Task" and it is clickable to open the acutall task.  I'm using Odata to sort and grab the correct task for the currently logged on user since the list is quite big, but when I add the field "Title" from the Tasks list on the IP form it is no longer linked to the actual approval task. Is there a way to display a task link on the form?  Does QRules have something?

    Looking at the Odata dump (sample shown below) I don't actally see a link for the task

    <m:properties>
            <d:ContentTypeID>0x0108010064E42B14ADA442C78E98D686760A8493002C26226B2F11FE40BF1902FE77506984</d:ContentTypeID>
            <d:Title>Workflow task</d:Title>
            <d:PriorityValue>(2) Normal</d:PriorityValue>
            <d:StatusValue>Not Started</d:StatusValue>
            <d:Complete m:type="Edm.Double" m:null="true" />
            <d:AssignedToId m:type="Edm.Int32">30</d:AssignedToId>
            <d:TaskGroupId m:type="Edm.Int32" m:null="true" />
            <d:Description>&lt;font face="Arial"&gt;&lt;/font&gt;</d:Description>
            <d:StartDate m:type="Edm.DateTime">2011-12-14T09:16:05</d:StartDate>
            <d:DueDate m:type="Edm.DateTime" m:null="true" />
            <d:RelatedContent>https://sharepoint.mycompany.com/departments/legal/contractmgmt/Contracts/ContractX.xml, ContractX</d:RelatedContent>
            <d:ExternalParticipant m:null="true" />
            <d:ExternalParticipantReason m:null="true" />
            <d:Outcome>Pending</d:Outcome>
            <d:WorkflowName>Contract Submitted Parallel</d:WorkflowName>
            <d:ApproverComments m:null="true" />
            <d:Name>Workflow task</d:Name>
            <d:ApproveValue m:null="true" />
            <d:LegalContractNotes m:null="true" />
            <d:FinanceApproverId m:type="Edm.Int32" m:null="true" />
            <d:Approver1Id m:type="Edm.Int32" m:null="true" />
            <d:Approver2Id m:type="Edm.Int32" m:null="true" />
            <d:Approver3Id m:type="Edm.Int32" m:null="true" />
            <d:Approver4Id m:type="Edm.Int32" m:null="true" />
            <d:Approver5Id m:type="Edm.Int32" m:null="true" />
            <d:Approver6Id m:type="Edm.Int32" m:null="true" />
            <d:Approver7Id m:type="Edm.Int32" m:null="true" />
            <d:Approver8Id m:type="Edm.Int32" m:null="true" />
            <d:SignatoryId m:type="Edm.Int32" m:null="true" />
            <d:Id m:type="Edm.Int32">704</d:Id>
            <d:ContentType>Nintex Workflow Multi Outcome Task</d:ContentType>
            <d:Modified m:type="Edm.DateTime">2011-12-14T09:16:48</d:Modified>
            <d:Created m:type="Edm.DateTime">2011-12-14T09:16:48</d:Created>
            <d:CreatedById m:type="Edm.Int32">21</d:CreatedById>
            <d:ModifiedById m:type="Edm.Int32">1073741823</d:ModifiedById>
            <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
            <d:Version>1.0</d:Version>
            <d:Path>/departments/legal/contractmgmt/Lists/Workflow Tasks</d:Path>
          </m:properties>

    Filed under: ,
  • 03-12-2012 01:25 PM In reply to

    Re: Add task link in InfoPath Form

    ...so I have come up with a few Ideas...

     I see from the odata information above that I have enough information to build the hyperlink... All I really need is the Id.  (in the example above the number is 704)

    The hyperlink in the tasks list to open the task form looks like:

    https://sharepoint.company.com/departments/legal/contractmgmt/_layouts/listform.aspx?PageType=4&ListId={552286A0-12A7-4E0D-8A6F-A9DE0173D445}&ID=704&ContentTypeID=0x0108010064E42B14ADA442C78E98D686760A8493002C26226B2F11FE40BF1902FE77506984

     therefore I have tried a few things to concat everything around the id:

    concat("https://sharepoint.company.com/departments/legal/contractmgmt/_layouts/listform.aspx?PageType=4&ListId={552286A0-12A7-4E0D-8A6F-A9DE0173D445}&ID=",Id,"&ContentTypeID=0x0108010064E42B14ADA442C78E98D686760A8493002C26226B2F11FE40BF1902FE77506984")

    I'm having a real problem getting this to be an acual link though.  I have tried using the calculated value, but can't format as a link, I have also used the hyperlink function but can not concat around the Id.

    Any Ideas on how to make this a link? 

    Thank you,

    -B

  • 03-12-2012 01:30 PM In reply to

    Re: Add task link in InfoPath Form

    Can you have a field that has your formula for a calulated value? Then you can insert a hyperlink (IP 2010, Insert tab, Hyperlink) and use the field for the link....

    Hilary Stoupa

  • 03-12-2012 02:06 PM In reply to

    Re: Add task link in InfoPath Form

    Hello Hilary,

    yes and no.

    I can create a standard txt field "taskHyperLink", but I'm forced to put it in the main data connection and not part of my Odata connection.

    Thus the first txt field "taskHyperLink" = https://sharepoint.company.com/departments/legal/contractmgmt/_layouts/listform.aspx?PageType=4&ListId={552286A0-12A7-4E0D-8A6F-A9DE0173D445}&ID=704&ContentTypeID=0x0108010064E42B14ADA442C78E98D686760A8493002C26226B2F11FE40BF1902FE77506984

    I then inserted a hyperlink into the section with my odata connection and set the hyperlink = the 'main' txt field "taskHyperLink".

    This worked fine for the first one, but I am filtering and returning all tasks that are still pending, so that could be from 0 to 10+, the subsequent links all had the same as the first link... sorta makes sense.  Has to be a bit more dynamic somehow.

    crappy part is, that it works fine with the (fx) function, it's just not clickable.

    My Workflow Tasks Odata connection

    https://sharepiont.company.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/WorkflowTasks?$select=Id,RelatedContent,Outcome,AssignedToId,Title,Id,ContentTypeID&$filter=Outcome%20eq%20'Pending'

  • 03-12-2012 03:04 PM In reply to

    Re: Add task link in InfoPath Form

    Ah, got it - needs to be in the same data source.

    Do you have any fields in that data source you can... repurpose? That you aren't using in your form?

    If so, you could use rules, and set one of the fields in that data source to the formula for the URL....

    Hilary Stoupa

  • 03-13-2012 08:12 AM In reply to

    Re: Add task link in InfoPath Form

    Hmm..

    I must be setting up the rule incorrectly.

    From my Odata connection: https://sharepiont.company.com/departments/legal/contractmgmt/_vti_bin/listdata.svc/WorkflowTasks?$select=Id,RelatedContent,Outcome,AssignedToId,Title,Id,ContentTypeID&$filter=Outcome%20eq%20'Pending' 

    I was no longer using "Tilte" so I decided to repourpse it.

    I dragged "Title" onto the form

    I then added a rule to the button that was Changing My Rest URL and callig the data connection to set the field "Title" to "Id"

    1. Change Rest URL (filters by workflows pending for the logged on user)
    2. Call oData connection
    3. Modify the 'Title' field

    When ran, I do have the Id in all the Title field but only the first retrieved Id number.  ie.  Out of a list of 10 entries that came back from the oData call each one showed the Title=704 (same thing for all of them)

    • ID =704
    • Title=704
    • ID=799
    • Tile=704
    • ID=893
    • Title=704
  • 03-13-2012 08:36 AM In reply to

    Re: Add task link in InfoPath Form

    I should have used more words yesterday - sorry about that!

    So, you will need to repurpose two fields - and you'll have two rules. Let's pretend you are also not using "Version" and I'll use that to explain what I'm thinking. :-)

    Your 3rd step above will set Version to something it won't originally be - like 0. InfoPath will set all instances of Version to 0 (unless your rule is on a repeating node itself, the rule will affect all instances).

    Then, on Version, you'll have your rule 3 for modify the Title field. That way, as each instance of Version changes, your Title field can be set with the ID in its own row.... does that make sense?

    Hilary Stoupa

  • 03-13-2012 09:09 AM In reply to

    Re: Add task link in InfoPath Form

    Genius!

    Thank you!

    -Bob

    geek rating 5/5

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