Microsoft CRM 4.0 form attribute mysteriously read-only - dynamics-crm

I've inherited a customization of Campaign Response in which the Customer attribute is read-only on the form (in both create and update modes), and I can't figure out why. The form has no OnLoad javascript, the attribute "customer" (which is a partylist) is Searchable, and the field-level behavior for the attribute on the form has "Field is read-only" unchecked. The attribute is read-only even for the System Administrator, so it's not an authorization issue.
What else could be making this field read-only?
Thanks,
Phil

First I'd make sure that entity is published. Could be that someone made the change, and then didn't publish the entity.
Second, it is possible that there could be some unsupported changes to the environment. Off the top of my head, they could be attaching javascript to the form via an http module, or modifying the form html by making it locked down, again through an http module. I'd check for any non-native http modules added to CRM's web.config, and I'd also poke around to see if there were any entities that look like they'd be configuration entities for locking/hiding fields. We often do something like that, though in a supported way.

After giving up on Microsoft's support, which was absolutely abysmal, I paid an outside consultant to look into this.
He compared my exported customization to his, and found that, in my exported XML, the Customer field in the Campaign Response form had no LookupTypes, whereas his had 3 LookupTypes:
<LookupType id="f953c2fa-2241-db11-898a-0007e9e17ebd">1</LookupType>
<LookupType id="fa53c2fa-2241-db11-898a-0007e9e17ebd">2</LookupType>
<LookupType id="fb53c2fa-2241-db11-898a-0007e9e17ebd">4</LookupType>
LookupTypes 1, 2, and 4 were exactly what should be there for Account, Contact, and Lead for the Customer of a Campaign Response.
So I added those 3 lines to my XML, imported and published, and now the Customer is enabled and apparently fine.
I would love to know how these LookupTypes could have gone missing in the first place. But at least I've got the default functionality back.

Related

Form has Event handler attached to it from the web resource

I have a marketing list form which has its own OnLoad event attached to it, upon inspecting Form properties I see that there are no libraries added just an event:
this aforementioned .js file does not exist in Web resources.
My question:
Where should I look for it ?
Definitely this is Microsoft OOB web resource library (Internal use only). If this is not bothering you and if you don’t need it, leave it as it is. Even you can remove the event registered in form editor, no harm will be made - possibly some section which is hidden may be shown or vice versa. But, you cannot add it back since library dropdown will be empty when you try to register it back.
It could be mistakenly registered/failed to remove during some upgrades. MS team failure. :(
on a quick search - I see only this reference in internet for that file.
I remember I have seen such mess related to Field service libraries and LinkedIn integration libraries not registered in Account/Contact forms and only events were there.
Even if you try to find the library in default solution, when you open it - it will be condensed and read-only. :)

MS Dynamics CRM: Is there way to check personal view against existing attributes?

If you want to remove some attributes from the entity, a check is made to see if they are used in global views. For personal views, a similar check is not performed, and if the user wants to use a personal view that contains a non-existent attribute, he will only see a not very explanatory error message.
Is there any way to check the use of non-existent attributes in a personal view?
AFAIK, there is no way to do dependency check from an attribute to personal views. I don't see a XrmToolBox plugin to achieve the same.
Probably you can do some sdk calls to pull all the personal views and check the content in query FetchXml and layout xml for your attributes, and go from there.

Bug on the javascript to retrieve data from a Quick View CRM 2015 Rollup 1

I have trouble retrieving a value from a Quick View (as per quick view i mean show the related entity details in a parent entity, eg. primary contact email address on the account).
The usual way to retrieve those is by the sdk syntax:
Xrm.Page.getControl("contactQuickForm_contactQuickForm_contact_mobilephone");
I tried this approach but now the result is an empty control. Anyone had a chance to see this defect in the new rollup? I troubleshoot a little around it, including removing all the controls from the page and scroll through the list to confirm that the control wasn't actually there and i wasn't making any syntax errors.

How to get data out of entity in script in CRM 2011

