Change duplicate handling of records - vtiger

How can defaults of First Name and Last Name from Leads module duplicate handling "fields to be matched on" can be replaced with custom fields?
I need to overwrite that default behavior so some records can be merged when my custom criteria matches

Related

Doctrine returning strange field names from query

I am using "doctrine/doctrine-orm-module": "^2.1" (it is a module for zend framework 3). I want to create a query which will return rows with field names (trivial, right?). But instead of exact names of fields I am getting this query result:
SELECT
u0_.id AS id_0, u0_.username AS username_1, u0_.email AS email_2,
u0_.first_name AS first_name_3, u0_.last_name AS last_name_4,
u0_.password AS password_5, u0_.status AS status_6, u0_.created AS created_7,
u0_.modified AS modified_8
FROM
user_item u0_
ORDER BY
u0_.id DESC
This query is generated by this code:
$entityManager = $this->getEntityManager();
$queryBuilder = $entityManager->createQueryBuilder();
$queryBuilder->select('u')
->from(UserItem::class, 'u')
->orderBy('u.id', 'DESC')
;
$query = $queryBuilder->getQuery();
echo $query->getSql();
print_r($query->getParameters());
die('|||');
What is the "0_" appending to the table name? What is appendings "_x" to the fields name?
How can I get normal fields and tables names without appended "_x"?
Just names, I'm assuming both the first_name and last_name as shown in that generated SQL, right?
I changed the order below, makes it easier to read / understand.
What you want to do is (pseudo code): Select from UserItem all the first & last names
So, write the code that way :)
$queryBuilder
->from(UserItem::class, 'u')
->select(['u.first_name', 'u.last_name'])
->orderBy('u.id', 'DESC'); // Might want to sort by either u.first_name or u.last_name
What's in the QueryBuilder?
->from(UserItem::class, 'u') - First parameter is the FQCN (Fully Qualified Class Name) of the Entity you wish to use with the QueryBuilder. Not required is the second parameter, which is an alias to use for this instance of the QueryBuilder to recognize the FQCN defined class by. (Off of the top of my head it defaults to snake_case'd names of the class, in this case "user_item")
->select(['u.first_name', 'u.last_name']) - Function takes a "mixed" param. Click through to its definition and you'll see the following in the function:
$selects = is_array($select) ? $select : func_get_args();
Which indicates that it will always pass the "$selects" on the next bit as an array. (Another hint is that $selects is plural)
->orderBy('u.id', 'DESC') - Creates a rule to order results by. If you click through to this function, you'll see that this one ends like so:
return $this->add('orderBy', $orderBy);
Meaning: you can add more than 1 order by.
When it comes to the generated DQL:
u0_ is the table alias as defined in the DQL, from your question: FROM user_item u0_, this will later be transformed to MySQL (usually) which will be the same. It sets u0_ as an alias for user_item.
The _* appended to property names is just plain the order of the columns as they've been created in the database (have a look, they'll be in that order).
Lastly, the fact you were receiving entire entities and not just the names (first_name & last_name) is due to ->select('u'). Because no property (or properties as shown above) is defined, Doctrine assumes you wish to receive the whole enchalada. Doing ->select('u.first_name') would then get you just the first names, and using an array as above would get you more than 1 property.
Hope that helped you out :)

TFS 2013 backslash in custom field

