Do not select a default value for a dropdownlist in sugarcrm - drop-down-menu

When generate a list of radio (with a dropdownlist), it will select a default value automatically.
But I do not want to select any values as default, how to set this?
Thanks.

The only way to solve this from Studio is to add an empty row to your drop down list. If this is not preferred, then I would follow Jim's suggestion to affect all the drop downs to not contain a default value. To get the wanted affect to this single drop down then JavaScript code would be the proper tool.

Thanks.
It will be radio buttons. Not a drop down list.

As far as I'm aware there's no way to set this in studio.
You can set this in the database as a quick and dirty fix:
UPDATE fields_meta_data SET default_value = '' WHERE id = 'IDOFCUSTOMFIELD';
Nicer, but more involved would be to create a custom version of
modules/DynamicFields/templates/Fields/Forms/enum.tpl
which allows choosing no default value.

One way we've done this by adding a value in studio of "please_select" with a display label of "-please select-" and make this the default.
This way it's obvious when staff are looking at the record that it's not filled in, and we use workflows and reports to catch the exceptions and raise the alert to the appropriate person/s.

I have found a solution to this, although I would like to stress that I would not recommend this as a best practice.
I was using SuiteCRM 7.2.3, and Sugar 6.5.20. So not sure whether this will work in later Sugar Versions.
Create a Radio Drop Down Field
Create your drop down list
Save it
Go back in the dropdown editor and find your dropdown list: In my
example, I had options, 0, 1, and 2.
Create the same options again only as 3, 4, and 5.
Now delete options 0, 1, and 2.
Save the dropdown
MAKE SURE you don't save the field again after you do this, only the dropdown list.
Now go look at the field in the EditView and you'll see that no option is selected. Worked every time I did this. Nothing shows up in the DetailView, so I'm assuming NULL is being passed to the DetailView in this instance, but I'm not 100% sure.

Related

Is there a quick way to set a visiblity expression for many rows in a SQL Server Report Services RDLC report?

I have a report with many tables (tablixes?), in which I need to hide all rows that don't have a value in the 2nd column:
I can do this by right clicking on each row
and setting an expression for the visibility of the row that depends on a value appearing in the field of the 2nd column, e.g.
=IIF((Fields!MyField4.Value = ""), True, False)
But the problem is that my report has over 1000 of these rows! It will take a very long time given that each field has a specific name! I can modify the Xml, but this will also take a while. I am currently writing some code, which uses XDocument, to achieve this.
Are there any faster ways that anyone can think of? Maybe something from the designer, or some VB code? Everywhere on the internet seems to suggest right clicking one row at a time.
In the Designer, select all of the rows (using your Shift or Ctrl key), and use the Properties pane in VS/BIDS to change them all at once. There is a Hidden property there, and you can choose Expression from the dropdown in it. From there, you can apply the IIF to all rows.
Of course, I am assuming all of the visibility is based on the exact same expression for each row. If not, then the answer is no. Unless, you want to start doing some copy/paste stuff in the RDL XML, which I do not recommend.

Kendo Grid - Customize Filter Row

there is a feature called "Filter Row" in Kendo Grid
http://demos.telerik.com/kendo-ui/grid/filter-row
I want to add a drop-down list instead of a text box or a number box, to the filter box. It's for filtering a column that has countries. So I want list of countries in a drop-down list. How can I do this?
It's very similar to the custom Filter Menu (http://demos.telerik.com/kendo-ui/grid/filter-menu-customization). I made the mistake of no using valuePrimitive: true. You might not want it in your situation but keep that in mind.
Here's a sample: http://dojo.telerik.com/OKaS
Also, the filter menu should take up the editor model of the column but it's not always what you want.
Edit
Starting from 2014 Q2 SP1, the template function now receives an object containing "datasource" and "element". In my example, you would have to change the dropdown initialization from "container.kendoDropDownList" to "container.element.kendoDropDownList". The datasource is empty in my example but I'm assuming this can be used to pass the choices to a control without requiring another datasource or to externalize your current. I have not experimented with this feature but I suggest you do before taking my sample blindly.
As Pluc mentioned earlier valuePrimitive: true will help you create a custom filter for your grid/columns to send id's to your controller, if you are not using setting this property true you will receive an Object in your controller instead of a number, the conversion will not be made automatically . This is still working as of 2019

Abbyy Flexicapture - Dropdown

I am trying to create a dropdown in AbyyFlexicapture.
The dropdown should be filled from database (i have external DLL ready to do the job) or with fixed values. The problem is I cant find the appropriate element for the job. All i found (the closest) was checkbox group, but I dont know how to use it (add items programaticaly). The documentation on this is very poor ...
Any help would be appreciated!
Figured it out. You just push data to textbox with query and it gets auto-converted to dropdown. But theres no way (at least known to me) how to set up default selection...
Look at the IField.Suggest() method.

Select a different value in a static dropdown using angular.js

I have a Magento product page producing static select elements, to which the price mechanism is tied in to backend, so i can't touch those dropdowns. I am using an angular.js radio element to recieve user input, which should in turn update the static dropdown's selected option.
I don't know how to link the two, I have recreated the problem here: http://jsfiddle.net/ldn_tech_exec/smBdC/1/
I want the radio button to update the dropdown, but I can only manipulate the dropdown after it has been created, perhaps using jquery to insert any angular directives required.
UPDATED again: Your select list needs an ng-model and the options should be generated with ng-options. When you select a radio button, the controller method you trigger should update that ng-model, which will cause the select list to update.
See http://docs.angularjs.org/api/ng.directive:select
Another way to do this is to use ng-selected. See
http://docs.angularjs.org/api/ng.directive:ngSelected
UPDATE #3: I missed the fact that you can't modify the select list initially. See my fiddle in the comments below for a working solution.
It sounds like you have some product where the price depends on the options set.
If this is the case then updating the drop-down from your radio button is relatively trivial - or at least depending on your prototype/jquery skills.
However there is a gotcha: once you update the drop-down in javascript with an 'invisible hand' there is a whole lot more javascript code to update the price and availability. To do this you need to bubble the event. This doesn't happen automatically if using prototype.
I hoped I could rustle up the 'bubble code' but I don't currently have it to hand, besides, you aren't stuck at that point, yet...

How can I create an autocomplete ComboBox in VB6?

Is it possible to use the default ComboBox control under VB6 to make it a smart ComboBox?
We suppose that the values are already populated in the ComboBox. For example:
New Delhi
New World
New York
We need the ComboBox to respond to one of the default events, so when for example the user writes 'N' the value in the ComboBox will be the first Value starting by 'N'. In our case it's New Delhi and then the user can continue typing till they write the exact word or he writes something different.
This technique is very used in web Application (for example in Google when you put the first word you will get a droped down list containing the suggestions).
But how to do that in VB6 :-(
In case its not possible, how can we keep the ComboBox droped down, the values changes when the text in the comboBox change and the first element in the ComboBox correspond to the first word starting by the value entered by the user?
Thanks a lot.
Actually I found an easy solution :) thanks to FreeVbCode uder Forms&Contorls Tab. There is a control named AutoControl. We can use it easly for our requirement.
http://www.freevbcode.com/ShowCode.Asp?ID=5944
Thanks.
You might also want to look at this control from vbAccelerator.com, which supports auto-completion. The vbAccelerator code is usually high quality. Of course you're introducing quite a dependency into your code whenever you use a third-party control.

Resources