Changes
Created page with "{{Item/Resources/CodeSnippetHeader}} === Example 1 === {{Item/Resources/CodeSnippetInfo|KNO|A document related to a content object is automatically related to the correspond..."
{{Item/Resources/CodeSnippetHeader}}
=== Example 1 ===
{{Item/Resources/CodeSnippetInfo|KNO|A document related to a content object is automatically related to the corresponding WORKPACKAGE object.}}
<syntaxhighlight lang="csharp">
protected override void OnRelationAdded(UBIK.Kernel.Relationship relation, UBIK.Kernel.RelationalObject newChild)
{
//***UBIK
//Your code here
base.OnRelationAdded(relation, newChild);
UBIK.Runtime.WORKPACKAGE wp = (UBIK.Runtime.WORKPACKAGE)this.LK_WORKPACKAGE;
wp.AddRelation(relation, newChild);
if (!wp.IsSaved())
wp.Save();
}
</syntaxhighlight>
[[Category:Internal/Coding]]
=== Example 1 ===
{{Item/Resources/CodeSnippetInfo|KNO|A document related to a content object is automatically related to the corresponding WORKPACKAGE object.}}
<syntaxhighlight lang="csharp">
protected override void OnRelationAdded(UBIK.Kernel.Relationship relation, UBIK.Kernel.RelationalObject newChild)
{
//***UBIK
//Your code here
base.OnRelationAdded(relation, newChild);
UBIK.Runtime.WORKPACKAGE wp = (UBIK.Runtime.WORKPACKAGE)this.LK_WORKPACKAGE;
wp.AddRelation(relation, newChild);
if (!wp.IsSaved())
wp.Save();
}
</syntaxhighlight>
[[Category:Internal/Coding]]
