Sharepoint 2010 and infopath - access workflow variables? - variables

I have a workflow which runs every time a new list item is added.
The list item comprises of 3 fields:
a question,
a person to answer the question,
an answer.
The first 2 fields are supplied by the user who creates the list item, and the workflow routes the item to the expert who supplies #3, the answer.
On the answer form, I would like the question field to be populated with the question, however I can't drag the question field onto the form without it creating a repeating section, when it should be creating a textbox? It says the type is a group rather than just a string?
I'd also like to know how to get workflow variables into InfoPath forms.
Any ideas on how I'd go about creating a simple q&a collection workflow would be most appreciated.
The tl;dr part is the workflow needs to do this :
ask a question and specify a named user
route to user via workflow
get an answer from user
and that's it.

Your first issue is caused by the fact that your question node is a repeating node in your xml schema (see Data, Show fields, then double click the node and see that the Repeating check box is ticked). I suspect you probably wanted a repeating group with Question and Answer nodes. You would then drag the group onto the form. However it might be easier to simply hard code your schema to a specific number of questions as it'll save a bit of jiggery pokery getting the question text loaded in as you'll see below.
The second part is a little more involved and there are few good explainations on the web on how to do it. I have 2 books and neither are great at explaining this! Firstly you need to create a secondary datasource in the form and link it to an ItemMetadata.xml file which contains
<z:row xmlns:z="#RowsetSchema" ows_Question1="" />
<z:row xmlns:z="#RowsetSchema" ows_Question2="" />
etc. - note no root node exaclty like shown.
Then in your workflow you can set the value that your form will get in this secondary datasource at runtime by using something like:
MyFirstTaskTaskProperties.ExtendedProperties["Question1"] = "The text
of question 1";
In your infopath form you should set the default value of Main datasource question field to the node in the secondary datasource. Then when the thing runs it will work.
I hope you are reasonably familiar with SharePoint workflows as there are quite few other things you need to do to get an infopath form working in a workflow. In my experience it's quite painful getting it all working. Good luck my friend.

Related

open document with alternate form from a link

Similar to the functionality of using a form formula in a view, I would like to figure a way to provide someone with a link to a document via a URL and have it open in an alternate form. I'm trying not to modify the actual form value on the document, that gets messy to keep straight.
The form is a very complicated form with tabbed tables and 90% admin data, but I would like to turn over the maintenance of just one small set of fields to the user community without them seeing everything else.
Is there a way to force a link to open it BY WAY OF A VIEW that has a form formula? That is what I am thinking. Either that or I create/populate some smallish document when providing the link, then send them a link to this smaller document and have it update the 'parent' in it's webquerysave event.
Thanks,
Matt
If you want to open the document in Notes, you could try to send them a notes-URL, in the form of
notes://yourServer/yourDatabase.nsf/yourView/yourKey?OpenDocument
I remember having a conversation about this with one of the original developers of the Domino web server many, many years ago -- but I wasn't 100% certain that I remembered the answer correctly. So, I just searched through my old documents looking for a draft of the article I was writing when I had that conversation (in 1997!). It turns out that I didn't cover it in that particular article, but I did cover it several years later in one of the chapters that I wrote for the Lotus Notes & Domino 6 Programming Bible
You may be wondering why, since a UNID uniquely identifies any note, is it necessary to include both a Document UNID and a View UNID in a URL. The same question actually applies to doclinks, which were discussed above. The truth is that you don’t have to include a View UNID in either case, but it does serve a purpose if you do. You can replace the View UNID in a URL with a zero, retaining the slash characters that surround it. If you do this, Domino will not be able to execute a Form formula, which you may have included in the code of one or more Views in your application. See chapter 15 for more information about Form formulas.
In other words, if you include the UNID of a view that has the Form Formula that you wnat in the ?OpenDocument URL that you are sending to the server. The Form Formula will be respected.

How to show Assign To list for bugs work item?

I'm a tester and my manager has add new team project to the TFS and add my user and a developer user for this team project, when I've tried to add any type of work items the list of "Assigned To" shows all the users correctly, except for the "bug work item" only, I can't assigned to any user and shows that it is not in the list of supported values.
how can I solve this problem?
First, make sure the work item that you're manipulating currently in a state that has a valid transition to New. Otherwise, you will not be able to save the changes.
If you have customized the bug work item type. According to sounds like a rule in the bug workflow or field.
If you run the [witadmin exportwitd] command and export the bug work item type, look for the Assigned To Field and look at the rules on the field. Also take a look at the section and look at the rules for the transitions.
Also take a look at this similar question on TFS2015 Bug/Task unable to assign it to someone else than the user that creates it, try the suggestion mentioned in the link:
needed to give the relevant global top-level permissions for everyone
to view stuff
Just run the below in order to grant the needed rights :
tfssecurity /a+ Server FrameworkGlobalSecurity GenericRead
> "[DefaultCollection]\Project Collection Valid Users" ALLOW
> /collection:http://tfsserver:8080/tfs/DefaultCollection

