MDriven Save OR Mappings to Database - mdriven

Is there a way to Save OR Mappings to Database programatically.
There is an option in the EcoPMP bottom button I want to do the same.

You can use one of the DBEvolutionForm.EvolveDB() functions.
i.e.
EvolveDB(IServiceProvider serviceProvider, IPersistenceMapperDb persistenceMapper,
ITypeSystemService typeSystemService, bool silent);

Related

CTRL+N Not invoking new on a DetailsFormTransactions Page

I need CTRL+N to invoke the default behavior, that is to create a new record without invoking my NewButton.
NewRecordAction property is not filled out, the shortcut does nothing, seems to be disabled.
The DataSource on the form allows create, I can create through my NewButton MenuItemButton.
I seem to have lost it's default behavior somehow, what could cause that?
Ctrl-N does not do anything, because the NewRecordAction is not filled out and because there is not a command button with New in the Command property.
I assume you have used "Create form from template" or have copied from the SysBPStyle_TransactionDetails form (same thing). This form contains a botton NewButton which is ment to call a creation form, like the SalesCreateOrder form.
You have two options:
Fill out the NewRecordAction with the control name of your create menu item. This should be mandatory in list pages.
Delete the NewButton, then create a new command button with New in the Command property. Also remember to assign a value to the DataSource property on the control or a containing node.
I personally prefer the second option (maybe combined with a setFocus call) because a create form is then not needed and there is only one form for you to maintain and the user to learn.

ExtJS 4 - How to load grid store with its params carrying latest values from a form?

I have a window with a search form at the top and grid at the bottom.
User can enter values in the search form and click button - Get Records.
At the click of this button, I load the store of the grid by passing the values in form fields as parameters in following way:
store.load({
params:{
key1:Ext.getCmp('field1').getValue();
}
});
I tried giving parameters in the store proxy itself, but it unfortunately always takes up initial values (values when the form is rendered) and not the latest one entered by the users in the form fields. Following is the method I used for assigning values to params while creating the store:
extraParams:{
key1:Ext.getCmp('field1').getValue();
}
I wanted to seek guidance at two things:
a. While defining a store, can I ensure that store takes latest/current values from the form fields before querying server, so that I don't have to provide these values while calling load function?
This becomes more necessary as I have a paging toolbar at the bottom which carries a refresh button (along with next, last, previous, first icons for navigation).
Now, whenever user clicks at refresh (or any navigation icon), the store gets loaded without the query parameters.
Thus the second thing is:
b. If the answer of 'a' is that - Pass the latest values to parameters manually when calling load function - then how can I write the handler for 'refresh' button and navigation icons (that is, next, last, previous and first) in the paging toolbar, so that I can pass the latest form values to load function.
Thanks for any help in advance.
PS: I am using ExtJS 4.
yourStore.on('beforeload',function(store, operation,eOpts){
operation.params={
status:cmbStatus.getValue(),
value:txtBuscarPor.getValue(),
empresa:'saasd',
app:'dsads'
};
},this);
Related to your question (b) (and because you especially asked for this in the comments section):
I see only one standard way to hook into the PagingToolbar button handlers which is very limited.
Ext.toolbar.Paging fires a 'beforechange' event before it actually changes the current page. See API docs. A listener that returns false will stop the page change.
All other methods require extending Ext classes which wouldn't be a problem if the ComboBox would make it easier to use your own implementation of BoundList (which is the class that renders the dropdown) or pass through config parameters to BoundList resp. the paging toolbar.
I tried to bring this lack of flexibility up on the Ext message board once but was pretty much ignored.
A possible solution for this is to use 'beforeload' event of the store and provide the list of parameters in it. This way, whenever the store is loaded, then its beforeload event is fired and the values picked up are always the latest. Hope this helps someone looking for something similar.

cakePHP: automagic form elements, populating selection list

