I have a QTableView based on a QSqlRelationalTableModel. Editing, adding and deleting is no problem but I would like to change a field programaticaly.
(more specific: click on a field, pop-up a QFileDialog to select a file and then filling that field with the result).
How do I do that?
Found it:
QSqlRelationalTableModel.record to get the record
QSqlRelationalTableModel.record.setvalue to change a value
QSqlRelationalTableModel.setrecord to write the record to the database
Related
Here is an image of it. I want the default value to be Open when the toggle is selected as yes.
Change the Default setting for the dropdown control to a formula along these lines:
If(MyToggle.Value=true,"Three","One")
If the control is a Combobox, which is what's used for a SharePoint Choice column, then the items are records, not just a list of text. For a combo box you need to change the property for "DefaultSelectedItems" and set it to something like this:
If(MyToggle.Value,{Value:"Three"},Parent.Default)
Make sure that the value you are using is a valid one according to the SharePoint choice column definition.
I have a created list with values in it
When I create an item and click on "Next" then it should save and redirect to "Edit form". But instead of showing the values I have entered, it shows the previously edited item.
What am I doing wrong?
Please check the default value of the form.And also one thing you can do is ,you can always filter the First row from the list,so it always shows the latest saved data.
How can i change the Type of the Custom field in Acumatica?
I created a new custom field of "ComboBox" Type for the Sales Order Header Section.Now i would like to change its type to "TextEdit" so the user can manually enter any value in it. So far there are only few Sales order where user has entered the value in this field.
Thanks
Combo boxes are stored in string fields in the database - you can therefore easily replace the control on the page with a text edit field. The simplest way is to remove the combo box from the layout editor, and then adding it back as a text box from the "Add Data Fields" tab. If you want to modify the properties of the field itself, you have to go to the Data Access section and modify the attributes of the field (PXDBString + remove PXStringList attribute if you have one). Lastly, if this is a field you were creating as part of your customization project, you might have to manually edit the Table node of the project XML (File -> View Project XML)
Im facing a problem with a hide-when formula of an editable field in lets say Document A. The hide-when formula includes a #DbLookup statement, where a field of Document B is read. Dependent on that field, it is hidden or shown.
When I open the Document A, it works just fine and the editable field is hidden. Then I go back to Document B and change the value of the field so the field shows in Document A it is still hidden. Only when I go back in the Notes Designer and save the form of Document A again the hide-when formula works correctly again.
So everytime I change the value of the field in Document B, I have to save the form of Document A again for the hide-when formula to work correctly.
Note that I use #If and #True/#False in my hide-when formula, as it is not that simple as I've explained above.
Any solution in order to make the hide-when formula work correctly?
Thanks in advance!
Add "NoCache" to first parameter of #DbLookup("":"NoCache"; ... ).
This will read the data from your Document B every time not just at first call (or after changing form).
I would like to have first column in my table editable. That works fine. However table looks normal and only when I click on the editable cell, it looks like input box. I would like to have this look of inputbox as default on every editable column in my table, so user knows right away which cell he is able to modify and which one he cannot. I figured I will have to modify caspian.css, but I couldn't find anything there. Is there easier, programmatic way to do this?
Thanks
You need to set the cellFactory of your column, inside it you can specify what you want by default on your cell by setting is graphics
explanation
and here