IEF reference show parent field as title using Auto Entity Label - drupal

I am new to Drupal 8 want to add a field value to IEF reference title. for now I am using Auto Entity Label version 2.x-dev to automatically generate title for my Entities but when it comes to IEF references I wan to get name of parent as title of IEF. as example see below image
Then I wan to add a new IEF entity which is using Auto Entity label to generate title automatically
As you can see it only says 15% complete but I want it to be Stack Overflow 15% Complete
here is tokens that I selected to Auto Entity label to show name in IEF reference.
[entity-x:field_name] - [task:field_percent_complete] % Completed
This token pattern placed inside Task entity
Note: I Entity-x and Task are two different Entity in system

Related

Vaadin grid - gridpro ComboBox Editor

Grid Pro features three recommended built-in editors: Text Field, Checkbox, and Select.
Ho can you manage a list with key and value properties?
For example:
Country list
I'm unable to show country name in the select value and save the id in the database record.
I usually rely on ComboBox when I manage a list with key and value.
Combobox is not present in the list of built-in editors.
Do you suggest to write your own editor?
Let's assume you have a Country class with the properties id and name. And a Person class with a country property. You display a GridPro<Person>.
You can make a Select editor and define it's itemLabelGenerator (or renderer, if you want to show a flag or something) to show Country::getName. **
The saving to the database should be handled by the annotations on the relation. Usually using JPA, there would be a #ManyToOne relation between Person and Country, and save the country-FK (id, specified using #Id) in the person table.
** I don't use Grid Pro, but upon inspection of the code I can see that by using gridPro.addEditColumn(Person::getCountry).select(Person::setCountry, countriesList) you cannot specify the itemLabelGenerator/renderer.
However, you could prepare your own Select component and use the EditColumnConfigurator::custommethod.
Select<Country> countryEditorComponent = new Select<>();
countryEditorComponent.setItems(countriesList);
countryEditorComponent.setItemLabelGenerator(country -> country.getName());
gridPro.addEditColumn(Person::getCountry).custom(countryEditorComponent , Person::setCountry).setHeader("Country");

Table relation error value not within the range

Ax 2012 R3. I’ve created a new table to hold group data (let’s call it AgencyTable); I’ve created a RefRecId that references AgencyTable and extends RefRecId (lets call it AgencyTableRefRecId).
I’ve created another new table called RatingsTable, to which I’ve added the AgencyTableRefRecId. The RatingsTable has a relation to the AgencyTable on the AgencyTableRefRecId (Cardinality = OneMore; RelatedTableCardinality = ExactlyOne; RelationshipType = Association).
I’ve also added a reference in RatingsTable to the BankAccountTable and created a relation on the BankAccountId.
I have an AgencyTable record. When I create a record in the RatingsTable, and click the field that references the AgencyTable, I get a dropdown and can see the AgencyTable record, but when I select the record I get error: “The value is not within the range. Acceptable values are in the range -9223372036854775808 - 9223372036854775808” (the max and min of int64).
This is such a simple relation and common way of relating data. I’ve checked my edt; I’ve checked the relation and can’t find what is causing the problem. (The relation to BankAccount works fine).
The datadictionary has been sync’ed. The AOS was recently restarted.
What is causing the issue?
It is important the relation to AgencyTable is created as as ForeignKey relation to the primary key.
If the relation to extended data type is created correctly you will be prompted to create the relation when you drag and drop it to the RatingsTable field node.
If you answer Yes, it will be created correctly.
Also the form control should be of type "Reference group" to work as expected, this is not the case if you use the table browser.

MS CRM 2013 Process Update Account - multiple values to one field

