I installed Wikiforce without incident onto a sandbox. I like what I saw and installed into production. I followed the instructions per the Google Code page. I set the override on the Wiki tab to the Wiki Overview VisualForce page. When I go to that tab or page, it says that the page is not there. ...I see the page in pages (wf_WikiOverview).
I've been trying to properly generate java code from the wsdl schema for the past few days and no luck at all or partially functional. I am trying to use the axis 1.4, but I am not able to configure it properly so it generates the right java syntax.
If anyone has it set up and is willing to help would be appreciated I will send my wsdl over email.
Thanks in advance.
I have a requirement where i need to check the Owner Territory, and User Title Before Update,
The Previous owner can transfer the particualr opportuntiy to a new Owner if the Parent Territory of both (New Owner, Previous Owner) are same and the new user has title as "Special" . A particular user can sit on more then one territory. so only those users can be new owner which satisfy this condition.
I am new to Apex, i wrote something based on S-Control i saw on the community.
trigger NewOwner on Opportunity (before update, after update)
//string profileid =UserInfo.getProfileId();
ID oppsid = Trigger.old.Id;
User PreviousOwner = [select id, profileid from User where id=:Trigger.old.OwnerId Limit 1];
//String OwnerId = user.Id;
// Territory of the Owner
UserTerritory OwnerTerritory = [select Id, TerritoryId, IsActive from UserTerritory where UserId=:Trigger.old.OwnerId and IsActive = TRUE];
for(Integer i=0; i<OwnerTerritory.size(); i++)
// Parent Territory of the Owner
Territory OwnerParentTerritory = [select Id, Name, ParentTerritoryID from Territory where Id=:OwnerTerritory[i].TerritoryId];
for (Integer j=0; j<OwnerParentTerritory.size(); j++)
// Get the New User's Id and Title.
User NewOwner = [select Id, Title from User where id=:Trigger.new.OwnerId Limit 1];
// To get the New User's Territory
UserTerritory NewOwnerTerritory = [select Id, TerritoryId, IsActive from UserTerritory where UserId =:Trigger.new.OwnerId and IsActive = TRUE];
Territory NewOwnerParentTerritory = [select Id, Name, ParentTerritoryID from Territory where Id=:NewOwnerTerritory.TerritoryId];
for(Integer k=0; k<NewOwnerParentTerritory.size(); k++)
if(NewOwner.Title == 'Special' && NewOwnerParentTerritory[k].ParentTerritoryID == OwnerParentTerritory[j].ParentTerritoryID)
UserTerritory OldOwner = [select TerritoryId, UserId from UserTerritory where UserId=:Trigger.old.OwnerId and IsActive = TRUE];
for(Integer l=0; l<OldOwner.size(); l++)
for(UserTerritory OldOwnerTerritoryUsers:[select UserId from UserTerritory where TerritoryId=:OldOwner[l].TerritoryId and IsActive = TRUE])
OpportunityShare oppsshare = new OpportunityShare();
oppsshare.OpportunityId = oppsid ;
oppsshare.UserOrGroupId = OldOwnerTerritoryUsers.UserId;
oppsshare.OpportunityAccessLevel = 'Read';
insert oppsshare ;
catch (Exception e)
Trigger.new.OwnerId.addError('Deal can only be assigned to User in your parent territory and with title as Special');
The trigger saved and also is valid but at the time of Operation, i recieve this error message.
Error - Apex trigger: NewOwner caused an unexpected exception, contact your administrator: NewOwner: execution of BeforeUpdate caused by: System.ListException: List index out of bounds: 0: Trigger.NewOwner
Error: Apex trigger NewOwner caused an unexpected exception, contact your administrator: NewOwner: execution of AfterUpdate caused by: System.Exception: Too many SOQL queries: 21: Trigger.NewOwner: line 18, column 19
If someone can please help me with this, would be great help.
Many Thanks in Advance.
Message Edited by Developer118 on 02-12-2008 02:16 PM
Message Edited by Developer118 on 02-12-2008 02:17 PM