OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottom Favoured: 0
TOPIC: Custom SQL Entity
hansel (User)
Gold Boarder
Posts: 206
graphgraph
User Offline Click here to see the profile of this user
Custom SQL Entity 5 Months ago
Karma: 0  
I need help for the following configuration

1)
I add a Custom SQL Entity with the name "order" by choosing the database table _os_cck_orders of os cck
select query: SELECT * FROM _os_cck_orders

Fields:
id [Do not use]
fk_user_id [Do not use]
fk_instance_id [Do not use]
fk_request_id [Do not use]
instance_type [Do not use]
instance_title [Do not use]
user_email [Do not use]
user_name [Do not use]
status [Do not use]
order_date [Do not use]
etc .....

2)
I add another Custom SQL Entity with the name "content" by choosing the database table _os_cck_content_entity_1 of os cck
select query: SELECT * FROM _os_cck_content_entity_1

Fields:
ceid [Do not use]
fk_eiid [Do not use]
text_textfield_86 [Do not use]
imagefield_87_fid [Do not use]
imagefield_87_list [Do not use]
imagefield_87_data [Do not use]
categoryfield_88 [Do not use]
text_select_list_89 [Do not use]
etc .....

I want to use the table "order" as main table and the table "content" as subtable
I want to connect the fk_instance_id of the orders table with the fk_eiid (rent request row) of the content table
I created a show layout "ORDER" with child entity fields of the content table
How do I have to configure the ID fields to linke the subtable "content" to the main table "orders"?
I tried already many combinations but I always get errors in the frontend.

Entity main table orders
id [not used]
fk_user_id [not used ]
fk_instance_id [not used]
fk_request_id [ID]

Entity subtable content
ceid [ID]
fk_eiid [Child ID] [orders]

Is there any manual how to use the CustomSQL entity to link two tables?
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 7802
graph
User Offline Click here to see the profile of this user
Re:Custom SQL Entity 5 Months ago
Karma: 94  
True say, You must not see "custom sql" entities, we yet not released these features in our Joomla Website builder

We now are checking where error

Regards
Andrew
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 7802
graph
User Offline Click here to see the profile of this user
Re:Custom SQL Entity 5 Months ago
Karma: 94  
Please check now

Also we added to Joomla Website builder to your site, to Price fields settings for thousands separator settings

Regards
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
hansel (User)
Gold Boarder
Posts: 206
graphgraph
User Offline Click here to see the profile of this user
Re:Custom SQL Entity 5 Months ago
Karma: 0  
It is working in the "Show Parent-Child" Layout.
Is there any possibility to show all parents in a list similiar to to "show all instances"? At the moment the frontend layout only shows one parent row linked to the child with the same ID.

Unfortunately it is not working on show instance layout when one adds child entities. I also don't understand the structure of this feature. In my opinion it makes no sence to select the title.
Usually one wants to link the parent with the child using the same ID value or number field value.
Logged Logged
The administrator has disabled public write access.
VlaDOS (Admin)
Admin
Posts: 103
graphgraph
User Offline Click here to see the profile of this user
Re:Custom SQL Entity 5 Months ago
Karma: 2  
Hello!
The Title field is needed to identify the instance when adding a menu item, or when adding a child field in show layouts.
As for your case where only one instance is tied to one order, it is best to use a single query:
Code:


SELECT * FROM #__os_cck_orders as o 
LEFT JOIN #__os_cck_content_entity_2 as ce ON o.fk_instance_id=ce.fk_eiid



Also, it may be necessary to display the selected price field values for the order.
In this case it is necessary to create a separate entity with the query:
Code:


SELECT op.*, f.field_name FROM #__os_cck_orders_price as op 
LEFT JOIN #__os_cck_entity_field as f ON op.fk_fid=f.fid



Set the ID value in the fk_fid field and the Title value in the field_name field, as well as select the fk_order_id field as text or numeric.

Then in the Order Show Layout click Attach Child Enteties Add New, select the created entity, set the mapping by ID in Parents Fields and fk_order_id in Child Fields.
In the field below select the Price to display (the Title field came in handy here, without it it is impossible to identify the required fields) and select the fields we want to display. Repeat the procedure for all types of price fields.
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 7802
graph
User Offline Click here to see the profile of this user
Re:Custom SQL Entity 5 Months ago
Karma: 94  
It is working in the "Show Parent-Child" Layout.
True say as me seem on your site all work good.

1. You may show all layouts for parent or child entities with help "All instances layout"
You created this as example layout ID==80 , 82, 84

2. also you created parent-child layout ID=85 or 86
IN 85 layout - to 1 parent - you see 1 child, if there more child - you will see there more child

3, so now (if you will check chain with 85 ), "all instance" there layout with ID 84, and in 84 layout you use "show instance layout" with ID=83, so in 83 layout you need in, for some field set as redirect "Parent-child layout" in your case 85 layout, Please check attention: "redirect" settings exist only for "text fields"

OR
as proposed in post before, you may not create "parent-child chain" - you may create new "SQL select entity" and in it set SQL request as you need with parent-child tables

ALSo
Please check for 1 order exist many child instances only if you use CART layout, other -in one order you will always see 1 instance. This always true for "Rent Request", when you did request for 1 instance

Regards
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
Go to top