Why is the "Create alert rule..." missing for this grid? - dynamics-ax-2009

Someone else on my team has created a form - for some reason the Grid control does not have the "Create alert rules..." option in it's context menu.
I can't see what the difference is between this grid/form and others that we have created that do have this in their context menu.
Does anybody know why it would be missing?

It can be missing because the form window type is Popup or the form frame style is other than Standard. The rules are specified in \Classes\EventBuildValidAlertFields\validate:
public boolean validate()
{
;
if (!formRun ||
!formDataSource ||
!formDataSource.cursor().TableId ||
formRun.design().windowType() == FormWindowType::PopUp ||
formRun.design().frame() != FormFrame::Standard
)
{
return false;
}
return true;
}

The Frame property was set to dialog. If anyone can tell me why, I might mark them as answer.

Related

Xamarin, how can I gain a completed state from a command?

I have a ListView and am using the SelectedItem to call a command and show a modal view.
However, I have an issue where the user can tap multiple times on the listview row and multiple modal views are shown before the view has loaded. Granted this only happens on slower devices.
This is is caused because the command doesn't have any call back.
I wouldn't normally paste code here, but in this case I thought it was more descriptive to provide a screen shot.
I've looked into the AsyncCommands but these seem to be used more to handle errors.
I'm currently thinking about a subscribe approach which is triggered when the modal is exited, however I think there must be another way I haven't thought of.
Can you try using a Boolean as IsSelected & make IsSelected true when user clicks an item from list & change your condition in setter as below. When your operations are done reset the flag.
This was, there wont not be any duplication of modals. This is what I understood from your question, if there's something else, please let me know.
if( _locationAssetSelected || !IsSelected )
{
IsSelected = true;
_locationAssetSelected = value;
..... //your code
_locationAssetSelected = null;
IsSelected = false;
}
You could move the logic to the command to make sure it doesn't execute multiple times. This is a snippet on the sample/template Forms app which uses this method as a command. Lock seems unnecessary.
async void OnItemSelected(Item item)
{
//lock (selectLock)
//{
if (item == null || selectionOn)
return;
selectionOn = true;
//}
System.Diagnostics.Debug.WriteLine($"{item.Text} selected");
// This will push the ItemDetailPage onto the navigation stack
await Shell.Current.GoToAsync($"{nameof(ItemDetailPage)}?{nameof(ItemDetailViewModel.ItemId)}={item.Id}");
selectionOn = false;
}

How to make Sort Icon visible for all columns in GWT

I am creating an application where I need to do sort and search on header. I have used column.setSortable(true); and Creating sort handler. Again on other side I have created a custom header which will show textbox when clicking. I want to implement it like there will be sort icons clicking on that will sort while clicking on column label will open textbox.
Can anyone suggest how I can make sort icons visible in all the columns.
Currently when I click any column sort icon gets visible on that only.
Done fixing this. I have used overriding onPreviewColumnSortEvent and implemented is as below
#Override
public boolean onPreviewColumnSortEvent( Context context, Element elem, NativeEvent event )
{
if ( clickableTableCell.getColumnType().equals( ColumnType.TEXTBOX ) ) {
if ( sortFlag ) {
sortFlag = false;
} else {
sortFlag = true;
}
}
return sortFlag;
}

Custom message boxes in WP7

