Unable to modify Webform field type in Drupal 7 - drupal-7

We are working on Drupal 7 and we need to modify the "webform field type" of an existing webform. But we are unable to do that. We have also tried by deleting the existing field "form key" and tried creating a new field with the same "form key" but the data of the existing column gets deleted.

#Ravi, you can use the following module to migrate data from the old field to the new field, you just need to map the fields. The module contains an example:
https://www.drupal.org/project/migrate_d2d
If the previous option is too complicated, you can do the following trick:
export the old field table as INSERT format from the database, the table name will looks like this:
field_data_field_name
Then, just replace the name table from the old field to the new field table.
Finally, just execute those insert into your database.
This is an example, how an insert statement looks from a drupal field
INSERT INTO field_data_field_name(entity_type,bundle,deleted,entity_id,revision_id,`language`,delta,field_address_type_value,field_address_type_format) VALUES
('entityform','solicitud_facturacion',0,656,656,'und',0,'AVENIDA',NULL);
I hope you understand this!

Related

Can we retrieve the field names from the models.py based on the column names in table from the database in a django project?

models.py: class Name(models.Model): name=models.TextField(db_column="Name_of_the_persion")
like this i defined the model, so that table 'Name' will be created on the database side, with column name as "Name_of_the_persion".
My requirement is like,I need to insert the new row in the table based on the django model field names instead of columns of tabel.
If any one knows, pls help me.
I tried inserting the data into table, by using psycopg2. But this was work in the case of pgadmin point of view only, that means its takes column names of database, instead of model fileds .

Creating array fields in console not possible?

I wanted to add a simple repeating string field to a table in bigquery but the console would only allow me to add a field of the type "record" which then could contain a single repeating string field, but I think that would result in an ARRAY of a STRUCT with one string field.
I used the ALTER table with ADD COLUMN Shelve ARRAY and that worked.
But why does google not allow to declare a field "repeating" in the edit schema tab in the console?
By using ALTER TABLE it was possible to create an an array field:
Why is this not possible in the console?
In "Mode" choose "REPEATED".

Autofill Form with the ability of entry of new records in the selected fields ms-access-2016

I am currently trying to make a database titled invoice management system for an organization who provide services in different departments. I have created three tables.Tables used in database with fields.
I have then created a query to create an autofill form based on Alias from InvoiceTable and all other fields from AttentionTable except Alias. Autofill Form with Alias from IvoiceTable and rest of the fields from AttentionTable. Alias in InvoiceTable is a combo box whose data source is Alias in AttentionTable. I just want to select Alias (InvoiceTable) from this form to automatically fill the rest of the fields of AttentionTable. Till that point I am successfull. But, I also want to add new record of AttentionTable from this form if the record is not available in the Alias dropdown list. I have tried multiple ways but in vain. I know that i can't enter new record in Alias field because Alias is a foreign key in InvoiceTable. Is there anyway to enter new record in foreign key and update the primary key with this record as I can't enter new records in this field if I need to enter a new record for attention table? I hope you got my point. (Althought I have created new form for first entering record for Attention table and then use this form, but I want All in one in this form)
I hope you help me to resolve my issue. Thanks in Advance.

MS Access default value from another table

