Show/Hide CRM controls malfunctioning - dynamics-crm

I am setting the section properties of CRM form to have label & control in separate rows like below:
By default the form control will be visible=false. When I try the below snippets only label is showing up but not the textbox. If I use side by side setting, its working as expected.
Xrm.Page.getControl("myattribute").setVisible(true);
or
Xrm.Page.ui.controls.get('myattribute').setVisible(true);
Can I achieve this by some other supported means?
Update:
Ours is CRM 2015 on-premise. Not update 1.
I have tested the same behavior in Dynamics 365 CRM trial. Legacy form behaves the same way, but Turbo form is having the fix.

Can you please try the following options and check if the issue persists ?
1. Turn off legacy form rendering.
2. If you can use the Business Rules, to Show/Hide field and see if it works ?
3. You can use un-supported customization, to hide the textbox.
var curElement = document.getElementById(controlname + "_d");
if (curElement != null)
curElement.style.display = '';

This seems to be Product bug till date, even in latest version with legacy form.
For now as a workaround, we are keeping the controls in separate section to meet our need.
Am open to any other supported solution.

Related

Outlook VSTO ribbon add-in tab not showing on load

I’ve created an add-in that consist of a ribbon and three tabs.
Background to build:
The ribbon is built using designer and not xml. The primary use of these is to allow quick opening of various email templates.
Tab0 adds a couple buttons to the built in TabMail
Tab1 is a new custom tab with various buttons that do various things.
Tab2 is a reduced version of Tab1 for use by users of our subsidiary company but pointing to alternatively branded templates.
In the coding, Tab1 and Tab2’s visibility is set based on user AD group membership on ribbon load event. This has been tested and works.
Tab0 always is merged with the built in Home tab shows as expected.
Developers and template admins like me should see all tabs. This also works using same methods.
Current issue:
Recently and I think after a certain office 365 update (but not 100% which), Tab1 no longer shows for anyone that should see it on load. However the tab has loaded somewhere. The reason I know this is because to fix this bug all I have to do is minimise the ribbon the re-maximise. Both additional tabs are instantly visible.
Please note, I do not have to disable and the re-enable the actual add-in.
I can also confirm that the Ribbon Type is set correctly (Microsoft.Outlook.Explorer) so please, no reply along those lines either.
I have trawled the web and cannot seem to find an explanation or fix for this behaviour. I'm hoping someone has seen this before and might point me in the right direction.
To replicate, I've seen it happen by just creating a new simple ribbon project and creating a new custom tab. Then create a second tab by copying the first, giving it a diff ID.
e.g.
Ribbon on App Launch/Load - Tab01 Missing
Ribbon on minimise - Tab01 Appears
Ribbon on maximised- Tab01 still visible
Still have no idea why this happens but i have found a work around for those that have experiences the same issue.
The issue seems to affect the first custom tab only. So if you add a new blank custom tab and set its visibility to false, this inherits this bug allowing the other to function properly.
Its a bit of a dirty fix but work well.
Would still be interested in an actual fix if anyone knows one though.
This happens because you had added control to your ribbon perhaps a property to the Control which you should not.
An example is when you add a Ribbon Gallery control to your Ribbon and change its "PositionType" property from Default to another value.
This results in the Ribbon not showing.
Or perhaps you should check the last code you added to your project

CRM Dynamics Quick Create Form Label

I'm working with Quick Create Forms in Microsoft Dynamics CRM. Everything is working as expected. We have a sub-grid of one entity visible in it's related entity. When the User clicks on the + sign of that sub-grid, the Quick Create From appears exactly as it should.
The issue at hand though, is the physical form label of the Quick Create Form. For some reason the system keeps insisting on adding the words Quick Create: on the top of the form before the name of the entity (see image below).
Does anyone know how to prevent this from happening? This is a on-premise Dynamics CRM 365 environment.
Unfortunately this is not customizable.
Maybe you can do some unsupported customizations like overwriting DOM objects, etc. But it’s not recommended.
It appears to have something to do with a CRM Patch that we had installed to fix a Chrome CSS issue. That seems to have added something outside of our control. I'm not a fan of hacks/unsupported fixes, so I think we may have to talk to Microsoft about this one directly.

CRM Online 2015 Update 1 charts show all data from the underlying views until the charts are manually refreshed

