Some small things

MatthijsG

New member
Some questions. I think the're covered in the Russian documentation, but my Russian isn't quite good ;-)

- Is it possible to create a one-to-many-link and how? Like, one object with adres, which is selectable in the object 'person'
- Is it possible to join fields? In object adres i need separate fields for Street and Number, but i want a third field Street-Number where these are joined.
 

Vladimir

Administrator
Staff member
Is it possible to create a one-to-many-link and how? Like, one object with adres, which is selectable in the object 'person'
In the program, the concept of "one-to-many" is implemented through the Form of Link with the child subordinate list: on the basis of the object, a Form of Link is created, and a child object with the property of a subordinate relationship is added to it (equivalent relationship implements the concept of "many-to-many").

Perhaps You need to use such a relationship, choosing a person, and then specifying one of the addresses that correspond to it? This is done by means of a parameter transfer mechanism.

In the attach: an example of such implementation.

1. A Form of Link is created on the basis of a Person and with a child address list (detail is hidden). When a child list is added, the system field of reference to the Person is automatically created in its object (it is displayed in the object in gray color with the addition of a tilde ~ in the prefix).
2. In the order object, the Person and Address fields are created.
3. The Person field has a property of the passed parameter with the name "pers" (name at your discretion).
4. In the Address object, the filter is enabled for the "~Person" field and the received parameter with the same parameter name is set.

If something is not clear, ask clarifying questions, please.
 

Attachments

Last edited:

Vladimir

Administrator
Staff member
Is it possible to join fields? In object adres i need separate fields for Street and Number, but i want a third field Street-Number where these are joined.
The last one is the opposite of How to split a string value into substrings , i think.
To combine several fields into one, as well as to process them with the help of built-in functions, a Composite field is used. The Formula field property specifies the rule by which the value will be created. Example of formula setting:
[Field 1], [Field 2] - [Function(Field3)]
The previous project example (Person.rpr) shows how to use a Composite field.
 

Vladimir

Administrator
Staff member
The archive .rpr was created in 5th version and earlier.
Version 6 creates .rbase archives, but also opens archives of all previous versions.
 

Anti

Administrator
Staff member
We noticed an error in the Linux version that it is impossible to select a file type other than .rbase while import. Today we'll fix it and upload new version on the sit.
 

RSZ-EC

Member
Hi MatthijsG!

- Is it possible to join fields? In object adres i need separate fields for Street and Number, but i want a third field Street-Number where these are joined.
The explanation that Vladimir gave is clear. And for working with text fields there is even a great function: [String(Field=Something?Text1:Text2)], which allows to check if a field contains a specific value and can return two different strings depending of that comparation. This works great for a proper syntax of the resulting field.

For example, if [Number] is empty and [Street] is "Oxford Street", a [Composite] field with

"[Street]-[Number]"

will return Oxford Street- with a ugly hyphen at the end. But if you put this in a [Composite] field:

[Street][String(Number=?:-)][String(Number=?:Number)]

then it will return Oxford Street.

I hope this help you in your projects!
 
Top