I'm working with Drupal 7 User Relationships and I'm having some problems with mutual relationships.
Example:
User A request B for mutual relationship
B approves relationship with A
Then we look in B profile under relationships we see that B has relationship with A.
But then we look in A profile under relationships we see that it doesn't have any relationship with B. If A would go to B user profile A could request for relationship again.
I was expecting that mutual relationship would be shown on both profiles after it was approved but it isn't. What can I do so that it would show the relationship on A and B profiles not only on B as it is now.
After some more research I finally found that there is a patch for this problem. You can find it here http://drupal.org/node/1211060#comment-5105036
Related
On Account object we have a related list called contact.If we want to add contact we can use Contact related list. then contact related list will created. But on the contact i could n't find the Acccount name in Account related list on Contact. Both Accounts and contacts are m-m relationship
Your question is bit weird. And it's not really programming-related. If my answer doesn't help you - try asking again at https://salesforce.stackexchange.com/
The default setup in Salesforce is that Accounts and Contacts are in 1:n relation. So you have related list of 0,1 or more Contacts under Account. But when you're on Contact there's only 1 Account to choose from. And it's the "Account Name" field, a lookup (foreign key), not a related list with exactly 1 item on it.
You're 1 click away from viewing the Account. If that's not enough, if you really want to display Account data on Contact - there are options such as formula fields or adding "record detail" component to the page and making it use Account Name instead of this Contact. You can see it on the right side in my screenshot:
When you make new Contact you can select existing Account or click "New" in the lookup and create one on the fly. But relation is still 1:n, A contact will have 0 (possible but an edge case and generally bad idea) or 1 account.
Then there's a special table called AccountContactRelation. It's used to model "one guy working in multiple companies, for example being director in company XYZ small local branch and at the same time - head of accounting in company XYZ headquater". If you want that, a real m:n relation - you might have to enable few things in Setup and configure your Salesforce like this training course: https://trailhead.salesforce.com/en/content/learn/modules/admin_intro_accounts_contacts/admin_intro_accounts_contacts_relationships
But on the contact i could n't find the Acccount name in Account
related list
So... if you already have the "Contacts to Multiple Accounts" enabled and added to page layouts and stuff - then perhaps it's as simple as checking the Contact page layout and editing the related list to include Account Name. But I have a feeling you skipped few steps on the way.
I'm creating a db schema that involves users that can have multiple users.
I want to register different companies to use the web services.
For example:
user A or B (etc) can signup and create a company account
user A can create multiple accounts of other users with their types, similarly user B
If user A or B create different accounts, how would I know this particular user is belong to User A or B company ? I think user table have many to many relationship with itself (like basic friendship design).
Please suggest the best design .
Ex.
User 3,4 belongs to User A
User 5,6 belongs to User B
In general, I would recommend starting by identifying all the entities you are trying to persist. It sounds like you have two distinct entities in your question. One being "user," which represents a single person. Your second entity is "company." A "user" can belong to a company.
An example of a database design would be one table for users, and one table for companies. In the "users" table, you would want to have a foreign key column that references the primary key (unique id) of the company the user belongs to. If each user can only belong to one company, this becomes a simple one to many relationship.
In short, I would highly recommend treating company accounts separately from user accounts, since they are fundamentally different entities.
I have 3 domains A,B,C .A has Many B and B has Many A (Many to many relationship between A and B ), and A and B belongs to C domain.
Now my problems is how can i manage Many to many relationship between A and B,because without one parent its grails throw error parent must required.
In my case C is parent of A and B.so now how can i manage many to many relationship between A and B where both belong to C ?
As you have already mentioned Grails will not allow creation on the many to many without belongTo in one of the domain so there is no way to do it in Grails.
In many to many relationship a separate table is created automatically by the name A_B so this relationship can be managed by created your own domain AB which belongsTo A and B both are nullable: true and now you will A hasMany AB and B hasMany AB.
You can do this by mapping the relationship class explicitly as in this post
I have a University system project for my db lab.
I should have a unique login page for all the 3 user types: 1.student 2.Teacher 3.Supervisor
I already separated them in 3 tables(each has its unique properties).
My problems:
How to check when someone tries to log in?(which table should be checked and how to prevent duplicate usernames however they are in 3 different tables).
How to send messages between these 3 types although there is no central unique table to lookup(3 tables should be checked and there is a chance of username duplication)
My current ERD:
You should have all the users with their type in one table and additional information in separate tables.
you do not show any difference between the Students and the Professors in the schema.
also there is no 'supervisor' table.
i would suggest renaming the table to users - and adding a type or role column.
also:
the professors should be many to many with the courses also - assuming one professor can teach more than one course.
in the case where you combine the users, then there should also be a role on the association between users and courses identifying whether that user is a professor of that course, a student, an auditor, an associate, a substitute - etc.
Is there any way through which we can relate 1 account record with other account records in a many to many relationship format in salesforce? This is not possible as per the standard way, as we can not create many-to-many relationship with the same object type in salesforce. Can anyone pls suggest some custom way/code to do this?
I have a requirement where I need to link for eg: Account A with Account B and Account C so that I can see the contacts of Account B and C on Account A.
Any help will be much appreciated!
To create a many-many relationship in salesforce you would need a joiner object that has two master-details to account (There is actually already a standard object called Partner that may fit your needs).
To see the contacts of related accounts it's probably easiest to create a simple visualforce page that will query the contacts of related accounts and display them.
You can create a relationship between two account objects using a join object. You must use two lookup field type to relate the objects - a master detail relationship will not work if you are trying to relate the same object.
As per the comment by #grigriforce this can also be done as a master-detail with Account and a Lookup as well as two Lookups.