I'm trying to implement an update procedure like the one in this blog post (via extra entity and workflow updating account, triggered when the new entity is being created)
http://www.powerobjects.com/2013/08/01/updating-records-in-microsoft-dynamics-crm/
In my list and the new entity "Account Update" I have 3 fields for the full name of a company (name, name_2, name_3).
In my workflow I want to put these 3 together and combine their values in the Account field "Company" (the company's name).
In the process I tried to insert them via the "Form Assistant" and in the field "Company" I now have the following entry:
{Name(Account Update);Name_2(Account Update);Name_3(Account Update)}
but it doesn't seem to work. After my import and update of the account (which ends successful) the value in "Company" is only the value of the first name field.
Is it possible to combine values?
What exactly does it do, when I choose more than one field in the Form Assistant and say OK?
So at last I figured out how to archive it.
With the "Form Assistant" you can combine or add multiple field values to one new field but it is a bit tricky.
The value in the process update the properies have to look like this:
{Name(Account Update)} {Name_2(Account Update)} {Name_3(Account Update)}
BUT
It does not work if you enter this as text, you have to add the fields one after another so that they are recognized as fields (and marked yellow).
Click into the field (here: "Company").
Then choose the first field in the Form Assistant. Click "Add", choose it in the list below and click "OK". Now the field is in the field "Company".
Now go behind the end of the text in the field make a space and then choose and add the second field (clear the list in the Form Assistant before so that now only the second field is in the list)
So it's right if it looks like:
{Name(Account Update)} {Name_2(Account Update)}
Wrong if looks like following (happens when you keep the first field in the list before adding the second with "OK")
{Name(Account Update);Name_2(Account Update)}

Drupal views 3 - missing "MULTIPLE FIELD SETTINGS" in entity reference

Context: Content type Person has reference (multiple values) to a content type Work, using entity reference.
Need: To display the title of each person node which references a given work, separated by a comma.
Done: A view with a back reference, the right nodes are fetched. (Views 7.x-3.7)
Problem: Cannot display the value separated by a comma. Note: I usually do it with the "Simple separator" display type which is under "Display all values in the same row" in the MULTIPLE FIELD SETTINGS field group. However, this field group is not available in my context.
Solved
I have found the module Views Merge Rows - works very nice. If it does not support Features module for some reason, I can take some of its code code in order to use hook_views_pre_render myself.
I was able to work around this problem by using token_formatters. The basic steps (after token formatters is installed):
No relationship to referenced entity in views (not needed)
Add the entity reference field to the view
Change formatter to "tokenized text"
For 'Text to output' use a token (I'm using [node:field-name])
For 'link destination' use a token ('m using [entity:url:path] for a relative link)
Set multiple field setting as desired
You need a custom views Format here because you are talking about the whole views-row not a multiple results field. You can use the "Unformatted list" and add a comma to be added with CSS or JS.
What kind of Relationship do you use? Can you export your whole views in an external editor and provide a link?
I had a similar issue, where I was using the Entity Reference relationship of "Referencing Entity" instead of "Referenced Entity". (The reference was on the child and the View started at the parent level).
When you run a Drupal System Message on the row (dsm), it returns all the nid responses appropriately, but as different result rows instead of as a single object; however, since the NID field (like many others) has no option for display multiple results, it would only grab the first result.
I ended up having to do an Entity Query from a Views PHP field with the current row's NID as one of the Field Conditions. That seemed to do the trick, rather than trying to load a View inside of a View with views_field_view.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', '[your_content_type]')
->propertyCondition('status', 1)
->fieldCondition('[your_field_machine_name]', '[field_column_to_check]', $row->nid)
->addMetaData('account', user_load(1)); // Run the query as user 1.
$result = $query->execute();
I had a very similar problem: no "Multiple Field Settings" were available in the field configuration of a multi-value entity reference from my content type to User.
Solved it by removing the entity reference and instead using the multi-value "User ID" field of my content type directly. The "Multiple Field Settings" form area was available now and I selected "Display all values in the same row" there as you do normally. Now this would only display numeric user IDs separated by comma (not desired). But in the field configuration there was also a setting "Format:", which I set to "Label". This would display user names instead.
So I guess by creating a custom formatter you would be able to display your associated "Work" entities in a similar way.

Error in copying the content of a cck field between 2 nodes using cck computed field

I have two content types (job_post and job_application) linked using the node reference + node reference url nodes. When I click a link in a job_post node, a new job_application node is created, so that candidates can fill out their job application. My goal is to automatically copy the content of an cck email field from the referenced job_post node to a cck email field in the job_application node.
To achieve this, I am trying to use a cck computed field, as suggested in: http://drupal.org/node/298951.
In my computed field I have placed the following code:
$node_field[0]['value'] = db_result(db_query("SELECT field_emailfieldjobpost_value FROM content_type_job_post WHERE nid=%d",$node->field_referencefieldjobapplication[0][nid]));
where the field_referencefieldjobapplication, is the node reference field in my job_application node.
In the display format box of the computed field I have:
$display = $node_field_item['value'];
I have selected the option to store it in the database as a varchar.
However, nothing seems to happen. I never see the cck field or its content both when I create or after I save a new job application (I have even tried to see it in views and failed). Any suggestion on what might be wrong?
Thanks
What I would do, is give a parameter with the link (the id of the job_post). and catch the parameter and place it in a disabled cck field.
Then write a module using the hook_node_api when a jobapplication is saved, you get the data from the job_post (using node_load) and use the data from the job-post however you want.

Resources