Please I would like to know how to change the display name (in view mode) of a field in Vtiger 7 when linking a custom module to an existing module such as Account Module. It keeps displaying the default numbering field.
Please see the following 2 images: I would the text "INSURANCE-21" in Image 1 replaced for example by the Insurance company name let say "Williams Insurance Group" in Image 2.
Any idea please?
Please find what is Insurance Company Name of the field name into a database.
for example if field name like insurance_company_name then the queries become like that
UPDATE `vtiger_entityname` SET `fieldname`="insurance_company_name" WHERE `modulename` ='Accounts' and `tablename` = 'vtiger_account';
After a whole night and day of searching, I came out with a solution.
Not sure if any cons. but this is the fix that worked:
I updated this table vtiger_entityname and set the column fieldname to the name of the field that I would like to use as display name for the concerned module.
Hope it helps anyone who want to achieve the same result.
You must change module identifier. If you’ve ever tried to find an option to update a module identifier (the field that works as a link in a module) you most probably have noticed that vtiger do not allow this from the field editor. The only way to do it is using vtiger development library called Vtlib.
use the following code:
// Turn on debugging level
$Vtiger_Utils_Log = true;
$targetmodule = 'InsuranceCompanies';
$targetfield = 'insurance_company_name';
include_once('vtlib/Vtiger/Module.php');
include_once('vtlib/Vtiger/Field.php');
$module = Vtiger_Module::getInstance($targetmodule);
$field = Vtiger_Field::getInstance($targetfield, $module);
$module->unsetEntityIdentifier();
$module->setEntityIdentifier($field);
If you need to revert this back or make a backup, you need to backup the table vtiger_entityname
Related
I am working on a project where I am trying to check some validations but I find a risk of 'product_id' parameter is not properly sanitized upon submission to the index.php script, which can disclose the software's installation path resulting in a loss of confidentiality.
so after checking the format of product_id of products, its only in numeric but is there any possibility that the format may be alphanumeric and if yes then what exactly will be the behavior.
Don't change it's data type because it's relation exists in 5-6 tables, SO better create a new field for it's alphanumeric Id and control it using php..
The product id is the foriegn key for 5-6 tables eg) product option contains the product id as referance so please dont
I know I can extract Sales Order data in OpenCart database, in table shop_order and shop_order_product.
Is it possible to differentiate which user creates the sales order?
I don't think there's an option to identify which admin user created the order. You may need to code it yourself. The below steps may help you.
Add 2 new fields created_user_id and updated_user_id in order table - with default value as 0.
Update the admin/model/sale/order.php to insert values to those fields as $this->user->getId(); (addOrder and editOrder functions ).
Add a new field user_id in order_history table - with default value as 0.
Update the admin/model/sale/order.php to insert value to that field as $this->user->getId(); (function: addOrderHistory).
You can do these by directly modifying the files or using vqmod. If it's done via vqmod then it'll be easier for you to make changes during opencart version upgrade.
Opencart: Vqmod tutorial
Have a nice day!!
By default, there's no way to know which admin an order is created by, or even that the order isn't created by the user (other than the IP would be that of the admin). You could in theory add the user_id to the shop_order table, and pass that to the manual order editor when it creates the orders
i have several attribute sets in my magento store. (v. 1.6.2)
When i make a new product "socks" is the default attribute set. But i would like "clothing" to be the default.
How can i change this?
I hope anyone can help.
Original question didn't seem to get answered here and I was looking for what Ronny also wanted.
Found there has been an extension released that does it simply for you.
http://www.magentocommerce.com/magento-connect/default-attribute-set.html
Unfortunately, it's not possible. You should create new product.
To change an existing product attribute set, you can Create a new Attribute Set that contain all the attributes you need
You can either install this extension (Change Attribute Set) or make the changes in the database (you will need to know the products id and attribute set id)
To manually change (Always backup before making changes):
Go to eav_attribute_set table and look for the attribute_set_id of the newly create attribute set (you could also get this in the admin by look at the url www.xxxx/edit/id/10/key/xxx on Edit Attribute Set 'xxxx' page)
After you have a list of all the product ids and corresponding attribute set ids, then go to the table below and update those fields
Table Name : catalog_product_entity
Field Name : attribute_set_id
Field Name : entity_id // is product_id
Another way is to delete those product and recreate using the new attribute set.
It is possible to accomplish what you want by editing the database directly. Only do this if you are comfortable with MySQL commands or another tool like phpMyAdmin.
To make this change you will need to do two things.
Get the ID of your new attribute set, in this case your "clothing" attribute set. You can locate the id in the eav_attribute_set database table or in the browser URL when editing the attribute set from the Magento admin area. I prefer to just use the database since we need to go in there anyways to make the change.Table Name : eav_attribute_set
Column Name: attribute_set_id
Look for the row in the table that has the name you used when you created the new set - it should be pretty obvious, you'll see all the attribute set names in the column called attribute_set_name
Once you have the preferred attribute set ID you then need to visit the eav_entity_type table and update the value in default_attribute_set_id column for the row whereentity_type_id = 4 and entity_type_code = catalog_product. In a fresh installation of Magento, the value to look for in this column is also 4.
Table Name : eav_entity_type
Column Name: default_attribute_set_id
Done! Once you've changed the id value you will notice your preferred attribute set is the one selected by default the next time you go to create a new product. I believe this is what the question was asking for.
NOTE: This should work for both Magento 1 and 2. At the time of writing this post the current Magento versions are: 1.9.2.4 and 2.0.7
I need to access particular fields of a content type so that I can sort and display what I want accordingly. I do not have the Views module available because I do not have installation permissions, so I have to do this with a query and some php magic.
I received some very helpful information about the table names of fields for Drupal 7, but it appears that the organization/conventions for field values and where they are stored has changed since 6.
I found out in Drupal 7 that each content type field is stored in its own separate table. Assuming I had a field which I called group, the table name would be "field_data_field_group."
However, when I attempt to use this convention on my Drupal 6 site, it says this table does not exist.
My question is what is the name of the table fields are stored in? Or is it a completely different system than Drupal 7? Thanks for taking a look.
For Drupal 6, look in the following couple of places:
In the Drupal 6 database, look for a table that's called content_[your_field_name], for example, content_field_brief_description. Do a SELECT * to see what rows you have for that field table, if it exists.
Look for a table called content_type_[your_content_type], for example content_type_resource. Do the same with that table and see if you get any columns in that one for fields, other than the title/body that may be associated with that content type.
Let us know if that worked!
Edit:
Sample code:
$result = db_query("SELECT * FROM {table_name}");
while ($row = db_fetch_array($result)) {
// do something like drupal_set_message(var_dump($row));
}
Keep the curly brackets as are, but just replace that with the table name you're using at the moment...
The problem is :
There are two pages , one for editing name records and one for adding name records.
If I first open an edit page,then I open an add page , and input a name in add page
before I submit the name, I use the edit page to change the name,
(say change from varChar to integer type)
,after that, return to add page and submit the name.
Should this cause an error? How can I prevent this error?
In most web applications that I have used, the first valid request to be processed wins. I think you need to clarify your question, though, as it doesn't sound like the situation you describe would be possible, or it would not be a problem.
It sounds like NAME is a field in a record, not an entire record on its own. It doesn't seem like you could change the NAME field and add it at the same time. Let's imagine you have a record type PERSON that is backed by a table in your database. Each PERSON record has a NAME field that is currently of varChar type. It sounds like you are using a web interface to edit the structure of this table.
If the table already has a field NAME, the add page submission will report an error because a field called NAME already exists. The edit page would succeed, assuming it is possible to convert the NAME field to the integer type: either there are no records, or the value of NAME in every record can be converted to an integer.
Another interpretation of your question is that you are changing the NAME field to be something else entirely in the edit screen, perhaps from NAME varChar to AGE integer. You also happen to use the add page to add a new NAME char(10), for example. This would be allowed as long as the edit page submission is processed before the add page submission.