I wrote a job for performing insert in a table
static void Job(Args _args)
{
ProjExtCat projExtCat;
ProjExtMap projExtMap;
Projcategory projcategory ;
while select projcategory where projcategory.Active == 1
{
projExtMap.CategoryID = projcategory.CategoryId ;
projExtMap.CategoryName = projcategory.Name;
projExtMap.ProjId = "100001";
projExtMap.insert();
print "inserted";
}
}
The above method inserts categoryid and category name with the project id. But I want it to validate code on top of insert ,whether if the table has already category id with the same project id then it should not insert. Like the table should have distinct category id with respect to project id. For example it should not insert having categoryid 1111 for project 100001 twice. It can insert records like categID 1111 for project 100002. Please let me know if its not clear.
Thanks