how to check row already exist in repeating table in infopath? - infopath-2007

Hello
I have repeating table on my infopath form. It is bound with xml file through web service. my form have submit button. I am able to submit data from infopath for to xml document via web service. I want to validate my repeating table to avoid duplicate records. how to do this validation. ? please guide me I am new for this.

You must use validation rule.
You must select specific field of repeating table.
Add validation rule to it.
Select the expression and add rule:
../my:fzScopeName = ../preceding-sibling::my:fzItem/my:fzScopeName
or
../my:fzScopeName = ../following-sibling::my:fzItem/my:fzScopeName
Note that: My field name is fzScopeName and fzItem is parent it, as same repeating table structure. see this image

Related

Using Splunk Dashboard how to create a filter for each column of a table

I have a table that I saved as a report and created a dashboard that displays the table.
I want to add inputs for each field on the table to be able to filter the table data.
This is the table
I added a text box as the first input
How do I link the text box that has a token called purchCostReferenceToken to the purchCostReference column on the table?
Strictly speaking, the input and the table are not related. The input controls the search and the table is one way to represent the results of the search.
To control the search, use the input token in it. Use dollar signs to denote the token. For example,
index=foo purchCostReference=$purchCostReferenceToken$ | ...
You will need a default value for the token to make this work when no input is provided. Usually, that value is *.

PDI /Kettle - Passing data from previous hop to database query

I'm new to PDI and Kettle, and what I thought was a simple experiment to teach myself some basics has turned into a lot of frustration.
I want to check a database to see if a particular record exists (i.e. vendor). I would like to get the name of the vendor from reading a flat file (.CSV).
My first hurdle selecting only the vendor name from 8 fields in the CSV
The second hurdle is how to use that vendor name as a variable in a database query.
My third issue is what type of step to use for the database lookup.
I tried a dynamic SQL query, but I couldn't determine how to build the query using a variable, then how to pass the desired value to the variable.
The database table (VendorRatings) has 30 fields, one of which is vendor. The CSV also has 8 fields, one of which is also vendor.
My best effort was to use a dynamic query using:
SELECT * FROM VENDORRATINGS WHERE VENDOR = ?
How do I programmatically assign the desired value to "?" in the query? Specifically, how do I link the output of a specific field from Text File Input to the "vendor = ?" SQL query?
The best practice is a Stream lookup. For each record in the main flow (VendorRating) lookup in the reference file (the CSV) for the vendor details (lookup fields), based on its identifier (possibly its number or name or firstname+lastname).
First "hurdle" : Once the path of the csv file defined, press the Get field button.
It will take the first line as header to know the field names and explore the first 100 (customizable) record to determine the field types.
If the name is not on the first line, uncheck the Header row present, press the Get field button, and then change the name on the panel.
If there is more than one header row or other complexities, use the Text file input.
The same is valid for the lookup step: use the Get lookup field button and delete the fields you do not need.
Due to the fact that
There is at most one vendorrating per vendor.
You have to do something if there is no match.
I suggest the following flow:
Read the CSV and for each row look up in the table (i.e.: the lookup table is the SQL table rather that the CSV file). And put default upon not matching. I suggest something really visible like "--- NO MATCH ---".
Then, in case of no match, the filter redirect the flow to the alternative action (here: insert into the SQL table). Then the two flows and merged into the downstream flow.

VBA access and forms

I created a database in Access and there are some type of records in some tables that requires a particular inserting, so I decided to use VBA to handle this.
The problem is that if i create a form with some controls which i want to refer and use their values as criteria for queries, the form is still a way to insert data. So the query works but the data i inserted are added directly from the form too, creating duplicates.
The question is, is there a way to create a form that has controls only for text input but does nothing to record , leaving inserting, deleting , updating all to queries in VBA?
I tried to put "no" on propriety "add records" in the form but it gets totally blank with no controls.
Your form must be unbound, i.e. its RecordSource must be empty.
Your form can be bound or not bound to a table / query.
This means that the controls on your form may be bound to a field of that table / query.
But you can also have controls in the same form which are not bound.
Example:
You can make a form in which the body has a list view of the records of the table. In this section the controls would be bound to a field.
In the header of the table instead you may have controls that are not bound and that could be used either to filter the records shown or to add new records. You may want to add records this way rather than let users insert data directly in order to add checks or do any other kind of processing before actually adding the data in a new record.