In CRM Online 2015 Update 1 instances I experience charts on forms not showing the correct data until they are manually refreshed.
Charts in general show all data from the underlying view when the form is loaded. Only after manually refreshing a certain chart does it show "Only Related Records".
As an example, I have added a chart to the Account entity as seen below. Both the chart and the shown subgrid are using the same view. Even though there is only 1 related record the chart shows all data from "My Open Opportunities" after form load:
After refreshing the chart by clicking the small recycle-icon the correct data related to the current record (in this case 1) is shown:
I have tested this in 3 different CRM Online 2015 Update 1 instances which all exhibit the same behavior. Additionally, this is seen for both system and custom entities.
A similar chart setup in CRM Online 2015 without Update 1 works as expected.
I've got the same problem.
Microsoft has changed how they load forms. For now, you can switch back to the old way by going to Settings -> Administration -> System Settings -> General tab, and selecting Yes for “Use legacy form rendering”
This is only a temporary measure as that option is likely to be removed, but maybe Microsoft will support charts in forms or whatever the issue is by then.
PS:
Drawback is that the new way of loading forms is much faster, so you'll lose som e time if you switch back.
I Haven't tested this yet, but maybe you could add some javascript on the onLoad event to automatically select the view, like your users have to do now manually:
Xrm.Page.getControl(subgridname).getViewSelector().setCurrentView(viewname);
but this isn't pretty either
This issue is supposed to be fixed in Service Update 1 for Microsoft Dynamics CRM Online 7.1.1. From the changelog: "Charts within a subgrid are displaying all records when they should actually display only related records.".
The expected release date is around the middle of December.

Simple yet important 4 questions about Visual Basic Studio 2012?

Guys I'm a student who knows simple stuff about Visual Basic Studio 2012 and who's working on creating an application for a course project. :)
I'm using ASP.Net Empty Website under Visual C#
If that makes sense. xD
Anyways, I have 4 important yet simple questions:
Q1: how do I apply Password Custom Vlaidation? For example 8 characters min in both the password and the password confirm text feild?
Q2: How do I apply "required" validation to a group of radio buttons, check boxes and a drop down list?
Q3: In a form, how do I get a list of radio buttons appear as options for once a customer picks a hair style category, however if she picks a make up categorty from the same drop down list, a whole different options appear? I hope it's clear lol
Q4: Is there a "range" tool in Visual Basic 2012 and how do I use it?
I appreciate every answer and so much thanks in advance. :D
For ASP.NET
Ans1:
Use RegularExpressionValidator instead of CustomValidator
Ans2:
Use RequiredFieldValidator with all the controls. And in the last use single ValidationSummary Control to display message. Here is link for you Understanding ASP.NET Validation Techniques
Ans3:
Use RadioButtonList control for options.
On SelectedIndexChange event of DropdownList control populate the RadioButtonList with relevant options.
Ans4:
Link in Ans2 will give you the RangeValidator control example.
I assume you are working in Winform.
And Since I am a C# developer I am posting my code in C#. you can use Telerik Code Converter to convert it to VB.NET
Ans1:
char[] charArray = s.ToCharArray();
int passwordCharacters = charArray.Length;
if (passwordCharacters < 8)
{
//Your code
}
Ans2:
Use ErrorProvider Control
Ans3:
There is no data bound RadioButtonList control in Winform. You will have to do it manually.
Ans4:
I don't think so there is any ASP.NET like Range Validator Control in VB.NET

Dynamics CRM option set

I am new to Dynamics CRM so please excuse me for the newbie question xD
I managed to create an option set field with 2 possibilities:
Scheme 1
Scheme 2
Does anyone have an idea how when a particular possibility is picked, a list of custom based fields will appear in the form? Thanks in advance
If i understand your problem correctly you want certain fields to appear/disappear according to the choice selected in the option set.
The way I see this working is by implementing a Javascript on the onChange event of the option set. you can do this from the 'Form Properties' when changing the layout of the form.
Below is a link showing some examples of possible useful commands that might help you:
http://www.powerobjects.com/blog/2011/01/14/crm-2011-useful-javascript-tidbits/
You can put your custom fields in a custom tab and then hide/disable it according to the value in the option set.
If you have any further problems feel free to ask :)
I hope this helps :)
Gdluck
If you are comfortable working in Visual Studio, I highly recommend installing the Developer Toolkit (You can find the .msi \tools\developertoolkit - download it from here). It will allow you to develop JScript with some syntax highlighting and intellisense and makes source control and deployment a snap.

Resources