I have 2 entities (for this example) in CRM 2011 - Account and Case. The Account holds all of our clients, the case holds individual work actions for an account. When a case is created one of the input fields is the Account.
What I would like to do is upon the user selecting the Account, execute some javascript to look up the account entity to display some additional information.
So far I have got the javascript working that triggers the onchange event of the Account field, and it correctly gets the selected Account, but I don't know what the next step is.
I'm new to CRM so don't really know if what I'm asking is actually sensible, if there is a better way then please let me know.
Thanks!
For the record, the way you were thinking about doing things would be completely supported, and TechHike's method is supported in CRM 4, not CRM 2011. Steps you would take:
Use CRM 2011's web resources to upload a script file that does what you want.
Use the form editor to make your javascript method from step one fire when the Account field changes on the form
Make a request to CRM's REST endpoint (http://msdn.microsoft.com/en-us/library/gg334767.aspx) to retrieve the details of the account selected
Use the results to populate fields on the form, show a popup with details, etc.
There are plenty of examples of caling the REST endpoint from JavaScript in the SDK (http://msdn.microsoft.com/en-us/library/gg309408.aspx). Good luck!
Matt's post above contains everything you need to know, but you might also find the blog post below useful. It basically describes the same scenario where you have a 1:n relationship (such as Case and Account) and details how you can pull information from a specified lookup (e.g. account), using the REST endpoint (as Matt has already mentioned) and display it on the form.
http://community.dynamics.com/product/crm/crmtechnical/b/crminthefield/archive/2011/02/07/showing-related-information-in-a-crm-2011-form.aspx
The blog post includes a link to download a CRM2011 solution already built to give you something to look at how they've achieved this (useful if you're new to CRM2011).
There are two ways to do this, and you may be best to do them both in parallel:
on the Account > Case relationship edit the Mappings. When a user goes to an Account and uses the left navigation to look at Cases (or a grid of Cases on the form) then hits "Add New Case" they are creating a Case from inside the "context" of the Account. You can copy any fields you want to from the Account to the Case record at this point - the Mappings define what field from the Account are copied to which target field on the Case. This will always be the most robust, easiest way to do it but relies on the user starting in the right place.
on the Case for you could also add an onChange script to the Parent Customer lookup to fetch the data from the parent record. I think Stephen's link is probably the best way to do this as it does not copy the fields but allows the user to see them anyway, which is better database design (from a purist standpoint) and means the user always sees current info about the Account rather than possibly out of date stuff. Alternatively if you actually need to copy some fields (maybe the customer's normal SLA say) so that you can use these in other such as scripts or workflows on the Case then have a look at this article: Disabling the selection of contacts for opportunities all the way
Although this is about a slightly different topic, the script there fetches the Account details of the parent Contact - you want to fetch values from a parent (llokup) field so the approach is the same, just different in the detail
There are various ways to do this but I would recommend doing it the supported way, without javascript. This may not be as pretty but it is likely much easier. The scenario would be to add a left navigation link to the case entity that when clicked will update the content area to show the details of the account.
To add a link to the left navigation you will need to configure the isv.config file to have an extra link for the case entity.
Here's an example:
http://support.sfusion.com/kb/hosted-microsoft-crm-4/how-do-i-modify-the-isv-config-file-in-microsoft-crm-4/
You can also lookup isv.config customizations in the SDK, found here:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=82e632a7-faf9-41e0-8ec1-a2662aae9dfb&displaylang=en
Next you will need to create a custom aspx page in the ISV folder of the web server. This page will display all the information about the account that you want to show the user when the left navigation link is clicked. The ISV.config as an xml property that allows you to pass all the context params to your page on the querystring. Make sure when you create the link to turn on this attribute.
Now the only tricky part is that in the page you will need to use the CRM web service to display all the account details that you interested in showing the user. I won't do into details on this. You can find great tutorials on the web or in the SDK if you haven't done this before.

Oracle CRM OnDemand custom web applet - add User object variables to URL

I have a custom web applet that I am adding to the Lead object tab of my Oracle CRM On Demand app. It is easy to include a variable in the URL via the %%%VARIABLE_NAME%%% convention but that seems to only work with the object itelse (Lead, Service Request, etc) Since the field I want to add is part of a different object (the User) it doesnt seem to be working.
Any help on how to add this would be greatly appreciated.
Here it talks about custom web applets, and under Fields it talks about adding a variable:
http://download.oracle.com/docs/cd/E14388_01/books/OnDemOLH/index.htm?toc.htm?creatingcwa.html
I got a definitive "not possible" from an oracle web service developer on this issue.
So turns out that in a custom web applet for one object you cannot have custom fields from other objects.
My work-around is to pass the unique userid %%%User id%%% back to my app and work from there.

Resources