12-15-2010 02:01 PM
Hi!
I need information about create an attachement in the documents tab for an opportunity...
Thanks!
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..
Thanks
12-16-2010 12:02 PM
I understand, the documents tab and the items on it are just a type of history (Library Document)
12-16-2010 12:15 PM
Yes.. It was my misunderstanding.. sorry...
Now i'm getting Unable to insert a history... at h.update()
Thanks
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...
Thanks
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.
12-16-2010 01:43 PM
It work! Like you said, we need to assign the CreateUserID property.. and the ManageUserID is not needed!
Thank you very much for your help!