pravinnalkande - Friday, February 3, 2012 12:16 AM:
Dear All,
I am getting a problem when I executing a method it gives me error like 'Body node is not found'
Please tell me solution where is the problem .
Thanks,
Pravin
Yoann Maingon - Friday, February 3, 2012 4:07 AM:
Can You provide us with the method?
Yoann
pravinnalkande - Friday, February 3, 2012 4:33 AM:
Hi Yoann,
I have item type name as Enterprise Feature ,on server event (onAdd)of this item type I have put the method name as getSourceAndTargetItemType
code as below:
-----------------------------------------------------------------------
Innovator inn= this.getInnovator();
string SourceType_ID=this.getProperty("SourceTypeID");
string typeName=this.getProperty("Type");
string newTypeName=typeName.Replace("'", "");
Item getRuleFunction=this.newItem(newTypeName,"get");
//getRuleFunction.setProperty("id",SourceType_ID);
Item sourceItem=getRuleFunction.apply();
//string getItem ="<AML><Item type='sg_ruleFunction' action='get'><id>'"+this.getProperty("rule_id")+"'</id></Item></AML>";;
//Item sourceItem=inn.applyAML(getItem);
Item targetItem = inn.applyMethod("sg_createItems","<ItemType>ae_Sprint Task</ItemType>");
string targetItemAML="<AML><Item type='"+targetItem.getType()+"' action='get'><id>"+targetItem.getProperty("id")+"</id></Item></AML>";
string sourceItemAML="<AML><Item type='"+sourceItem.getType()+"' action='get'><id>"+sourceItem.getProperty("id")+"</id></Item></AML>";
targetItemAML=HttpUtility.HtmlEncode(targetItemAML);
sourceItemAML=HttpUtility.HtmlEncode(sourceItemAML);
Item mappedItemResult=inn.applyMethod("sg_copyProperties",String.Format("<TargetItem>"+targetItemAML+"</TargetItem><SourceItem>"+sourceItemAML+"</SourceItem>"));
//return inn.newError(mappedItemResult.ToString());
if(targetItem.isLocked()==1)
{
targetItem.unlockItem();
}
return this;
--------------------------------------------
Please suggest me solution for this.Its a server event problem or method code problem.
Cheers,
Pravin