How to handle search for custom fields in form for FROM and TO fields?

I have just started implementing search module in a project, where I have a form with fixed fields consisting of combo box, text box, radio button etc (around 200 fields in multiple tabs), and later client should be able to add extra fields too. Once user fills the fields which he wants to search, that search criteria also he should be able to save. For all these reasons, for each field I am associating metadata in the following format.
"EntityName.attributeName": attributeValue
Once the user fills the form fields to search, I will validate form data and and only non empty fields metadata I am sending to server in JSON format. Everything is fine till now. But I am facing an issues now.
Using the metadata of each field I will create a new criteria for each field. but if there are fields where one field metadata depends on other field metadata I am struck.
In the form I have few special category fields in following format : for example DOB,
FROM DATE (meta data: entity1.dob)
TO DATE (meta data: entity1.dob)
both fields belongs to same entity and same column only field name in the UI is different
Like this I have around 20 fields which asks for FROM and TO to query the range (it need not be on date, for example no of bed rooms..it can be on integer, string etc)
My query formation should be in the following way depending on user search criteria. If user entered only FROM field of number of bed rooms then I have to query using EQUAL to operator in sql and if both mentioned then MORETHANEQUAL to for FROM field and LESSTHANEQUAL to for to field. So how I can handle this special case ?
like if he entered number of fields as 4 in TO field of number of bed rooms, then I have to query for houses having number of bed rooms equal to 4. but if in FROM he entered 3 and in To if he entered 7 then I have to query for houses having greater than or equal to 3 bed rooms and less than or equal to 7 bed rooms.
Since I have same metadata for these category fields also I am unable to proceed, to achieve this, what kind of metadata I need to prepare ?
How I can generalize this process to handle all the cases ?
my technology stack: ExtJs, Eclipse Link, spring.
and what are the best practices to follow to support custom fields adding feature in Forms in enterprise applications ?
Off of the top of my head, I would create wizards for these particular cases. So for example, have a custom wizard that allows the user to define a "from" field, a "to" field, and then the comparison operator in one action. This wizard could also be responsible for adding custom properties to the generated fields that could be used by your validation routine. So based on the combo of from, to, and operator, you could create a flexible validation mechanism for ensuring that correct values are entered, ranges are correct, whatever.
You might consider this "wizard" approach for all custom fields, in fact. I could see you predefining all the possible custom field types that could be used and create classes that can be used for those. The classes could be responsible not only for the field creation, but also for providing any custom validation, pre-submit transformation, etc. This approach would make adding new custom field types incredibly simple since all you'd have to do is follow the same implementation as the others that already exist, extend an existing one, etc.

how to add items to combo box in lightswitch

I'm new to lightswitch and i searched lot, but couldn't find proper solution for this simple question. I need to add items to combo box, based on user selection. ( not from existing table)
For example if user select country ,following towns must add to combo box.
USA - Texas, New York etc
UK - London , Surrey
How can i do this? i'm using vb.net as my back end. i found this article How to create an unbound combobox as useful one. but couldn't able work according to my scenario.
what is the way to add items to combo box?
In Lightswitch, if you want to have a dynamic set of data bound to a control, that data must be in a table. You then need to create a query that filters the data in that table based on the user's selection and bind your control to that query.
Here is a pair of articles that describes implementing a situation that is similar to yours:
Nested AutoCompleteBox for data entry
Nested AutoCompleteBox for data entry Part 2
We can't directly assign our own values to combo box. we have to use either data table ( as mentioned by embedded.kyle ) or we have to create custom control to assign values.
i have used custom User Control for above scenario. detail step that i followed can be found in following Link
Adding a record that doesn't already exist in a bound table is a very common scenario. Unfortunately, there's no out-of-the-box way to do this in LightSwitch, you simply have to write code to achieve it, like in this blog post.
Add non existent records using AutoCompleteBox
Or, of course as was also suggested, you could create a custom control to do the job.