How to link a calculated id with a many to one field in Odoo studio? - odoo

I'm working for the first in a new app in odoo, and I have conditionals for several fields so I wanted to use a changing id with a many to one field, in other words my domain is where id=calculated_id which will be only one value, I tried to obtain a string of the name of the many to one field to try it to use it as the context but I retrieved a list of an object similar to [x_model_data(2,)] instead of the desired field value "test 2", I believe that the 2 of the parentheses relates to the calculated id=2

Related

Shopify loop through Field group - Advance custom fields

Im using Advance custom fields app on shopify and created repeatable set of fields using Field group option given.
The issue is I can not find a way to loop through filed groups. One field groups contain all the sub fields inside it.
Custom field setup look like this,
This for a cocktails list so, I have made cocktail as field group and added name, description inside. You can repeat cocktail field group then name. description and other sub fields get repeated along with it which is perfect.
This is how it looks to enter the data
Field Group as you see in shared screenshots is only for Advanced Custom Fields app. For you to access the data, if it is a repeatable field you get the Array as value, if unrepeatable you get the raw value.
Repeatable vs Unrepeatable Fields
For your scenario, you can do something like this. Each field value would be an array.
{%for value in page.metafields.arena.name%}
{{value}}
{%endfor%}
{%for value in page.metafields.arena.description%}
{{value}}
{%endfor%}

How to use value of one field in the SQL query for list of values of another field on Oracle Apex?

I have two fields "course" and "unit" in a form. Both are "Select List". There is a junction table "course_unit" in my database which maps courses and their units. Now, I only want to have those units in my "unit" filed that are assigned to the course selected in "course" field. For that I wrote following query and placed it in "SQL Query" inside "List of Values" option for "unit" field
SELECT unit_name, unit_id
FROM course_unit
WHERE course_id = :P11_COURSE;
This didn't work. I passed a course ID as default value to "course" filed and it worked. Only those units related to the course ID I pass was in the "unit" filed. But changing the course had no effect in "unit" field. I thought this was because every time I select new course the "unit" field wasn't reloading. So I created a dynamic action on "course" field which reloads "unit" field whenever there is any change in "course" field. The "unit" filed is now reloading but still there is no change in values after I select another course. What am I doing wrong? How can I solve this issue?
Should be easy to fix; below the query you wrote is another section named "Cascading list of values" which has one item: Parent item(s). In here, you put item(s) whose value causes select list item's values to change. In your case, it is P11_COURSE.
Also, have a look at Help associated to this property, as well as another ones: "Items to submit" and "Parent required" (depending on Apex version you use).

Breaking the SSRS report depending on the Multi Value Parameter

I am working on a SSRS report with a Multi Value Parameter which contains list of names. I have written an expression for the title that works like "Result for SELECTED NAME". It also have an option of (Select All) which displays all the results with title as "Result for MULTIPLE NAME". It is working fine up to this part.
Now I have to modify the report like, If i select multiple values, the report should break into pages with each selected name on different page with title for that individual parameter value(name) as "Result for SELECTED NAME".
Please help me. Thank you.
You can place the entirety of your current report (excluding headers/footers) into a List object. I assume youa re returning the selected values from the parameter (like Manager Name) as part of your DataSet. Assuming this is the case
Create a new list
Insert the contents of your report into the rectangle of this List
Right click the List Row Header and Select Row Group -> Group Properties
Set the Group to Group on
=Fields!ManagerName.Value
This approach will take a simple table like this
And break it into a list like this
Then you can just set the Tablix Properties of the List to Add a Page Break After to checked
Hopefully this is helpful. If you have further questions on this then please let me know
I worked on it and found a way to make it happen. I first created the row group for Names. Then applied the page break for each instance option. Then deleted that group column (Only deleted column but not group). Then added that group in a static column on the top, and wrote an expressions to show that group itself as a title using concatenation.
But here I faced another problem, when there is no data for the selected name, the title row isn't displayed in the preview as it also a column in the table.

How to handle search for custom fields in form for FROM and TO fields?

