Inheritance of classes with columns with a same code

Questions about scripting in rules, workflow and elsewhere

Inheritance of classes with columns with a same code

Příspěvekod andesys » ned 06. pro 2015 11:00:25

(Translated from another language)
If I have two classes when the second one inherits from the first one, can I have in both the classes a column with the same code? How will be these properties used in scripts?
Uživatelský avatar
andesys
 
Příspěvky: 103
Registrován: úte 25. srp 2015 10:55:14

Re: Inheritance of classes with columns with a same code

Příspěvekod andesys » ned 06. pro 2015 11:00:45

Yes, uniqueness is required within a single class. When accessing the column from a script you distinguish:
1) If the column is from the class, for which the record is read, then use a normal access: dr['name'] = ...
2) if the column is from a parent class, use adapted access: dr['parent_class_code.name'] = ...
Uživatelský avatar
andesys
 
Příspěvky: 103
Registrován: úte 25. srp 2015 10:55:14


Zpět na Scripting

Kdo je online

Uživatelé procházející toto fórum: Žádní registrovaní uživatelé a 1 návštěvník