I really like the look/behavior of window created by MessageBox.Show. How can I create one from scratch so that I can add other stuff like a textbox?
There's a good article here on creating your own version, which is now on CodePlex. There various customizable MessageBoxes in the Coding4Fun toolkit. If you want to do it all on your own, this guide might help as well.
Instead of using a MessageBox, you could try using a Popup.
But, you'll have to manually disable the contols on the screen when the popup is open (MessageBox does this automatically for you). Also, you'll have to override the back button behaviour so that back button closes the Popup if it is open. This is also automatically done by a MessageBox.
In Mix11, Laurent Bugnion talked about Mvvm. In hist samples, there is a sample including the implement of Custom MessageBox. u can download the sourcecode from here and check the "03 JsonDemo - WP7 DialogService " sample.
Hope this help u.
Take a look at this custom implementation. Looks and behaves just like the out of the box MessageBox and is easy to use. I've used it in two of my phone apps.
Add references to Microsoft.Xna.Framework and Microsoft.Xna.Framework.GamerServices and then you can do the following:
Guide.BeginShowMessageBox("Title",
"Text",
new List<String> { "Answer 1", "Answer 2" },
0, // Focus button
MessageBoxIcon.Alert,
asyncResult =>
{
int? response = Guide.EndShowMessageBox(asyncResult);
if(response == null)
{
// Back button pressed
}
else if(response == 0)
{
// "Answer 1" pressed
}
else if(response == 1)
{
// "Answer 2" pressed
}
},
null);
I have tested this with Windows Phone 7 and it appears to work.

how to dismiss the dropdown list of an autocompletebox in windows phone 7

is there anyway to programmatically dismiss the drop-down list of an autocompletebox? my use case is as follows.
MainPage.xaml passes a value to SearchPage.xaml (i.e. /SearchPage.xaml?query=someText).
in SearchPage.xaml.cs, i set,
autoCompleteBox.Text = NavigationContext.QueryString["query"].
at this point, the drop-down list of suggested matches shows up. i don't want this behavior when the page is just navigated to.
i also tried the following to dismiss the drop-down list but it didn't help.
autoCompleteBox.Text = NavigationContext.QueryString["query"];
autoCompleteBox.IsDropDownOpen = false;
the drop-down list seems to go away from the AutoCompleteBox when it loses focuses, but i don't see a property/field to set to make it lose focus.
any help is appreciated.
well, i tinkered a bit and came up with a kludge. in the constructor of SearchPage.xaml.cs i have the following code.
autoCompleteBox.TextFilter += DummyFilter;
autoCompleteBox.GotFocus += (s,args) => {
if(!isAutoCompleteBoxInit) {
autoCompleteBox.TextFilter -= DummyFilter;
autoCompleteBox.TextFilter += RealFilter;
}
}
DummyFilter looks like the following.
bool DummyFilter(string search, string value) { return false; }
RealFilter looks like the following.
bool RealFilter(string search, string value) {
if(null != value) return value.ToLower().StartsWith(search.ToLower());
}
in my OnNavigatedTo method, is where i set, autoCompleteBox.Text = NavigationContext.QueryString["query"]. so when i do this now, the DummyFilter will always return false, so the drop-down list goes away. when the user focuses in on the AutoCompleteBox, i check if the correct Filter was already attached to the TextFilter property, if not, then i do a switch.
hope this helps some of you.
Is there any other focusable control on the page? Just set the focus somewhere else, and your problem should be solved.
When you have changed the text of the AutoCompleteBox the dropdown will open. Only when the user has changed the text and there is a match then the dropdown will close.
Just change userInitiated to true and when there is a match the dropdown will close.
private void UpdateTextCompletion(bool userInitiated)
{
userInitiated = true; ...

Form validation on Facebook tab

I am using static FBML but I am having trouble debugging a form validation problem. I get the dialog which to me seems like it should return false, but the form submits anyway. I am using Firebug and I see a brief message in Red that I have no chance to read. I appreciate the help :-)
var txt ='Enter Zipcode';
//...
function setError(){
var obj=document.getElementById('mapsearch');
obj.setValue(txt);
obj.setStyle('color', '#FF0000');
}
function valform(){
var obj=document.getElementById('mapsearch');
var val = obj.getValue();
if(val!='' && !isNaN(val) && val.length>2 ){
return true;
} else {
setError();
(new Dialog()).showMessage('Zip Required', 'Please enter your zip code.');
return false;
}
}
//...
Try the "Persist" button if the Firebug/javascript error message in Firebug disappears too quickly. This way all messages are kept between page loads until you click "Clear".

Resources