Logical Sums - Rules or Code?

J

Jim Duncan

Infopath 2007
Target deployment is browser-base forms (via SharePoint Forms Services).

Given a (partial) data structure like this:
<LineItems>
<LineItem IsApproved="false">
<GLCode>aaaaaaa</GLCode>
<GLAmount>xxx.xx</GLAmount>
</LineItem>
...
</LineItems>
<Approvals ApprovalDueDate="xxxxxxxxx">
<Approval GLCode="aaaaaaa">
<Approvers>
<Approver Name="x" Email="x" Login="x" Approved="false">
Approver Comments Go Here
</Approver>
<Approver Name="y" Email="y" Login="y" Approved="false">
Approver Comments Go Here
</Approver>
</Approvers>
</Approval>
...
</Approvals>

Question 1: Would it make things any easier (better) if <GLCode> and
<GLAmount> were attributes of <LineItem> instead of child elements?

Question 2: How do I construct rules (preferred) or code to set the
IsApproved value for all <LineItem>s with the matching <GLCode> based
logically on the Approved attribute of ALL the <Approver>s in the <Approval>
with the matching GLCode attribute?

Written another way:
When the Approved attribute is "true" for ALL of the <Approver>s for
<Approval GLCode="aaaaaaa"> I want to set IsApproved="true" on all
<LineItem>s with the <GLCode>of "aaaaaaa"

Can this be done with Rules or do i need to write managed code?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top