I am displaying a list of purchase orders and each "line item" corresponding to it so its basically nested in a table.
ie:
PO# | Item | Qty Ordered | Qty Received |
1
123 20 [form Field]
345 10 [form field]
5
232 5 [form field]
What I am trying to do is provide a single (unmapped) field for each line item called "quantity received" which the user will type a number in there and save the form. I currently setup my code to have a few collection types nested. For example, my initial FormType starts with my user. Then users have "PurchaseOrders" so I add a collection type of "PurchaseOrders" (PurchaseOrderType), then inside that PurchaseOrderType I have a collectiontype of PurchaseOrderItems (PurchaseOrderItemType) (these are the line items). In that form type I have a single unmapped field called "quantityReceived" (NumberType).
Everything seems to work fine with the form except I dont have a way to place the correct field in the correct row in the table. In my template I have a nested loop to loop through my PurchaseOrders and their corresponding PurchaseOrderItems for the purpose of displaying data in the table shown below. How can I render the correct form field in line with the data I am already displaying? The problem is that collections create field names using sequential index numbers starting with [0], so that does not correspond to the ID of the "PurchaseOrderItem" so as I am looping through each PurchaseOrderItem i feel like I dont have a reliable way to select the correct form field to place into that row.
So it seems that I have resolved this issue by instead of looping through my entities, I loop through my form instead and access the necessary variables for display purposes by using form.fieldName.vars.value.[propertyName]
Related
Table Screenshot I need a single row of Engineer with count 2 in head count
I have attached a screenshot. Category fields are fetched from a subform rows and rows can contain similar categories. I want to show category only once in this table with its count in head count. For example Engineer - 2 and not as it is currently being shown.
Use the distinct option from Zoho Creator data access task to get the unique list of Category. Then use this list to fetch the count of each item.
This also depends on how the subform was included in the main form and whether you are looking to fetch the count per each record of the main form or for all records in the main form.
If the subform was directly created insider the main form, you will have to follow the above method. If the subform was created separately and then embedded into the main form, you can directly apply the Count and Distinct operations instead of iterating through all values.
Store the Category in the list. in loop check, if the category already exists or not then add into list.
I want collect Financial historical data from NASDAQ link https://www.nasdaq.com/symbol/ge/historical. In this I am spying date element and using "get table" I can get whole table data for date, open, high,... which I am putting in collection but the thing is I am not able to give column name to collection. I made 6 field for each all 6 column you can see in image attched. But when i run the programv I get an error "Internal : Collection fields are defined but cannot be matched to the incoming collection - The collection definition does not contain the field Column1". if I dont add field I get data in collection which has default column name column 1, column 2, ...column 6 . But I want to have their specific column name. I think the problem is with the data type I am using while creating field in collection. I tried different combination for the data type but still...Please help me on that. enter image description hereimage 1image 2
image 3image 4
The error is exactly as it says; the fields cannot be matched; in other words, the fields should match. Since you get default field names from the Read stage, then you should either rename the fields before passing the collection to the process or have the collection receiving the collection at the process level have no fields defined (it will get the headers defined from the object and you can rename the fields after that, or just use the default column names, but that's not practical).
To rename the fields, you can use the default object "Utility - Collection Manipulation", either actions "Rename Collection Fields" or "Rename Field".
Rename Collection Fields
You will have to supply the collection containing the read table (Main Collection) and a collection containing the same headers as the collection containing the read table (New Headers), and in the first row, the new headers (it was designed like that, it's not that intuitive; it took me a good while to figure it out). The collection New Headers should look like the below:
Rename Field
For this one, you will need to loop over each header. Collection In will be the collection containing the read table, and you insert each header to change one at a time. (e.g. first loop iteration will have Column1 as Field Name and date as New Name, second loop iteration will have Column2 and open, etc)
I have a workflow to manage employee petitions, that starts with some fields at starter form. The next task, allows a responsable user to approve or reject the initiator user's petition.
I want to show the values of starting form into the approve/reject form, so I created a custom .ftl file for every field that I want print the label and the value. Now I have hard-coded the values to the this:
My problem here, is how to get the value from the first form and print it at the second form (values that I need are where says "200€" and my name).
I'm using Alfresco Community 5.1 and his own Activiti.
Thanks.
Solution 1 : keep IDs of the fields identical in both the forms. this will make the field editable in the second form.
Solution 2 : create a process variable, set its value after the first form has been submitted. then, in the second form display the value of the process variable.
I am trying to create a report putting a field called contact which has the name of a person. This name is linked directly to another table where I keep all the contacts.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
Another alternative would be to change the Control Source of the report's Text Box control to have it do a DLookUp() on the table. If the lookup field is named [client] then changing the Control Source of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
would also work.
I wanted to add to the great answer by Gord:
When using a "web" database (started in Access 2007 I think), you cannot change a report's fields to ComboBox style, nor can you use DLookUp(). (web databases lack a ton of features)
The workaround for this, if you want to create a Web-Report that uses lookup fields, is to create a Web-Query first based on your Web-Table (all the Web-* stuff has a www planet icon over the logo, if you create a new Web-DB in Access 2007+ you'll see what I mean)
So, instead of Table -> Report, you'll have to do W-Table -> W-Query -> W-Report.
Then, the only thing you need to customize to get the data right is the W-Query. Start by trying to reproduce the look in the query to match what you want users to see in the report. Note that here in the query, lookups will work fine (instead of the unique ID's, you get field names like you want). However, this will not carry over to the report. To do that, you gotta get the actual text field name you want into the query:
You should already have one table in your query; start by adding the table that your first lookup field points to. For example, the table I want to print is called Stock_Boards, and it has a lookup field called PCBID_lookup that points to the table Stock_PCBs.
Since you're using lookup fields, there should already be a relationship line between the two tables when you add the second one. If there isn't, something has gone horribly wrong.
Now, see how that line connects two fields on the two different tables? For example, I've got my PCBID_lookup field on my Stock_Boards table, which connects to the ID field on my Stock_PCBs table. If I created a report from this now, PCBID_lookup would be a number, a number that correlates to the ID of a record on Stock_PCBs.
To fix it, I will add the name field I want to show up on the report. In my example, that happens to be a Part Number, rather than the ID. I add the PartNumber field from my Stock_PCBs table to the query, and remove the PCBID_lookup field of the Stock_Boards table from my query.
Since PartNumber is what I want to show up on my report, it effectively replaces the original field (PCBID_lookup)
Repeat for all lookup fields you want in your report.
I had 1 more: I removed the Status field of the Stock_Boards table (which was an ID/Lookup) and added the 'Status' field from the Status table (which was the actual text name)
When finished, your query should look exactly how you want the data to appear, without any special tricks or asking Access to do something unnatural. Save your query, and create a web-report from it. Done!
I've got two content types, both have a node title and a document attachment, the doc attachment fields are different names (being from two different content types).
In my view, I'm displaying the node title and the file name in a table. The node titles are great all in one column, but the two content typed attachment fields are displaying in two separate columns, making three columns total when there should only be two. Every row has a single doc title, but one or the other column is always blank now depending on which content type's doc title is displayed.
How can I combine these two fields to display in the same column so it looks seamless? It is not important to know that these docs came from two different content types. These are organized by larger taxonomy terms so it's not feasible to just do two different views.
Alas, the answer was right in the views help:
Column
By default, each field is its own
column. However, you can place
multiple fields in the same column. To
do this, pick which field you want to
represent the column, then pick
another field and set the 'column'
value to that field. You can place as
many fields as you like in a single
column, but only the main field in a
column can be click-sorted.
I found this answer and it works for me:
http://drupal.org/node/1120304#comment-5111606
You can use any field as a token in another field in the default Views module.
So if you want to concat text fields together, say you have field A with value "Hello" and field B with value "World" and you want a concat field with value "Hello World":
1) Edit field A, choose exclude from display, do the same thing with field B
2) Create field C as Global: Text and ensure that it is ordered after field A and field B (you can only use fields as tokens if they are defined before the target field).
3) You can now see the replacement patterns available to you just under the value textarea in field C. It will be something like [field A] [field B]
Now if you want to calculate a number field based on 2 other fields the method is similar to concat, except for field C you would use the Global: Math Expression field:
1) Edit field A, choose exclude from display, do the same thing with field B
2) Create field C as Global: Math Expression and ensure that it is ordered after field A and field B (you can only use fields as tokens if they are defined before the target field).
3) You can now see the replacement patterns available to you just under the value textarea in field C. It will be something like [field A]+[field B]