I am trying to add a custom field in a work item template using TFS power tools. I add the new field and use the "ALLOWEDVALUES" rule to add some values. It allows me to put backslash character in the value field however when I try to save the work item, it throws an error: VS402504: User or group cannot be found: Category\SubCategory. Verify that the users and groups used in your work item type definition exist.
I could find a way to escape the backslash character. Is it not possible to put backslash characters in custom fields?
The backslash is supported in the filed value.
ALLOWEDVALUES Defines a list of allowed values for the field. Allowed values are values that are available for selection in a field
list on work item forms and in the query builder. You must select from
one of these values.
Note: When you use ALLOWEDVALUES to define a list of values that users can specify in a work item form or the query editor. Users must specify one of the values in the GLOBALLIST or the set of LISTITEM entries.
A sample of value for your referenceļ¼š
<LISTITEM value="Emergency"/>
<LISTITEM value="Major"/>
<LISTITEM value="Minor"/>
<LISTITEM value="Domain\joe"/>
<LISTITEM value="[Global]\GlobalGroup" />
<LISTITEM value="[Project]\ProjectGroup" />
More details about related info please take a look at official tutorial: Define pick lists
For field pattern value: ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)+$, also check the field definition here.
Update:
If the field value contain backslash(\) characters, it will be parsed to an IdentityName(account) by default. As a workaround, you could try to use / instead. Take a look at this similar question: Is there any way to use a backslash in a TFS Global List value?

Calcite LogicalAggregate

What is a proper way to associate an AggregateCall that is part of a HAVING expression with a corresponding field in a RelRecordType for the LogicalAggregate? If the AggregateCall is not part of the SELECT clause, the LogicalAggregate's RelRecordType still has it, but the AggregateCall's name attribute is set to NULL and RelRecordType.getField(AggregateCall.getName()) can't be used in this case. If the AggregateCall is a part of the final output, its name is set and RelRecordType.getField(AggregateCall.getName()) returns the right field.
Use field ordinals rather than names.
In the world of Calcite RelNodes and RexNodes, field names are not that important; they exist mainly to help you understand the purpose of fields when debugging. Names of AggregateCalls are even less important; they exist so that Aggregate can give reasonable names to its fields, and if they don't exist, that's fine.
If your SELECT has N fields (numbered 0 .. N-1) and a HAVING clause, you will likely add the HAVING predicate as field N, apply a Filter relational operator, then apply a Project so that only fields 0 .. N-1 are returned. I'm pretty sure that this is what SqlToRelConverter does already.

Replacing Part of a String in Access Query - Wildcard Characters

I have an old hyperlink field that was never linked to the correct path. The field still has relevance though in that it contains the filename associated with the record. I'm trying to update this field by removing the path and leaving just the filename. Hyperlink functionality is not needed.
I've already converted the field to text and removed the hashes so all that remains is the incomplete filepath string. The paths are all similar in format but vary in foldername\filename.
"FOLDERNAME\FILENAME.tif"
In example: "RESEARCH LAB 22\RESEARCH LAB 22 001.tif"
I have the following query, but it requires replacing the foldername manually.
UPDATE BAT1_Document SET BAT1_Document.HYPERLINK = Replace([Hyperlink],"RESEARCH LAB 22\","");
Replacing "*\" with "" would cover my needs but my understanding is that wildcard characters can't be used in a Replace update query so I am at a loss as to how to implement this.
If there are allways "FOLDERNAME\FILENAME.tif" then try:
UPDATE BAT1_Document SET BAT1_Document.HYPERLINK = mid([Hyperlink],instr(1,[Hyperlink],"\")+1);

Dropdown values customization in NetSuite

There is a custom record type configured in NS. It has a name and a free-form text field called full_name. Name is a standard field, full_name is a custom field. There is another record type which has a field of type List/Record with the previous type. On the form this field is present as drop-down. The drop-down show names of records. The goal is to show full names instead of names in the drop-down. Is it possible to mark somehow full_name field so it is available in the drop-down view instead of just name? Any ideas how to achieve this with NS?
Depending on your exact needs, it may make sense to add another custom field to the record containing your drop down. You can source this field from the full_name field on the custom record. This field does not need to store the value if it's only for display purposes.
Add a new field to the record containing the drop down
Set the type to be text
Name it appropriately
Under the 'Sourcing and Filtering' tab, set the source by field to the drop down
A field with type List/Record type can only show standard Name field. However, you can create a custom field dynamically on before record load of a user event script. Check the nlobjForm.addField. Please keep in mind that the value of it will not be saved. Saving the value is another story.