I have two tables: one is a header table, the second its details table. I want to implement a grid containing two selectors. The user will select a header value from the first selector which will cause the second selector to update with the related detail values. What do I need to do to get the second one to update with the proper detail values based on the first selector's selected value?
You just need to set the selector to use Current and point to the Dac/Field used in your header the same way you do a view in a graph.
[PXSelector(typeof(Search<TableTwo.someOtherField,
Where<TableTwo.someRelatedField, Equal<Current<HeaderTable.relatedField>>>))]
In your page file on your grid field, you need AutoRefresh set to true.
<px:PXSelector ID="edAField" runat="server" DataField="AField" AutoRefresh="True" />
If nothing is showing in your selector, make sure the header value is committed before trying to select the value on the grid field.
Related
How to add an input field on processing page grid column.
There is option to add Type in PXGridColumn property but it does not have any value for text box and then the column result as readonly on UI,
Where as the added column should take the input,
Example - Need to process all the Production Order and set its status
Put the field you want to set on the header instead of the detail lines, and then set all the status' based on the header value. Like Hugues said, the entire grid is probably disabled for a reason.
How to create seperate selector for composite primary key...
Like OrderNbr and Revision nbr ...
I am facing issue in selecting the value from Order Nbr selector, it set the values if revision nbr field is default value otherwise Order nbr selector cant set the values in Revision nbr field..
how to set both the fields on selecting the value from any of the selector.
The solution is to have one selector query reference the other key field.
Example for Sales Order which uses two selector control OrderType and OrderNumber:
// User selects the OrderType first
[PXSelector(typeof(Search<SOOrderType.orderType>))]
// OrderNumber Selector reference current OrderType value in selector query
[PXSelector(typeof(Search<SOOrder.orderNbr,
Where<SOOrder.orderType, Equal<Current<this.orderType>>>>)]
You also need to set the AutoRefresh property to True so the selector re-execute the query each time the selector dialog is re-opened. This ensure that it is properly filtered by order type in the example.
<px:PXSelector ID="edOrderType" runat="server" DataField="OrderType"
AutoRefresh="True" CommitChanges="True" DataSourceID="ds">
<px:PXSelector ID="edOrderNbr" runat="server" DataField="OrderNbr"
AutoRefresh="True" CommitChanges="True" DataSourceID="ds">
It is strictly not possible to have a single selector dialog select a record which requires more than one field to be unique. In those special cases, an alternative solution is to add another field which is unique and to select the record based on that field. Note that for your use case two selector controls is
preferable.
To implement this alternative solution add an Identity type column in database as the unique field and decorate the matching DAC field with PXDBIdentity attribute. Keep the other keys as is. The identity field will auto-increment automatically and guarantee the uniqueness based on a single field which is required for the selector to function properly.
I would like to use a dominoViewValuePicker to update several fields with several values. I have seen that it is possible to add multiple values to the one field. Is it possible to select one document from a dominoViewValuePicker and then use multiple values from this document to update multiple fields on the XPage?
Certainly. Just set the onChange event to refresh those fields (preferably, they all go into a panel so that you can do a partial refresh rather than a full refresh) and compute the values (either from the script on the onChange or just by the formulas for determining those values in the first place).
If you do set up a panel for a partial refresh, make sure to give the panel an ID. By default panels are not given ID's and are not available to refresh.
I'm having this categorized view displayed in a view panel where the category column itself is not shown. Instead I'm displaying a combobox above the viewPanel where users can select from all the categories available (see screenshot below). The combo is bound to a scopeVariable and is refreshing the viewPanel onChange. The viewPanel has a computed categoryFilter reading from the same scopeVar. That all works nicely.
Now I also have implemented an additional wildcard (*) value in the selection list which (if selected) programmatically sets the cat filter to NULL. This way I'm forcing the viewPanel to show all entries. Again, this works fine, but with the drawback that now the view is showing empty rows where the category entries would be shown normally (in the screenshot you see empty rows above each entry, with 2 entries for the category "edcom GmbH" obviously belonging to the same category; those aren't separated by an empty row):
One way to at least hide those empty rows would be through means of css coding. But I would prefer those rows not being rendered at all.
Can this be done at all using a viewPanel, and how? Or do I have to use other controls like a repeat or a dataTable maybe?
Thanks in advance,
Lothar
One "hack" (an ugly one I admit) would be to change your categorization column from Firma to Firma:"--All--" or Firma:"*" and then instead of setting the category filter to NULL you set it to "--All--" (or "*").
The double category hits the indexer, but should do what you need.
Obviously there's no easy way. So meanwhile I'll stick to this css-style solution:
In the view panel und All Properties - data I set var = "entry". Then, under All Properties - styling I set a programatic value for the rowClasses property:
if(entry.isCategory()){
return "rowStyleHidden";
}
return "";
The style class "rowStyleHidden" hides those rows using
display: none;
Don't know yet how this turns out performance-wise, I'll have to observe this once I implement it in a copy of the real database.
You can also switch to a none categorized view, by having the viewname calculated based on the value in combobox.
First off I am new to FM but I have a good handle on the basics. What I need to do is this - in a contact information type layout I want to be able to alter the layout based on a specific field. Ex. When the record is brought up, the background of the layout will change colors for a client, another for vendor, etc.
I tried to change a label based on a field, with no success. My guess is that the layout is static and only the data fields change.
We use FM Pro.
Thanks,
Mark
FileMaker layouts are static, but there are still some things you can do to alter the layout based on the values of fields:
Calculation Fields
If you want the data shown in an area to change, you can use a Calculation field. A typical example of this would be a status field. To do this you would add a new field to your table and use enter a calculation on that field like:
Case (
IsEmpty(myTable::myField) ; "Please enter a value for myField." ;
myTable::myField = "wrong value" ; "Please enter a correct value for myField." ;
"Everything seems okay."
)
Conditional Formatting
To make things like background color change you can use a conditionally formatted field. I will typically add an empty numeric field (for this example we'll call it emptyField) and set it so that it can't be edited during modification.
If you place emptyField on your layout, below all the other fields and disallow the user to enter the field in either Browse or Find mode, you can then use conditional formatting to change the field's color.
Portal Hiding
You can use this technique when you want some elements of your UI to disappear when they aren't needed. For example, if you want a "submit" button to appear only when all of the records on a field are filled out.
To use this technique I will usually create a Calculated number field, called ReadyForSubmit, on the original table and give it a logical calculation like:
not IsEmpty(field1) and ... and not IsEmpty(fieldN)
(Note that the value of the above function would be 1 or 0)
I will then create a new Support table in my database and add to it a field One with a calculated value set to 1.
I will then make a relationship between myTable::readyForSubmit and Support::One.
On the layout, create a portal with one row. Put your Submit button in that layout. Now, when readyForSubmit calculates to 1 the button will appear. When it calculates to 0 the button will be hidden.
Hidden Tab Browser
Finally, you can use a tab browser where you set the title font size to 1 point, hide the border, and control the browser programmatically. You can use this for having different field arrangements for different types of records. To do this you would first give an Object name to each tab of the tab browser, say Tab1, Tab2, Tab3.
Then you would add a script, goToTab, with the logic for when you want to go to each tab. Say:
If (myTable::myField = "corn")
Go to Object (Tab1)
Else If (myTable::myField = "squash")
Go To Object (Tab2)
End If
You would then use Script Triggers to run goToTab when On Record Load.
With the release of filemaker 13 there may be another way to do this. You could use a slide control, name the panels in the control, and conditionally switch to the correct panel based on the record type.
you would drop the appropriate fields for the record type in each panel.
http://help.filemaker.com/app/answers/detail/a_id/12012/~/using-slide-controls-and-slide-panels-in-filemaker-pro