Wednesday, March 14, 2012

Create Enum Dynamicaly by Code

 Interesting Code...try it
 put this code in job and run


static void Creat_Enum(Args _args)
{
TreeNode node;
TreeNode dynamicEnum = TreeNode::findNode("\\Data Dictionary\\Base Enums\\DynamicEnum");
Dialog dialog = new Dialog();
int id;
;

if(dynamicEnum)
{
  if(box::yesNo("allready exist wanna delete",dialogbutton::No)==dialogbutton::yes)
{
    dynamicEnum.AOTdelete();
    node = TreeNode::findNode("\\Data Dictionary\\Base Enums");
    dynamicEnum = node.AOTadd("DynamicEnum");
    dynamicEnum.AOTadd("jitendra");
    dynamicEnum.AOTadd("sagar");
    dynamicEnum.AOTadd("iswar");
    dynamicEnum.AOTadd("Arun");
    dynamicEnum.AOTsave();
    dynamicEnum.AOTcompile();
    info("DynamicEnum created");
}
}
else
{
    node = TreeNode::findNode("\\Data Dictionary\\Base Enums");
    dynamicEnum = node.AOTadd("DynamicEnum");
    dynamicEnum.AOTadd("jitendra");
    dynamicEnum.AOTadd("sagar");
    dynamicEnum.AOTadd("iswar");
    dynamicEnum.AOTsave();
    dynamicEnum.AOTcompile();
    info("DynamicEnum created");
}

}

 

No comments:

Post a Comment