Q:
The Attributes of a field in a section has a checkbox for Inherit dictionary caption. Checked or unchecked doesn't seem to change anything?
Where is this dictionary caption set?
Can a caption be a function? For example, I have a field with a caption "Include VAT". I must change this for different countries, e.g. in Australia VAT is called GST, so the caption should be "Include GST". What would be a good way to implement this.
Is there any capability to setup captions for different languages?
A:
Re 'Inherit dictionary caption':
When 'Inherit dictionary rules' is set to true at both section and formitem level, 'Inherit dictionary caption' determines whether this also applies to the formitem caption. If 'Inherit dictionary caption' is true, the formitem inherits the column's field caption (create/modify column), if false, the formitem can have a caption customized in the UI.
A2:
To do this, I created an external table with the additional field definitions, then I created a procedure that reads the formfields of each section and dynamically edits caption, format, and other properties
Q3:
Is it possible to change the caption in the dictionary via programming? Or to see all the captions in a table to make it easier to change them?
Can the captions be imported from a file?
A3:
Close your App and you can do all that and more in the console using ALTER TABLE. https://www.lianja.com/doc/index.php/ALTER_TABLE
Note that you also have the "MetaData Editor" for additional customization. You could customize the UI based on a "locale" as metadata can be conditional as of Lianja 3.4.
A4:
this is a part of my code
this code
Code:
//////////////////////////////////////////////////////////////////////////////
proc dd_GetFormItem(oPage, oSection)
//////////////////////////////////////////////////////////////////////////////
private oFormItem, m_EDT, k
// per ogni campo della sezione
for k = 1 to oSection.count
oFormitem = oSection.item(k)
m_EDT = dd_GetItemEDT(oFormitem)
m_field = oPage.id + "." + oSection.id + "." + oFormitem.id
dd_SetFieldPropertyX(oFormitem)
endfor
endproc
loop trough the formItem of the "oSection"
then
Code:
//////////////////////////////////////////////////////////////////////////////
proc dd_SetFieldPropertyX(psField)
//////////////////////////////////////////////////////////////////////////////
m_field = psField
m_field.caption = m_caption
I've created a data structure, where, into an external table, I set some properies.
In this way, in a large application, if I need to change the properties of one field, I do not need to change all the single small Lianja application.
This is like to use the Meta type, but I've write this before that.
In this way I change:
Code:
m_field.DataMappingGet = []
m_field.DataMappingSet = []
m_field.autosuggest = []
m_field.autosuggestHeaders = []
m_field.choicelist = []
m_field.caption = []
m_field.tooltip = []
I compose the DataMappingGet and Set with lookup, based on my configuration table.
for example, if I configure a field as a enumerate:
Code:
m_field.DataMappingGet = [keylookup("vt_srv_dd_enumerated", "enumStore", "] + rtrim(m_EDT) + [" + _" + "{}", display)]
m_field.DataMappingSet = [keylookup("vt_srv_dd_enumerated", "enumDisplay", "] + rtrim(m_EDT) + [" + "_" + "{}", store)]
m_field.choicelist = [select display from vt_srv_dd_enumerated where edt = "] + rtrim(m_EDT) + ["]
This formfield properties:
Q4:
What table do I alter?
For example:
In my table vcf!acc there is a field DESCRIPTN which has caption: The a/c description
Can you show me the Alter command to change the caption to My description ?
Also, what is the command to browse all captions?
A5:
e.
Code:
alter table vcf!acc modify constraint descriptn description "My Description"
select * from syscolumns
select * from syscolumnconstraints
Q:
The database I create does not appear in the list.
What I am doing is :
In the Data workspace under Database Names, right click and click on New.
When asked for database name, I enter a name.
Table workspace appears. When I go back to the Database workspace the newly created database is not there. I even tried by adding a table and closing/reopening Lianja. Still the database is not there. However the database folder with all files is present under c:\lianja\data
A:
If you happened to have created a Project, and that Project is selected, the database has to be added to the Project in order to be visible.
So, you can try this: go to the Projects tab, select the (default) project, and then click the Data tab, and see if your database is visible.
A2:
I closed the default project and the database now appears in the list.
Q:
in run time, I intend to create a user_settings table based on the user name
A:
You should be looking at database tenancies.
A2:
is this a user from the same company and database, or different companies with what should be different databases? If the latter, tenancies. If the former, an FK from user in the data table, etc.
Q:
in App Builder this work..
but in App Center, this command:
Code:
select 0
SELECT * FROM syscolumnconstraints where lower(table_schem) = lower(dbname) into cursor cur_columnconstraints
not work..
error message: File 'syscolumnconstraints.dbf' does not exist.
I think this is not a real table..
A:
Correct: it is not a table. It is effectively (don't know what it really is) a stored procedure that reads the information for you. You can't write to it
System tables do not exist in the system database, they are pseudo tables that are created dynamically.
All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352
These answers are also systematized on the site "Lianja developer": https://lianjadeveloper.wordpress.co...gory/database/
Bookmarks