CMDBuild Forum

enable PresetFromCard for class

Hi there,

We would like to provide a option as 'select from template' when creating a card object, then it will clone all attribute values of template to specific card object... e.g. The function will be similar to 'compose email' button in CMDBuild, you can pick up a email template when compose a email.

I notice there's a presetFromCard widget and it seems like what we want. I wonder if it's possible to enable 'presetFromCard' widget for all card. so user can add a 'presetFromCard' in the widget tab.  or if there's other way to achieve it. 

 

Thank you

The “presetFromCard” widget can be used in workflows, but not in a normal card (Administrator Manual p. 26).
Another solution is to put in the card the widget “startWorkflow” to start a workflow (wizard) with one or two steps in which ask the necessary information and then perform the corresponding automatic operations.
CMDBuild Team

Hi there, 
 
Thank you for prompt reply 
 
PresetFromCard widget will take ClassName as one of parameter. I wonder if it's possible to set the value of ClassName as variable instead of static string. 
 
e.g.  ClassName = ClonedClass.getCode() , 
ClonedClass is a lookup type attribute. User picks up the class type they would like to be cloned. Then click advance. Then presetFromCard will take whatever user choose to provide appropriate list 
 
Previously Tecnoteca wrote:
The "presetFromCard" widget can be used in workflows, but not in a normal card (Administrator Manual p. 26).
Another solution is to put in the card the widget "startWorkflow" to start a workflow (wizard) with one or two steps in which ask the necessary information and then perform the corresponding automatic operations.
CMDBuild Team

 

Hi,

ClonedClass is a list of class name (Lookup) . When User pick up a class, I would like to provide different template list via presetFromCard button. 
 
I have been tried out below options and none of them works.  but no luck so far . Does the ClassName in presetFromCard only take predefined string ? 
 
ClassName = client:ClonedClass.Code 
ClassName = {client:ClonedClass.Code}
ClassName = ClonedClass.getCode()
 
Thank you 
 
Previously Sandy wrote:
Hi there, 
 
Thank you for prompt reply 
 
PresetFromCard widget will take ClassName as one of parameter. I wonder if it's possible to set the value of ClassName as variable instead of static string. 
 
e.g.  ClassName = ClonedClass.getCode() , 
ClonedClass is a lookup type attribute. User picks up the class type they would like to be cloned. Then click advance. Then presetFromCard will take whatever user choose to provide appropriate list 
 
Previously Tecnoteca wrote:
The "presetFromCard" widget can be used in workflows, but not in a normal card (Administrator Manual p. 26).
Another solution is to put in the card the widget "startWorkflow" to start a workflow (wizard) with one or two steps in which ask the necessary information and then perform the corresponding automatic operations.
CMDBuild Team

 

 

The presetCard fill a process card taking some attributes from a card selected in a widget.
The attributes should be mapped in the assignment of the property AttributeMapping.

So, maybe, you could write this: AttributeMapping="ClassName=ClonedClass"

Example.
Let's assume you are filling the closure of an IncidentManagement.
The solution is already known so, you want to be selected from your KB and but in the current "Answer" field.
You will write:
ClassName="KnowledgeBase"
ButtonLabel="Current KB"
AttributeMapping="Answer=Description"
Filter="from KnowledgeBase where KBCategory ={client:Category}"

where KBCategory and KBDescription are attributes of the class "KnowledgeBase" while Answer and Category are attribute of "IncidentManagement".

Hope this helps you to understand better how this widget works. 
 
Best regards.
CMDBuild Team