Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: SomersetGraham on March 12, 2010, 10:42:44 pm

Title: Model Searches
Post by: SomersetGraham on March 12, 2010, 10:42:44 pm
Hi All
I have a search defined in EA as
Code: [Select]
SELECT Supplier FROM t_xref WHERE t_xref.Name='Element' AND t_xref.Type='reference' AND t_xref.Client='<Search Term>'
This returns the results I want.
Now I want to call this search from my addin code so I put
Code: [Select]
                   EA.Collection references = Repository.GetElementsByQuery("xxxxxx", CurrentlySelectedElement.ElementGUID);
when this runs I get a dialog stating I must include eaguid as CLASSGUID
in the sql statement.
If I include this I get an error dialog stating that there are 'too few parameters - expected 1'
Why is this the case?
Confused
Graham
Title: Re: Model Searches
Post by: KP on March 15, 2010, 08:53:46 am
Try ea_guid...

Code: [Select]
SELECT Supplier, ea_guid as CLASSGUID FROM t_xref WHERE t_xref.Name='Element' AND t_xref.Type='reference' AND t_xref.Client='<Search Term>'