I have two tables in a database. One is called salesreceipt and the other is salesreceiptlinedetail.
Each row in salesreceiptlinedetail has a field IDKEY that matches a field TxnID in a row in salesreceipt. There can be multiple rows in salesreceiptlinedetail that can match the same row in salesreceipt.
I have third party software that syncs my access database with Salesforce. The software only allows querying one table in the database at a time.
I need to automatically copy some of the fields from the salesreceipt table to new fields in the salesreceiptlinedetail table so I can sync the data correctly.
I'm very new to MS access. After trying many different things I landed on a solution that I think may work but I'm not sure how to do it. It looks like I can set the default value of a field. I'm thinking I need to do a DLookup to find the field I want to copy in the salesreceipt table and somehow use criteria to check the IDKEY matches the TxnID. I think I need to create a module with a function to do this but I'm not sure how and how to call it.
I may be way off on this. I could use some help or ideas. I've been researching for hours and could use a little push in the right direction. Thanks in advance.
Here's some things you can try, though I'm making some assumptions about the tables you've got and the result you're looking for.
So you've got a table called salesreceipt with an ID field TxnID and some other data (e.g. CustomerRef_FullName):
And then you've got a salesreceiptlinedetail table that has a field IDKEY field that matches back to salesreceipt table's TxnID field (i.e. a foreign key) and an empty field (e.g. FullName) that you want data for by matching the record back to the salesreceipt table.
I can think of a few ways of achieving this so that you end up with a table that has the information you want, but I'm not sure which is best for you. All these options shown are using Access 2013.
1) Get the data using a SELECT query and export those results across to your third-party software:
In Access, go to Create / Query Design:
Add your salesreceipt and salesreceiptlinedetail tables to your query and then close the Show Table window:
Click and drag on the TxnID field to the IDKEY field to create a join (represented by a line in Access):
Double-click on the IDKEY from your salesreceiptlinedetail and CustomerRef_FullName from your salesreceipt table; they should show as fields in the area at the bottom (if you have other fields you need then add those too, I'm just going on 1 field for illustrative purposes):
Click run to see the result of this query:
Hopefully this is showing a table that's starting to fill-in the blanks you want:
You can then save the query (right-click on the query table and chose "save" and name it whatever you want):
And export the results to a spreadsheet (assuming spreadsheet is the format your third-party software takes). Go to External Data / and then click "Excel" from the export group:
The query with the name you saved it as will be there in the Access Objects side-bar so that you can run it and export the results again (double-click on it to run it again):
The good thing about this method is that it's faster than using DLOOKUPs (these can be resource-heavy if you have a lot of records) and if there is new data/records in your salesreceipt and salesreceiptlinedetail tables, the query will run on that new data and include it in its results without you having to modify the query.
For your question though, it sounded like you might want to populate your salesreceiptlinedetail table with the data you need... this SELECT query will not do that. If you want to populate the actual salesreceiptlinedetail table you will need an UPDATE query...
2) Populate empty fields in salesreceiptlinedetail using an UPDATE query matched to records from salesreceipt
In this example, we're going to populate an empty field in salesreceiptlinedetail, namely the FullName field. We're going to do this by matching records in salesreceiptlinedetail to salesreceipt using the IDKEY and TxnID fields and then bring across the corresponding data in the CustomerRef_FullName field to the FullName field.
To do this, setup a new query the same way we did in (1) above and stop after you complete this stage:
Change the Query Type to an "Update" query:
Double-click the empty field you want to populate, e.g. FullName from the salesreceiptlinedetail table:
In the "Update To" box, type the name of the corresponding table and field you want to use to populate your empty field. Enclose the table and field each by a pair of square brackets and separate each by dot. So it should look something like this:
[salesreceipt].[CustomerRef_FullName]
In the criteria box, match your IDKEY and TxnID fields, like this:
[salesreceiptlinedetail].[IDKEY]=[salesreceipt].[TxnID]
Click "Run" and Access should show a warning that it is about to update some records in a table. Click Yes to allow it to do this:
If you go back to your salesreceiptlinedetail table, you should see that the once empty FullName field is now populated:
You can then save your UPDATE query for use again later - be aware that double-clicking on the query will open it AND run the UPDATE again (i.e. it will attempt to populate your salesreceiptlinedetail table with new data), so if you don't want that to happen you can right-click on it and open it Design View before opting to run it.
This method is good if you want to populate data in an already existing table, rather than essentially building a new table of results out of existing tables as described in (1) when we used a SELECT query.
If there's new data in salesreceiptlinedetail or salesreceipt, you'll want to run this UPDATE query again.
This is to add to Matt's answer. We have similar situations for a miniature reporting database, where we need to update the database several times through out the day. We wrap the query in a function and schedule a task in Windows to run every 4 hours that executes the Access function and updates the data.

Trying to find name of TFS DB Table containing custom field data

I have a quick question, what is the name of the TFS 2010 database table that contains values for any custom fields.
I did a query against the TFS_Warehouse DB and the dbo.DimWorkItem table. However, I cannot find any of my custom work item fields under this table.
Can someone point me to the correct TFS 2010 table containing the custom field data? When I worked with Quality Center, the tables were pretty well defined so it was easy to do backend DB queries. TFS does not seem that intuitive.
Thanks
you have to add "reportable" to field definition.
Example - FIELD name="Scope" refname="xxx.Scope" type="String" reportable="dimension"
Wait few minutes and you'll see field in warehouse DB
look,
you need to go to your collection database, and to check a table called something like Fields.
there, you will find the new field properties and the type as well.
you can change the type to string and to be reportable.
go to the table of the WORKITEMLATEST, and check the field- you can see the name of the field like what was mentioned in the FIELDS table,.
open your work item normally, edit that field information, click save...
you can see your data updated in the WORKITEMLATEST table
BUT...
the problem is the STRING type is limited... I tried to add more text.. it keep telling me that number of character is over limit !

Resources