Get value of a field with Ndepend - ndepend

I'm trying to make a rule for detect fields that hava assigned values with Ndepend. But I don't know if it's possible to get the value of the fields.
For example, if I have String X='abc' I want to retrieve the x value that would be 'abc'

Related

Filtering a datasource using multi select wild character

Does anyone know if there is a wildcard character in AppMaker that can be used for all possible values for a field in a query?
I currently have a datasource that is being filtered based on the status using a multi-select widget. What I would like to accomplish is when all values have been de-selected I want to load all the records of that datasource without clearing the entire query in case other filters have been applied. I have it working in-a-sense that I have to explicitly construct my query as such:
widget.datasource.query.filters.Status._in = ['Status Value 1','Status Value 2','Status Value 3']
My current solution is loading the correct data when a value is selected and it correctly shows the union of the query as the values are modified. However, it selects all of the values in my multi-select; which I know is how it is supposed to work.
I tried using widget.datasource.query.filters.Status._contains = ''; and changing the assignment value to no avail. I even tried the opposite approach using _notContains
The intended outcome is to have a filtering dashboard appear much like any website where when no filtering is selected all records are displayed. I was hoping to find a wildcard character that would load all of the records. Just trying to find a way to mimic other website filters with all records when none are selected.
Thanks for the time!
So the easiest solution here is to set up your Multiselect as follows:
Options binding:
#models.YourModel.fields.Status.possibleValues
or if you don't have the possible Status values in your model then set your options binding to:
['Status Value 1','Status Value 2','Status Value 3']
Values binding:
#datasource.query.filters.Status._in
Now anytime you select any choices in the multiselect, the query will only include records that include the selected choices. And if you deselect all choices the query will ignore that filter or treat it as an empty array of values, therefore returning all records unless you applied other filters.

a number is required in the selection criteria when using a parameter

I am new to CR, and I think this is a complicated question. When a user runs the report, I want the user to input either nothing - which will get everything, or to input the values for that field - to get those specific values. Let me know if I am approaching this right.
I am trying to use a formula in the record selection formula editor. This formula references a parameter. I am trying to use WrkOrder.Center field - which is a number - in my selection criteria.
I am getting the error "a number is required here" in the record selection formula editor. I need to do a totext or cstr ? It just seems to still be incorrect.
if the center is blank then get all centers, else get the selected center input in the parameters by the users running the report.
if {?Center}="" then true else {?Center}=cstr({WRKORDER.CENTERNBR})
if {?Center} = "" then true else {?Center}={WRKORDER.CENTERNBR}
parameters to get what is either input or get all centers
First thing to check is the data type of your parameter and the data type of database field to ensure they match.
If you edit your parameter the first three controls on the form at the top are Name, Type, and List of Values. The Drop Down Box for Type will identify the data type of your parameter.
To identify the data type of your database field, find the field in the Field Explorer and if you don't already see a data type listed next to the column names for each table, right click on any field name and click "Show Field Type" and this will toggle the display of the field data type on and/or off. Its usually off by default I believe.
In order to use a comparison with the = operator, these two objects must have matching data types. You aren't able to change the data type of a database field, but you can change the data type of your parameter to match it.
Hopefully this will fix your error. The most common cause of the error message you are receiving is when one field is a Number type and the other is a Text type. Functions that convert the data will work in formula fields, but usually will continue to throw errors when used in selection expert formulas.

Parse ClassFormDefinition for a Custom Page Type Field's Values

I want to populate a dropdown in my webpart from a custom page type field's values.
so for e.g I have a custom pagetype my.pagetype which has a field called myfield and has value like 1,2,3. How Do I get these 1,2,3 values ?
How do I access through SQL or macro so far I have reached till here and this code is giving me a long XML Schema string which has all fields definition and values of the custom page type.
CMSContext.Current.GlobalObjects.Classes["my.pagetype"].ClassFormDefinition
How do I get around?
Are you populating the drop down list in that Page Type manually? (e.g. 1, 2, 3)
If you want to reuse the same list of value in multiple places, it's better for you to create a custom table to store those value (e.g. customtable_myListX). Then for the drop down list, you can use the SQL option (SELECT Value, Display FROM customtable_myListX).

Restrict Custom Field Value Responses for Contacts

When sending a GET query for matters, you can use the custom_field_ids[] key with a custom field id as the value to pull down the fields for a specific custom field assigned to a matter.
The documentation shows no similar functionality for the contact object. I'm having to pull all custom_field_values{field_name,value} and parse this result to find the specific custom field value I'm looking for, when I'm querying a contact.
Is there a better way to get the custom field value for a specific custom field id for contacts than what I'm doing above? If not, I'd love to see the custom_field_ids[] parameter applied to the contact object.

Filemaker value validation against value list

Need to validate values within a field against Value List, retaining the value if on list but substituting a specific Value if not?
I am afraid you are mixing two separate things:
Validation checks if some conditions have been satisfied; if not, it throws an error. It will not correct the entry.
If you want user entry to be corrected, you need to either:
define the field to auto-enter a calculated value; or
attach a script trigger to it, and have the script modify the value entered by the user.
In this case, you could auto-enter a calculated value (replacing existing value) =
If ( IsEmpty ( FilterValues ( Self ; ValueListItems ( Get (FileName) ; "YourValueList" ) ) ) ; "Specific Value" ; Self )
--- Added in response to your clarification ---
Technically, you could run a script to find the records you want to verify and do Replace Field Contents (using the same calculation) on that field. You could run the script after changing the value list, as part of the weekly routine.
However, there are two major problems with this approach:
some records could be locked by another user;
you have no history of what happened, and no way to go back in case of making a mistake.
I also don't think it's good practice to have users modify a value list routinely. If you need to have a weekly list of values, you should store them in records, not in a value list. That way at least the part of the value list would have a history.
Another option you may consider is using an unstored calculation field with a similar formula. This would change dynamically with the value list, and leave the original field unmodified. This would be a good arrangement if, for example, you need to export the corrected values every week.