Shopify loop through Field group - Advance custom fields - shopify

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%}

Related

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

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

Bizagi create dynamic combobox

Guys!
I'm working on a project with Bizagi Suite - Version 11.1. I'm new to it and I will really appreciate your help, because I'm having a hard time creating a dynamic combobox control.
So my case is the following:
Data Model: 3 master tables: Program, Order and Order-Program (m-m relationship). In table Program users fill out year, positions and amounts for each position. In table Order, they fill out info about the order and they have to specify from which program they want to take the money out for the order. The Program itself has a lot of records with different positions and amount. And I want when the users fill out the order to select the year, the position and the amount they want to take out of the program. So I need to have a dynamic combobox for the field 'position' which loads when user select year.
In other words I need to load combobox with filtered records of master table.
Do you have any ideas how I can do that?
Thank you in advance!
Best regards,
A.Mincheva
You must define your combobox with the full content of the master table.
Then ,you can define a Filter expression to dynamically filter the combobox content.
In the filter expression, you need to retreive the value of selected Year with XPath and use this value to filter the records.
In the form designer, you go to "Actions & Validations" to define the following action :
When "Year" changes <=The display name of the input field
Then Refresh "Program" <=The display name of your dynamic combobox

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.

Access 2010 Database Clenup

I have problems with my records within my database, so I have a template with about 260,000 records and for each record they have 3 identification columns to determine what time period the record is from and location: one for year, one for month, and one for region. Then the information for identifying the specific item is TagName, and Description. The Problem I am having is when someone entered data into this database they entered different description for the same device, I know this because the tag name is the same. Can I write code that will go through the data base find the items with the same tag name and use one of the descriptions to replace the ones that are different to have a more uniform database. Also some devices do not have tag names so we would want to avoid the "" Case.
Also moving forward into the future I have added more columns to the database to allow for more information to be retrieved, is there a way that I can back fill the data to older records once I know that they have the same tag name and Description once the database is cleaned up? Thanks in advance for the information it is much appreciated.
I assume that this will have to be done with VBA of some sort to modify records by looking for the first record with that description and using a variable to assign that description to all the other items with the same tag name? I just am not sure of the correct VBA syntax to go about this. I assume a similar method would be used for the backfilling process?
Your question is rather broad and multifaceted, so I'll answer key parts in steps:
The Problem I am having is when someone entered data into this
database they entered different description for the same device, I
know this because the tag name is the same.
While you could fix up those inconsistencies easily enough with a bit of SQL code, it would be better to avoid those inconsistencies being possible in the first place:
Create a new table, let's call it 'Tags', with TagName and TagDescription fields, and with TagName set as the primary key. Ensure both fields have their Required setting to True and Allow Zero Length to False.
Populate this new table with all possible tags - you can do this with a one-off 'append query' in Access jargon (INSERT INTO statement in SQL).
Delete the tag description column from the main table.
Go into the Relationships view and add a one-to-many relation between the two tables, linking the TagName field in the main table to the TagName field in the Tags table.
As required, create a query that aggregates data from the two tables.
Also some devices do not have tag names so we would want to avoid the
"" Case.
In Access, the concept of an empty string ("") is different from the concept of a true blank or 'null'. As such, it would be a good idea to replace all empty strings (if there are any) with nulls -
UPDATE MyTable SET TagName = Null WHERE TagName = '';
You can then set the TagName field's Allow Zero Length property to False in the table designer.
Also moving forward into the future I have added more columns to the
database to allow for more information to be retrieved
Think less in terms of more columns than more tables.
I assume that this will have to be done with VBA of some sort to modify records
Either VBA, SQL, or the Access query designers (which create SQL code behind the scenes). In terms of being able to crunch through data the quickest, SQL is best, though pure VBA (and in particular, using the DAO object library) can be easier to understand and follow.

How to use query for grid\enhancedGrid?

I want to sort information in a dojo EnhancedGrid (connected to database through JsonRestStore). I know dojo grids provide functionality to sort based on a single column. However, in my grid, one column contains combined information from multiple fields (e.g., last name, first name, email, age) of database table. Is there a simple way to sort the grid or the data in the store based on a single filed in database table (e.g., last name)?
It seems I can use "query" to change the view of the store (grid is a view of the store if I understand correctly), but I don't understand how to write a query to do that. Can anyone give me more information about the syntax of using query or how to solve this issue?
Thank you!
It looks like you have to use what is called a comparatorMap for customized grid sorting.
here's one example :
http://www.ibm.com/developerworks/web/library/wa-aj-dojogrid/index.html
(look for the section 'Listing 15. Customize the sort function of Dojo
Grid')
inside the comparator map function is where you would convert the strings to
numbers and make the numeric comparison.