I have just started implementing search module in a project, where I have a form with fixed fields consisting of combo box, text box, radio button etc (around 200 fields in multiple tabs), and later client should be able to add extra fields too. Once user fills the fields which he wants to search, that search criteria also he should be able to save. For all these reasons, for each field I am associating metadata in the following format.
"EntityName.attributeName": attributeValue
Once the user fills the form fields to search, I will validate form data and and only non empty fields metadata I am sending to server in JSON format. Everything is fine till now. But I am facing an issues now.
Using the metadata of each field I will create a new criteria for each field. but if there are fields where one field metadata depends on other field metadata I am struck.
In the form I have few special category fields in following format : for example DOB,
FROM DATE (meta data: entity1.dob)
TO DATE (meta data: entity1.dob)
both fields belongs to same entity and same column only field name in the UI is different
Like this I have around 20 fields which asks for FROM and TO to query the range (it need not be on date, for example no of bed rooms..it can be on integer, string etc)
My query formation should be in the following way depending on user search criteria. If user entered only FROM field of number of bed rooms then I have to query using EQUAL to operator in sql and if both mentioned then MORETHANEQUAL to for FROM field and LESSTHANEQUAL to for to field. So how I can handle this special case ?
like if he entered number of fields as 4 in TO field of number of bed rooms, then I have to query for houses having number of bed rooms equal to 4. but if in FROM he entered 3 and in To if he entered 7 then I have to query for houses having greater than or equal to 3 bed rooms and less than or equal to 7 bed rooms.
Since I have same metadata for these category fields also I am unable to proceed, to achieve this, what kind of metadata I need to prepare ?
How I can generalize this process to handle all the cases ?
my technology stack: ExtJs, Eclipse Link, spring.
and what are the best practices to follow to support custom fields adding feature in Forms in enterprise applications ?
Off of the top of my head, I would create wizards for these particular cases. So for example, have a custom wizard that allows the user to define a "from" field, a "to" field, and then the comparison operator in one action. This wizard could also be responsible for adding custom properties to the generated fields that could be used by your validation routine. So based on the combo of from, to, and operator, you could create a flexible validation mechanism for ensuring that correct values are entered, ranges are correct, whatever.
You might consider this "wizard" approach for all custom fields, in fact. I could see you predefining all the possible custom field types that could be used and create classes that can be used for those. The classes could be responsible not only for the field creation, but also for providing any custom validation, pre-submit transformation, etc. This approach would make adding new custom field types incredibly simple since all you'd have to do is follow the same implementation as the others that already exist, extend an existing one, etc.

Placing variable number of variables into fields in table

I am trying to make a generic notInList function that is called when the user types a value in a combobox that is not part of the list. In middle of that function, I want to insert the new value(s) into a table.
For some of the combo-boxes, more than one field has to be filled out in the table. (The user is asked a follow-up question about the not-in-list value, and the answer to the follow-up also has to be put into the table). The values that have to be inserted in the table are stored in variables in the code.
The way I have been dealing with this so far is through a table that has one record for each combo-box id, field, and variable name (the name of the variable that contains the value to be inserted into the field) combination. The code loops over all the records that relate to this combo-box and builds one list of field names and one list of variable names to be used in a SQL statement (Insert...values...).
However, I can't figure out how to use the name of the variable (retrieved from the table) to get the value stored in the variable. AddVar is the column in the recordset that contains the name of the variable I am trying to get the value of. I tried eval(rs!AddVar) but that doesn't work.
I am able to get the name of the variable from the table, but then I am stuck. How can I get the value (a string) stored in that variable?
You might be interested in the Dlookup() function. Basically, you just pass it a field name, a table name, and some optional criteria, and it will give you the first result it finds.
Consider the example:
=DLookUp("[LastName]", "Employees", "[EmployeeID] = 7")
This will go into the "Employees" table, find the first record where "[EmployeeID] = 7", and return to you the [LastName]. Hope this helps.
http://support.microsoft.com/kb/208786