Google Apps Script - google form "go to section based on answer"

I'm trying to create a google form which adapts each question based on the previous response. I realize that while google forms cannot be written dynamically, you can manually add in the option to "go to section based on answer" in the GUI editor.
My question is - is there a way to write this function go to section based on answer in a Google App Script? I will have hundreds of answers for some of my questions and it will not be possible to manually add them in. My answer choices will also be added from a google spreadsheet and automated to change every day.
Any other experiences or tips faking dynamic google forms appreciated.
I know this is old question, but as I was working on the similar problem, I am providing this answer just for reference.
You can create a new section, with desired questions, and continue on it, based only on the answers. You can use something like this code:
// Create multiple choice questionnaire
let aup = form.addMultipleChoiceItem()
.setTitle(NEWCOMER)
.setHelpText('Is this your first time using the App?');
// Creates a new section
var newcomerSection = form.addPageBreakItem()
.setTitle(NEWCOMER_TITLE)
.setHelpText('Please read and comply with Acceptable Use Policy');
// Based on the choice, we either continue to previously created section,
// or on the next section in line. You can also create two sections,
// and jump in the second answer to that section.
aup.setChoices([
aup.createChoice('Yes', newcomerSection),
aup.createChoice('No',FormApp.PageNavigationType.CONTINUE),
]);

Avoid creation of objects through SAP GUI

As a tester, I'd like to know whether it is possible to restrict the manual creation of new objects by the user. The restriction should be done programatically in ABAP, not by removal of permissions.
Background information: we have quite complex objects which are hard to set up manually. Therefore we have implemented a wizard, which does all the condition checking etc. when creating the object. Also, if the wizard shall work, the user must have appropriate permissions to create the object.
Is it possible to remove the object type for that complex object from the list which appears when creating a new object (pressing the New button)?
As I'm only a tester for this part of our software, I can't show any existing code. I just got the feedback "It's not possible" and that's hard to believe for me at the moment. Usability really suffers, because people try to create those objects manually and can't make it work.
I also don't need a working code example, just a hint (class or method or setting) for the developer where to find a solution. I'll then insist that he implements it :-)
Update
Today, the user can click the "New" icon. Then, a dialog appears with 4 choices. 3 choices are for simple objects which he shall create like this. However, the first item in that list is for the complex object, which is impossible to create manually (why we have the wizard). I'd like to know whether it is possible to remove that item from the list programatically.
ᵺṓᵯᶏᵴ, the information you have provided is still a bit vague. However, here is an idea that may work for you.
It might not be possible to completely automate this process, but you could ask your developer to enhance the code that processes the New button, so that it would reject any attempt to bypass the wizard for the first item on the list.
Your developer can tell you if it is feasible in your case, to have the enhancement raise an error (message of type E) to stop the user from proceeding.
This would have to be combined with end-user training to tell people to avoid the New button for that item, and use the wizard instead
ᵺṓᵯᶏᵴ, it looks like a custom dialog so it should be possible to remove it the option, alternatively if it is a standard dialog in a SAP app there is always a way to restrict it, it can be as simple as disallow entry from specific transaction codes. for example the developer could set a variable at the start of the wizard and then check for that variable when creating the object, if it not there he can show a dialog "Please use the Wizard we carefully crafted for your use......" Ok maybe you wont say all of that but you get it.
So the answer to your query is yes it can be done but the approach will depend on what it is your changing custom or standard object etc,.
Later..

Pre-populate initiation form values with InfoPath

I'm currently exploring some new features in SP2010, Designer and InfoPath regarding Workflows and Initiation Forms. What I want is to manual start a workflow on a existing list item, give the workflow some input values with the initiation form and then process the workflow in its whole.
The workflow is a sequential set of operations updating the current list item. No waits or other input is required. Once started it should complete immediately after the set-operations.
The problem is, I would like to pre-populate some of the initiation form parameters with values from the list item itself. The user then has the choice to change this, or leave it be.
I tried a couple of things, like trying to get a secondary data connection up and running using the query string parameter in the URL (id={id}). It looks like InfoPath and SharePoint automatically set some configuration settings, and that InfoPath is running in a cut-down version; less stuff to configure, no code behind.
Any tips, advice, solutions to my problem :-)?
Thanks in advance,
Patrick
The workflow process does not enter the init activity's codebehind until after the workflow's InfoPath Initiation Form has been submitted. There must be a way to sync the data fields of this form with those of the Association Form, based on the namespaces of the two forms, but I have not yet found exactly how to do that.