0
我正在使用Web API向Acumatica合作伙伴門戶推送使用屏幕ID SP303020的商機。我需要獲取新創建的NoteID,這是來自Acumatica合作伙伴門戶的CRActivity表中的唯一標識符,並存儲到我的數據庫中,因此我不會再次推動相同的機會活動並創建重複項。使用Web API獲取新創建的Activity NoteID
這裏是我使用,以獲得新創建機會的活動NoteID的代碼,但我沒有得到任何
SP303020WS.Screen context = new SP303020WS.Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.AllowAutoRedirect = true;
context.EnableDecompression = true;
context.Timeout = 1000000;
context.Url = "https://sso.acumatica.com/Soap/SP303020.asmx";
SP303020WS.LoginResult result = context.Login(username, password);
SP303020WS.Content CR303020 = context.GetSchema();
context.Clear();
#region Push Activity to Partners Portal
SP303020WS.Content[] CR303020Content = context.Submit
\t (
\t \t new SP303020WS.Command[]
\t \t \t {
\t \t \t \t new SP303020WS.Value
\t \t \t \t {
\t \t \t \t \t Value = actiPartner.AcumaticaCaseID,
\t \t \t \t \t LinkedCommand = CR303020.Opportunity.OpportunityID
\t \t \t \t },
\t \t \t \t new SP303020WS.Value
\t \t \t \t {
\t \t \t \t \t Value = actiType,
\t \t \t \t \t LinkedCommand = CR303020.Activities.Type
\t \t \t \t },
\t \t \t \t new SP303020WS.Value
\t \t \t \t {
\t \t \t \t \t Value = actiCloud9.Subject,
\t \t \t \t \t LinkedCommand = CR303020.Activities.Summary
\t \t \t \t },
\t \t \t \t new SP303020WS.Value
\t \t \t \t {
\t \t \t \t \t Value = actiCloud9.Body,
\t \t \t \t \t LinkedCommand = new SP303020WS.Field { FieldName="Body", ObjectName="Activities"}
\t \t \t \t },
\t \t \t \t new SP303020WS.Value
\t \t \t \t {
\t \t \t \t \t Value = actiCloud9.StartDate.ToString(),
\t \t \t \t \t LinkedCommand = CR303020.Activities.StartDate
\t \t \t \t },
\t \t \t \t CR303020.Activities.ServiceCommands.NewRow,
\t \t \t \t CR303020.Actions.Save
\t \t \t }
\t);
#endregion
#region Getting Newly created Opportunity Activity NoteID
SP303020WS.Screen s2 = new SP303020WS.Screen();
s2.CookieContainer = context.CookieContainer;
SP303020WS.Content schema2 = s2.GetSchema();
var commands1 = new SP303020WS.Command[]
{
\t \t schema2.Opportunity.OpportunityID,
\t \t new SP303020WS.Field { FieldName="NoteID", ObjectName="Activities"},
};
var data = s2.Submit(commands1);
#endregion
謝謝你,工作。 – Krunal