Bind InfoPath control to two SmartObject methods

  • 21 April 2008
  • 2 replies
  • 0 views

Badge +5

I'm not sure if this is possible but I am trying to achive the following:


 I have a re-submit stage on an approval workflow where the user can see why their submission was rejected and have the option to make changes and re-submit. I have bound all the textboxes to the Save input parameters for the SmartObject, then I call this when the form is submitted, passing it the ID for the form. Pretty standard so far. What I am struggling with however is getting the textboxes to show the current values stored for that ID in the SmartObject. On the approval view I have done this by binding the controls to the properties for the Load method and then call that when the form loads. Obviously I can't do the same in the re-submit view because the controls are already bound to the properties of the Save method. I've tried using rules on the textboxes to call the Load method but these rules don't appear to be called when the form loads.


 Has anyone else achieved something like this?


 Thanks


2 replies

Badge +5
Nevermind I have figured it out! When the form loads I call the Load method of the SmartObject to get the values, then have an open rule to set the value of the Save property to be equal to the return property from the Load method.
Badge +9

I assume based upon your previous posts you are using an InfoPath form.  Please correct me if this is not the case for this post.


Within InfoPath a control can only be bound to one element within a specific datasource.  Each SmartObject method is an individual secondary datasource.  Thus there is not way, at least that I'm aware of, to dynamically switch control bindings between datasources. 


When I've needed to do as you describe, I typically bind the controls on the form to the Load method (as you describe).  I then manually create a Submit rule that appropriately maps the properties from my Load datasource to my Save datasource.  I then call the Save method.  Both of these rules must be invoked before the 'Submit Workflow' rule in the 'Rules for Submitting Forms' dialog to make sure the SmartObject data is saved before the workflow is submitted to.


If anyone has an easier way to handle this in InfoPath, I'd welcome any additional suggestions.

Reply