<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged oppoedit</title>
<link>https://overflow.efficy.io/?qa=tag/oppoedit</link>
<description>Powered by Question2Answer</description>
<item>
<title>Questions about system tables (adding relations, ...)</title>
<link>https://overflow.efficy.io/?qa=4085/questions-about-system-tables-adding-relations</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I need to add &lt;strong&gt;ActiRelations&lt;/strong&gt; in &lt;strong&gt;EditRelationsList.Oppo&lt;/strong&gt; and I know that I have some SQL statements to execute in SQL Server. I'm trying to understand how the system tables work&lt;br&gt;
Can you tell me if I am right or explain to myself:&lt;/p&gt;

&lt;p&gt;SYS&lt;em&gt;TABLES: &lt;em&gt;Contains all existing tables in SQL Server. Efficy Designer uses it when the DB is &quot;upgraded&quot; (create/drop table)&lt;/em&gt;&lt;br&gt;
SYS&lt;/em&gt;FIELDS: &lt;em&gt;contains all the fields of each table (and virtual fields). Efficy Designer uses it when the database is &quot;upgraded&quot;&lt;/em&gt;&lt;br&gt;
SYS&lt;em&gt;RELATIONS: &lt;em&gt;Efficy uses this to join different tables (and specify whether there is a join table)&lt;/em&gt;&lt;br&gt;
SYS&lt;/em&gt;QUERIES: &lt;em&gt;Efficy uses it to generate queries for obtaining data in Consult&lt;/em&gt;&lt;br&gt;
SYS&lt;em&gt;TABLEVIEWS: &lt;em&gt;Efficy uses it to generate queries for obtaining data in Edit&lt;/em&gt;&lt;br&gt;
SYS&lt;/em&gt;ENTITYVIEWS: &lt;em&gt;Contains collections of TABLESVIEWS to know which data to enter in which view&lt;/em&gt;&lt;br&gt;
SYS_RELENTITIES: *I do not understand ??*&lt;/p&gt;

&lt;p&gt;Sorry if I did not speak clearly but it's a little vague for me&lt;/p&gt;

&lt;p&gt;I'm asking because I need to add ** ActiRelations ** to ** EditRelationsList.Oppo **.&lt;br&gt;
I found a sample script that adds the OBJV&lt;em&gt;PROF relationship with SQL statements. I'm trying to create my script from them.&lt;br&gt;
But it contains the following SQL statement:&lt;br&gt;
insert in SYS&lt;/em&gt;ENTITYVIEWS (NAME, ISCUSTOM, TABLEVIEWS) values ('Objv&lt;em&gt;Prof', 1, 'Objv&lt;/em&gt;Prof')&lt;/p&gt;

&lt;p&gt;I looked for the relation Acti-Mail in this one and I can not find any entry Acti&lt;em&gt;Mail or Mail&lt;/em&gt;Acti&lt;/p&gt;

&lt;p&gt;For the moment, my script looks like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;-- add Actions in OppoEdit
Update SYS_ENTITYVIEWS set ISCUSTOM=1, TABLEVIEWS=(SELECT TABLEVIEWS FROM SYS_ENTITYVIEWS WHERE NAME = 'OppoEdit') + ';Oppo_Acti=Acti' where NAME='OppoEdit' 


-- Get Acti data from OppoEdit
insert into  SYS_TABLEVIEWS (NAME, K_TABLE, ISCUSTOM, SELECTFROM, SELECTFIELDS, SELECTJOIN, SELECTORDERBY) 
values ('Oppo_Acti', @K_TABLE, 1, 'ACTI_OPPO ACTI_OPPO, ACTIONS ACTIONS', 'ACTI_OPPO.*, ACTIONS.SUBJECT, ACTIONS.D_BEGIN, ACTIONS.DONE', 'ACTI_OPPO.K_ACTION = ACTIONS.K_ACTION', 'ACTIONS.D_BEGIN DESC, ACTIONS.SUBJECT');
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4085/questions-about-system-tables-adding-relations</guid>
<pubDate>Wed, 10 Apr 2019 13:26:29 +0000</pubDate>
</item>
</channel>
</rss>