solutionModel and relation

Hi,

I want to crate a relation but it keeps telling me that the name already exists as a relation name.
How can I remove it? I already remove the history and the form at the beginning of the method.

I don’t think it is possible to remove a relation, but why would you want to do that? If the relation already exists, you don’t have to create it anymore.

To check if the relation is there, use:

solutionModel.getRelation(name)

Hi Joas,

The relation doesn’t exists. I create it with the method.
The fist time I run the script is no problem, only the second time.

I though like create a new form without remove it first, it wont work a second time.

Hi Irene,

You can also check if the relation exists before the code runs that creates it (same for forms). One way is to just wrap your code that creates the relation in a try/catch block.

Hi Bob,

Thank you it works. So I make progress.

The next problem is that I can’t get rid of the borders.
field1.borderType = “Empty”… it’s string right?

I always see a small line around the field. Buttons and tabs react the same.

Irene,
It also matters what the STYLE you’re using says about the default field. My guess is that your style is telling it to use a border. Easiest is to just change the style - or add a new styleclass (like: field.noborder) and set the “styleClass” attribute of the new object to your new class.