Hello, I've been trying to work this out but just can't make it work.
Is it possible to create a domain that will be able to fetch information from attributes of classX to attributes of classY?
example:
I have a class of "GPU"s, the class contains attributes with information about brand, model, speed, ram, etc..
Another class of "Desktop", i want to be able to input the serial number of the GPU, and have all the attribues (or the ones i chose) to show up on the "Desktop" card, that way i can know that PC1 has GPU21 and view all it's details within the same card.
1 . create new PC
2 . Input serial number of verius hardware
3 . Fetch all desired information using the serial number from each class with a match on that serial number.
Is this possible?
I know i can create relations, but i want to be able to view all that information in the same card (the Desktop card)
You can notseethe informationof bothclassesin asinglecard. In thecard "Desktop" you can viewthe descriptionof the model, allother information in themodelare visibleusing the "Modify card" button in the "Relations" TAB. If necessary,you can usea workaround: in theAdministration Module you canmakenovisiblethe "GPU"."Description" attribute,and then you can automatically set its valuewithadatabase triggerby concatenatingthe maininformation you want from the "GPU" class (eg "GPU 21-Dell3412-4GBRAM").
Or you can configure in the Administration Module a View from SQL (read only), or use a report.
You can notseethe informationof bothclassesin asinglecard. In thecard "Desktop" you can viewthe descriptionof the model, allother information in themodelare visibleusing the "Modify card" button in the "Relations" TAB. If necessary,you can usea workaround: in theAdministration Module you canmakenovisiblethe "GPU"."Description" attribute,and then you can automatically set its valuewithadatabase triggerby concatenatingthe maininformation you want from the "GPU" class (eg "GPU 21-Dell3412-4GBRAM").
Or you can configure in the Administration Module a View from SQL (read only), or use a report.
CMDBuild Team
OK I've tried to create a trigger to accomplish this but it doesn't seem to work, here's the function:
CREATE OR REPLACE FUNCTION hvi_check()
RETURNS trigger AS
$BODY$
BEGIN
IF (SELECT EXISTS (SELECT "SerialNumber" FROM "DevelopmentBoards" WHERE "SerialNumber" = NEW."BoardSerial") IS TRUE) THEN
NEW."PBA" := (SELECT "PBA" FROM "DevelopmentBoards" WHERE "SerialNumber" = NEW."BoardSerial");
NEW."WO" := (SELECT "WO" FROM "DevelopmentBoards" WHERE "SerialNumber" = NEW."BoardSerial");
Theworkaroundto whichwe referredwas tovalorize“GPU”.“Description”withthe concatenation of themain informationof that model. In this way,the reference attribute“Desktop”.“GPU” will showin the desktop card the main information of the “GPU” card (the desktop model). Here you can findan example ofhow to concatenate with a trigger the surnameand the name of a person on a “Employee” card, and then seeboththeinformationin the reference attribute “Computer”.“Assignee”: http://www.cmdbuild.org/forum/forum-in-english/908224516?b_start=0#561835818 CMDBuild Team