I have two tables, users{name,id,age_range_id} and age_ranges{id,range_name}.
There are also two models, controllers and the proper view files.
In the views I have the adduser.ctp file, which hold the proper form.
What I want is to have an input (select) that will hold the options from age_ranges.name field.
So, in the users model I've added var $hasMany = 'age_ranges';
What's next?
I know that I can use the $this->set to store the options as an array in the controller and then use it in the view.
but I assume(wrongly?) that by relating the models there is an 'automatic' way to do it.
Which lead me to the question: how?
I won't repeat what Thorpe and dogmatic have already written. They are both correct.
However, although it's difficult to be sure without seeing your model files, commonsense tells me that in the User model the relationship should be User:hasOne:AgeRange and in the AgeRange model it is AgeRange:hasMany:User, not the other way round as you have written.
Also, you do not specify the table name ('age_ranges') in the relationship, but the Model name ('AgeRange').
See these pages in the manual:
http://book.cakephp.org/view/1001/Understanding-Models & http://book.cakephp.org/view/1039/Associations-Linking-Models-Together
add $this->set('ageRanges', $this->User->AgeRange->find('list')); to the controller action
then add $this->Form->input('age_range_id') to the form
You can do this:
$this->User->AgeRange->find('list') and pass that to the view for a select statement

Creating Expandable Forms in Microsoft Access 2007

I need to gather some information from a Microsoft Access form and I need everything to be as organized as possible.
There are a lot of columns that can be filled out, but don't necessarily apply to everyone and I want to keep everything as clean as possible.
In a form, is there any way to have certain input boxes displayed only if the user says they have that information?
For example:
Do you have a dog? () yes (o) no
Do you have a dog? (o) yes () no.............Dog name: [_________________________]
The yes's/no's shouldn't be added to the database, but I can dump them somewhere if need be.
Thanks in advance!
Justian
P.S
I'd like to put this on SharePoint as well, so extra brownie points if you can run me through that as well real quick.
Thanks again!
The way I usually handle this is with an option group for the first question, and a disabled text box for the other information, inside the frame of the option group. In the AfterUpdate event of the option group, you set the enabled property of the textbox:
Me!txtDogName.Enabled = (Me!optHasADog = 1)
...assuming that the value of the YES choice is 1.
You'd likely want to set the default value of the option group to the NO choice, and then you'd have the name field disabled by default.
You would also need the OnCurrent event of your form to do the same thing as in the AfterUpdate event.

Make a radio button in an infopath form "read only"?

I'm making an InfoPath form which is tied to an Access database. I have a set of radio buttons where the user selects the software name corresponding to the form, but I store this in my database as a number (1, 2, or 3). In another view, I want them to be able to see the previously entered software name, but not be able to change this. Here are the two options I've thought of:
Create some rule that does prevents the user from changing this data
This seems like the natural approach for what I want to do.
Add a text field with a function mapping each number to the corresponding software
As the form is tied to the database, InfoPath wants all fields to be tied to a database value, which would require creating another database entry. I'm also having trouble finding an InfoPath function I can use to handle this mapping.
Change the radio box's variable to text values and make a text box in the new view, which can be made read-only.
I'd really prefer not to do this, as it will make things messier for other programs using this database value and seems wasteful, but if nothing else works, this seems do-able.
Is there some sort of rule/method I could use to make this radio button control read-only?
You can use conditional formatting to disable any control (including radio buttons).
To set your control to always be disabled do the following:
Right click on your control and select Conditional Formatting...
Click Add...
In the leftmost dropdown select The expression
type true() in the text field (this tells InfoPath to always apply this formatting)
Check the Disable this control checkbox.
Click OK and OK.
Note: You will need to do this for each of your radio buttons.
Also, for future reference: If you simply want to display the result of a function (such as in your second solution) you don't need to use a text box. You can use an expression box. An expression box is not necessarily linked to a field in the datasorce, so you won't need an additional column in your database for it.