Lookup fields in CRM 2011 - dynamics-crm-2011

Entity Application has a look up to Contact. Now, Entity Application Document has a look up to Application. In my Application Document form, I want to display the Contact who is associated with the Application Document. I do not want to be creating a look up to Contact as it is just bad database design.
How can I show the related contact in the Application Document form. It is after all a look up - alright, a two level look up right? I can go from the Application Document to the Application to which it is related and from there to the Contact.
My suggested solution would be to have a read only text field in the Application Document entity. Populate it with Contact (Primary Field) onloadform with a JavaScript.

I'd resolve it as a call to the DB, fetching the linked entity and then fetch it's linked entity. JavaScript seems to be the wises choice in this case.
However, you mention that you find this solution bad, so I might be missing a requirement.

Related

Externally hosted form and NetSuite Data

I have a page hosted on an external site and I would like to create a form on that page. The use of the form would be to collect data to create SO in Netsuite.
In the form itself, I would like to have an autopopulate functionality so that for e.g. when I put in "Kat" in End User contact, I see all contacts starting with "Kat". This will enable me to select a correct contact and also help prevent duplication of data. Can you please guide me on how to structure this flow. What Netsuite components should i be using? For the external site, it will use Django.
Thanks
You need to create a couple of RESTlets in NetSuite. One to perform a search to get the contacts and return them in the payload, and one to create sales order in NetSuite and populate it with the values provided in the payload.
How are you solving the issue with CORS?

Create contact without user

I try to create a contact that is not associated to an user. All "real" users are imported from LDAP. I want to show a global contact list for different purposes like a birthday-list and a phone book. Not all entries in these lists are imported as users. Now I want to create these contacts with the ContactLocalServiceUtil class programmatically. Are there any advices how to do this? There is no method that needs neither a user-id nor a contact-id.
A Contact, as contained in Liferay's API, is always the contact data of a user. Just because the name describes what you need, does not mean that the underlying concept matches as well. You probably need different data for a general purpose phone book anyways and it's probably easier to introduce your own contact class than adjusting the existing model (you can't add fields to API classes anyway - your only way of extending Liferay's ContactModel would be through Expando fields)
Therefor the advice is: Create your own contact class. If you want to react to user data changes when LDAP is updated, you'll need to frequently import the user data and for example create a model listener on Liferay's contact that updates your custom contacts whenever an update from LDAP is coming in.

Liferay database table work flow?

I am new to Liferay. Now I need to create the flow chart which has the Liferay table work flow in following scenarios,
1) What are the list of table will reflect/update if we create the site admin?
2) What are the list of table will reflect/update if we create the site?
I tried by opening database tables and noticed that USER_, CONTACT_ will reflect, But I need list of all the related tables which will reflect when we create the site and siteadmin? I am using Liferay 6.2 version.
Thanks in advance.
When you want to know the internals of any system it is always best to check the relevant source-code. So in this case you can check the source-code for those classes which are used for CRUD operations on User and Site.
1) What are the list of table will reflect/update if we create the site admin?
Site-administrator is a Role, which can be applied to a User created in Liferay.
So if you want all the tables that are created from User-creation till User is assigned the Site-administrator role for a particular site, there here are some which I can recollect:
User_ (Obvious)
Contact_ (not so obvious :-) )
Group_ (Users are also created as a record in this table since Users have public and private pages)
Address (if you add an address)
Phone (if you add a Phone)
Users_Roles (Power user role is assigned by default)
UserGroupRole (user and site-role relationship, Site-administrator is a Site-role)
Users_Groups (user and site relationship)
For others you should refer the source-code for UserLocalServiceImpl, RoleLocalServiceImpl and GroupLocalServiceImpl, check the relevant methods prefixed add, update etc.
The corresponding service.xml for these module would reveal the database tables being used.
2) What are the list of table will reflect/update if we create the site?
Sites are nothing but Groups in Liferay. So its obvious Group_ table is playing a big role.
Other tables also depend upon what configuration you are doing while creating a Site.
Then there would be other tables like Layout when you start creating pages for a Site.
I would strongly encourage to go ahead and explore the source code for the classes and you would understand the flow - when and what tables are affected.
Here is some convention which might help you traverse the source-code, almost every *LocalServiceImpl is associated with a *Model like UserLocalServiceImpl with UserModel and almost every *Model has a corresponding database table with the same name.
Also the name of the functionality would in most cases hints at what service classes are being used to connect to database, like adding a User would hint at using UserLocalServiceImpl.
Hope I have understood your question and have been able to give some proper direction.
If you want to know this because you also want to write to these tables: Don't go there! You should purely use the API to change the data that Liferay stores. Otherwise you will run into disasters some time in the future - promised.
For just getting the SQL commands that Liferay actually uses, configure portal-ext.properties and change this default value:
hibernate.show_sql=false
Then go to "Server Administration/Log Levels" and add a new category "org.hibernate.SQL", configure it to the level DEBUG. Then the results show up in the logs. Note that this log configuration is transient and will be reverted on next server start. If you want the setting to be persistent, you'll need to go into Liferay's log4j configuration files.
Remember: You don't want to write to the tables ever. Promise!

MS CRM Block all entity forms from user

I am an admin for MS CRM 2011 and I have this demand that certain users - although they have READ access to an entity - should NOT have access to any of this entity's forms.
Meaning, they should only view the records via sub grids, on related records.
Is there a way to have such control over user view?
You could make all the tabs on the form invisible unless the user had certain roles(s) through JavaScript.
This seems like a very strange request. Any chance you could elaborate?
Put these users in a role. Create a new form for each entity and assign that form to that role. Make sure these users do not have access to the other forms by role. Don't put any fields on this new form and maybe even add a javascript pop-up error message and some code that closes the form immediately.
This way your other forms aren't slowed down by a javascript request that always checks role membership plus everything is contained in that special form instead of spread through your other "real" forms.
if this entity just hold relationships like a N:N entity would do, you can also make sure that the relationship (reference to it) is not shown on the navigation area of the related entity forms. This way its there but no one can 'use' it.

How to pull a piece of data from a custom field in MS CRM 2011

I need to pull a piece of data from a custom field in the regarded account or case and pull it into a field in a phone call form. (its just to identify which account group the call took place from)
I am not sure of the javascript code to pull from the regarded account or case.
Can someone point me in the right direction.
Thanks in advance.
If you want to do this in javascript, you'll have to access the organization endpoint and retrieve the account/case record. The main form contains the regarding lookup field, which will have the GUID, display name, and entity name of the record. The CRM 2011 SDK has some sample code for retrieving records in Javascript, and they even have a library you could use that does all the hard work for you.

Resources