12-16-2010 08:43 AM
I had thought there was an overload for create history that accepted an opportunity list, I didn't see it but I believe you can assign a new history to an opportunity like this:
History h = ActApp.Actframework.Histories.CreateHistory();
h.OpportunityList = myOppList;
12-16-2010 10:10 AM - edited 12-16-2010 10:13 AM
Doesn't work.. This is for creating an History with an Attachment... I'm talking about the Documents Tab.. Where you can add a file or a shortcut..
12-16-2010 12:15 PM
Yes.. It was my misunderstanding.. sorry...
Now i'm getting Unable to insert a history... at h.update()
12-16-2010 12:36 PM
For debugging purpose.. i try with a Contact instead of an Opportunity... and take a constructor.. and everything works great...
12-16-2010 01:00 PM
And now... if i use this constructor..
12-16-2010 01:14 PM
Alright, so it looks like the issue in your first attempt was that no CreateUser had been assigned, I also believe that'll you'll need to assign the ManageUserID (or you could enter either of these by name). Based on the exception I got trying to run your code sample we'd be violating a foriegn key contraint creating a history that had no contacts associated with it.