Amy_Haas
(Amy Haas)
April 22, 2020, 5:25pm
1
I am using the Attachment business object to add file attachments in E9 using the following code. The code works without an issue. I am trying to convert to E10 and I am having an issue.
E9 Code: Working
Epicor.Mfg.BO.Attachment a = new Epicor.Mfg.BO.Attachment(epicorSession.ConnectionPool);
AttachmentDataSet ads = new AttachmentDataSet();
a.GetNewXFileAttch(ads, relatedtofile, ID, "1ah", "A", "", "", "");
ads.XFileAttch[0].XFileRefNum = ds.XFileRef[0].XFileRefNum;
a.Update(ads);
E10 Code: Issue with the definition of a so the code does not work.
Ice.Contracts.BO.Attachments a = new Ice.Contracts.BO.Attachments(epiSession);
AttachmentDataSet ads = new AttachmentDataSet();
a.GetNewXFileAttch(ads, relatedtofile, ID, "1ah", "A", "", "", "");
ads.XFileAttch[0].XFileRefNum = ds.XFileRef[0].XFileRefNum;
a.Update(ads);
Erp.Adapters.PartAdapter p = new Erp.Adapters.PartAdapter(oTrans);
I do not code very often and any help would be greatly appreciated.
Thanks
Amy Haas
tkoch
(Theodore Koch)
April 22, 2020, 5:52pm
2
This is how you would instantiate a
(in this case) and other BO’s in C#
using Ice.BO;
using Ice.Proxy.BO;
AttachmentImpl attch = WCFServiceSupport.CreateImpl<AttachmentImpl>(epicorSession, AttachmentImpl.UriPath);
ahaas82
(Amy Haas)
April 24, 2020, 1:34pm
3
Thank you for the information. One of the parameters in the GetNewXfileAttch is the guid id. I am assuming this is the Part rev sysrowid. Do you know how I can get that?
Thanks,
Amy
markdamen
(Mark Damen)
April 24, 2020, 2:09pm
4
using Ice.Proxy.Lib;
string whereClause = String.Format("PartNum = '{0}'", "** PartNum to Search **");
string columnList = "PartNum, SysRowID";
var session = (Ice.Core.Session)oTrans.Session;
var bo = WCFServiceSupport.CreateImpl<BOReaderImpl>(session, BOReaderImpl.UriPath);
var ds = bo.GetList("Erp:BO:Part", whereClause, columnList);
MessageBox.Show(ds.Tables[0].Rows[0]["SysRowID"].ToString());
Needs references to these 2 dlls in Custom References:
It’s efficient. because it’s only bringing back the column you need.
ahaas82
(Amy Haas)
April 24, 2020, 3:22pm
5
I am getting an error at the oTrans.Session; oTrans does not exist in the current context
Thanks
Amy
markdamen
(Mark Damen)
April 24, 2020, 4:41pm
6
I get that if I haven’t added the Custom Assemblies references.