I have created a view for my Queue Items. In this view I show leads, orders, emails and quotes (Entities). One of the columns in my view is Owner (Activity). This shows the information that I want, but only for Entities that are "Activity Entities" (i.e. Task, Email, Phone call, etc). Is there a way to show the inherited owner of the queue Item object?
So if I have a Quote, show the owner of the quote in that field, if I have an order, show the owner of the order in that field, etc etc.
The OOB attribute Owner (Object) shows the owner of respective Activities, but the Quote or Order is not an activity type like Email, Task, etc. So they are empty.
If you pull up the respective owner of each entity type in that view, the columns grows horizontally and the empty values will be shown for other entity types.
Solution: Create a custom owner field in Queue Item entity and track all the owner field changes in all the current owner of your possible queue item entities using a plugin. Add that custom owner field which stores the current owner of respective Parent entity (Order, Quote, Email, Task, etc) owner to your view.
Related
I'm trying to create a simple 2 table database - table 1 holds ClientInfo and table 2 has ClientVisits - Relationship is on ClientInfo.ID->ClientVisits.ClientID. Then I have a form created thus for viewing the ClientInfo plus a child(sub?)table which SHOULD show all the records from ClientVisits where my Form ClientID = ClientVisits.ClientID.
Here is my form
Here is the child table with fields shown
Relationships
So I already have one record in ClientVisits for the currently chosen ClientID form record. But it doesn't show in my Table.ClientVisits. Other than the relationship I don't have any other link between the ClientID and the ClientVisits.ClientID field.
If I need to post further info please let me know, trying to describe this as well as I can - sorry if it's not making sense. Thanks.
You have to link both tables in your form.
In my example, main data of my form is a table called CLIENTES, where it shows all the information about a cliente. It would be exactly the same as your table ClientDetails. In this table, primary key is a field called DNI (it would be the equivalent of your ID field)
I got a second table called CONSULTAS MÉDICAS. This table is just a list of how many times this client comes to see us. It would be the same as your secondary table CLIENT VISITS. In this table, I got a field called PACIENTE, linked to my table CLIENTES. Let me show you.
Ok, now my form is done based on the data of my table CLIENTES, but I got a subform control, where I have linked the table CONSULTAS MÉDICAS
To make this work is pretty easy. Not filters or queries. Just linked child and master fields. To do this, you have to select properties of your subform control, and then go to DATA TAB
Just choose as main field your ID field from table CLIENT DETAILS and link it to child field CLIENT ID from table CLIENT VISITS
That should work for you.
The objective:
Having a many-to-many relation be displayed as a dynamic list of select inputs(single choice dropdown list)
User arrives on page with a single select field (multiple = false) populated with persisted entities and add/remove buttons. By clicking the add button, a new select field with the same options appears below the first, which adds a new entry in the M2M relation. By clicking remove the field disappears and the entry should be removed.
The model:
Two entities: User & Manager. A User has exactly one "special" Manager and unlimited normal Managers.
Managers manage unlimited users.To model this I have created two relationships for which the user is the "owner" (not sure how to translate this)
ManyToOne specialManager
ManyToMany normalManagers
I haven't created a many to many relationship with attribute "special" because the requirement is exactly one special manager and I wasn't sure if Symfony/Doctrine would cause problems down the line.
What I have:
I can display a multiple select field with the existing entities using Entity field type, as per the documentation. Functionally this is what I need, visually it is not.
I can also use the Collection field type to display a single text field, and add or remove more with JS, as per the documentation. Visually this is what I need, but The text fields (entity attribute) need to be replaced by choice field.
The question:
Before I continue digging, is there a simple way to achieve this list of select tags?
For anyone else who may eventually need a dynamic list of select fields:
I initially solved this issue by detaching the field(s) in event listeners, and handling the display/submission manually in the controller.
However I wasn't satisfied with this clunky solution and when I encountered the same need I used a second solution: creating an intermediary entity xxxChoice (in this case ManagerChoice) which is Mto1 inversed related to User and Mto1 related to Manager. Then by creating a ManagerChoiceType form with "Manager" entity field type I was able to easily display my collection of dropdown select lists.
I have two entities, Bookings and Discharge.
When a record is created in Bookings, it automatically creates a record in Discharge. Discharge
has an additional field that is a drop down with four options.
I want a functionality where when any one of the values in drop down is chosen, the similar record in Bookings
should shift from "Active" view to a default view which I have created by the name of "Processed" in Bookings.
What I have in mind is to create a hidden field in Bookings that is populated when I choose one of the options from Discharge drop down and based on that field the record should shift the view in Bookings. But how do I populate the hidden field? Workflow is not giving me that option or maybe I am doing something wrong.
Help?
So I have created a 1:N relationship between Booking and Discharge. The field is updated in Booking based on the field in Discharge and I choose the particular record in Booking from the look up field in Discharge. But I want to get rid of this second step. I don't want to choose the record in Booking entity but directly update it from Discharge. There are some fields and their values common in both forms, can I create a relationship based on that?
Regarding the first part of your question
"What I have in mind is to create a hidden field in Bookings that is populated when I choose one of the options from Discharge drop down and based on that field the record should shift the view in Bookings. But how do I populate the hidden field?"
If the field is not on a form you can't set its value hence the following:
I don't believe you can set a hidden field using a workflow. However there is a 'visibility' option on the form designer.
I suggest you add your "hidden" field to the form. Then double click on it and toggle the "Visible by default" checkbox. This will hide the field from the user.
You can then set the value of this field using a workflow.
Regarding part two of your question
I don't want to choose the record in Booking entity but directly update it from Discharge. There are some fields and their values common in both forms, can I create a relationship based on that
You have a 1:N relationship however you want to set the related Booking Dynamically is this correct? You cannot select a Booking in the lookup field based on criteria from a workflow. You would need to use a plugin.
If the Discharge has a related Booking (the Booking lookup on Discharge is already set) then you can use a workflow to either:
1) Set a field value (Using 'Update Record' in the Workflow steps) in the parent Booking
2) set to Inactive (Using 'Change Status' in the Workflow steps) in the parent Booking
Background
I was given the task of writing a Small Business online database. This database is to include a lot of info as well as info on their directors and branches. Since any business can have an unlimited amount of directors and branches, I need to create a database that is not limited to just one director and/or branch.
What do I have
Currently I have 3 tables.
smmes [id, company_name, trading_name, business_address, registration_number, tax_reference, vat_number, bbbee_status, employees, awards, created, modified]
ownerships [id, smme_id, name, surname, gender, age, race, disability, qualification, created, modified]
branches [id, smme_id, location, contact_number, contact_person, created, modified]
Note: smme_id is the id of the company in smmes that the branch or director belongs to.
And I have a view for the SMME's.
What is my question
I'm VERY new to cakePHP (in fact, this is my first app I'm creating with cakePHP). I want to know how I can make one form where a user can enter all this detail and then add the details for all directors and branches from one view. I would prefer that they do not have various views to go through to create all the details. Add to that, this one view should then save all the data to the correct tables with the correct smme_id.
Is this possible or should I rather leave cakePHP and write it manually.
You can load model on demand in your controller and then pass model specific data(received from posted form) to loaded model's save method.
public function detail(){
if($this->request->is('post')): // update only when form is posted
$this->loadModel('ownerships');
$owner_name= $this->request->data['Ownername'];
$ownerships_data = array('Ownership' = > array(
'name' = > $owner_name
//add other keys from posted form
)
);
$this->Ownership->saveAll($ownerships_data);
// load other models for saving posted data in related tables
endif;
}
Similarly load other models and pass fields from posted form as array to it's save method.
Suppose URL format is http://example.com/director/detail.So you would like to put above method(termed as action in MVC terminology) in app/controllers/directors_controller.php
Generally if URL format is http://somesite.com/abc/xyz it will look for xyz action in
app/controllers/abcs_controller.php
You can read more about cake conventions here
I have a little databes in access. I make a few forms with sub forms and drop list(by query):
Steps of my creating form:
make form from table
delete all not PK or FK text box
create comboBox with store value to text box what I choase
create subForm and set Link Master Fields and child fields
design view:
This is form for table Task task have Fk: Project, peson etc. DropLists are connected tu subform for changing FK like project, person etc. So when I work i select in droplists what i want add to database and work with subForm. When I close this form, the first row in table change FK to last configuration on droplists.. Pleas how can I fix it?
It is quite possible to use a main form for selecting and updating subform records, but in this case it should not be a bound form.
To set up, for want of a better word, a linking form, unbind the main form, that is remove the record source and ensure the dropdowns (comboboxes) do not have control sources. I suggest you rename the dropdowns to cbo, to indicate that they are controls, not fields. The hidden controls should not be needed.
The value of a combobox is the value of the bound column. The Key or FK is the first item in your SELECT statement and the bound column is 1 (one) so the relevant Key or FK is the value of each comboboxe. You can set the link master fields to the names of controls so the Link Master Fields should be cbo_id_projekt;cbo_id_os_udaje;cbo_id_komponent;cbo_id_uloha.
As an aside, I generally avoid underscores, but each to their own.