私は(クライアント)側でケースを閉じるたびに、Web APIを使用してPartners Portalのケースをリモートで終了したいと考えています。私はコードを実装することができましたが、以下の問題に遭遇しました。APIを使用したAcumaticaの終了ケース
パートナーポータルでケースのステータスと解像度が変更されていますが、[ケースを閉じる]ボタンが有効になっており、これは[マイオープンケース]バケットに表示されます。 Web APIを使用してリモートでケースを閉じることができるかどうか、または何か不足している場合は教えてください。
protected virtual void CRCase_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
\t var caseRow = (CRCase)e.Row;
\t if (caseRow != null)
\t {
\t \t if (caseRow.Status == "C") // Closed
\t \t {
\t \t \t string cloud9CaseCD = null;
\t \t \t cloud9CaseCD = CRCaseForCreate.Current.CaseCD;
\t \t \t string acumaticaCaseCD = string.Empty;
\t \t \t CSAnswers aCCaseNoAttribute = PXSelect<CSAnswers,
\t \t \t Where<CSAnswers.refNoteID, Equal<Required<CSAnswers.refNoteID>>,
\t \t \t \t \t And<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>>>>.Select(new PXGraph(), CRCaseForCreate.Current.NoteID, "ACCASENO");
\t \t \t if (aCCaseNoAttribute != null)
\t \t \t {
\t \t \t \t acumaticaCaseCD = aCCaseNoAttribute.Value;
\t \t \t \t if(!string.IsNullOrEmpty(acumaticaCaseCD))
\t \t \t \t {
\t \t \t \t \t SP203000WS.Screen context = new SP203000WS.Screen();
\t \t \t \t \t context.CookieContainer = new System.Net.CookieContainer();
\t \t \t \t \t context.AllowAutoRedirect = true;
\t \t \t \t \t context.EnableDecompression = true;
\t \t \t \t \t context.Timeout = 1000000;
\t \t \t \t \t context.Url = "https://sso.acumatica.com/Soap/SP203000.asmx";
\t \t \t \t \t PartnerPortalCreds loginCreds = GetCreds();
\t \t \t \t \t string username = loginCreds.PARTPRTUSE;
\t \t \t \t \t string password = loginCreds.PARTPRTPAS;
\t \t \t \t \t SP203000WS.LoginResult result = context.Login(username, password);
\t \t \t \t \t SP203000WS.Content CR306000 = context.GetSchema();
\t \t \t \t \t context.Clear();
\t \t \t \t \t SP203000WS.Content[] CR306000Content = context.Submit
\t \t \t \t \t \t (
\t \t \t \t \t \t \t new SP203000WS.Command[]
\t \t \t \t \t \t \t {
\t \t \t \t \t \t \t \t new SP203000WS.Value
\t \t \t \t \t \t \t \t {
\t \t \t \t \t \t \t \t \t Value = acumaticaCaseCD,
\t \t \t \t \t \t \t \t \t LinkedCommand = CR306000.Case.CaseID
\t \t \t \t \t \t \t \t },
\t \t \t \t \t \t \t \t \t new SP203000WS.Value
\t \t \t \t \t \t \t \t {
\t \t \t \t \t \t \t \t \t Value = "C",
\t \t \t \t \t \t \t \t \t LinkedCommand = new SP203000WS.Field { FieldName="Status", ObjectName="Case"}
\t \t \t \t \t \t \t \t },
\t \t \t \t \t \t \t \t new SP203000WS.Value
\t \t \t \t \t \t \t \t {
\t \t \t \t \t \t \t \t \t Value = "RD",
\t \t \t \t \t \t \t \t \t LinkedCommand = new SP203000WS.Field { FieldName="Resolution", ObjectName="Case"}
\t \t \t \t \t \t \t \t },
\t \t \t \t \t \t \t \t CR306000.Actions.Submit,
\t \t \t \t \t \t \t \t CR306000.Case.CaseID
\t \t \t \t \t \t \t }
\t \t \t \t \t);
\t \t \t \t \t context.Logout();
\t \t \t \t }
\t \t \t }
\t \t }
\t }
}
: - あなたがケースがすでに閉じられていることを確認することができます下の画像が、閉じる場合には
protected virtual void CRCase_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
\t var caseRow = (CRCase)e.Row;
\t if (caseRow != null)
\t {
\t \t if (caseRow.Status == "C") // Closed
\t \t {
\t \t \t string cloud9CaseCD = null;
\t \t \t cloud9CaseCD = CRCaseForCreate.Current.CaseCD;
\t \t \t string acumaticaCaseCD = string.Empty;
\t \t \t CSAnswers aCCaseNoAttribute = PXSelect<CSAnswers,
\t \t \t Where<CSAnswers.refNoteID, Equal<Required<CSAnswers.refNoteID>>,
\t \t \t \t \t And<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>>>>.Select(new PXGraph(), CRCaseForCreate.Current.NoteID, "ACCASENO");
\t \t \t if (aCCaseNoAttribute != null)
\t \t \t {
\t \t \t \t acumaticaCaseCD = aCCaseNoAttribute.Value;
\t \t \t \t if (!string.IsNullOrEmpty(acumaticaCaseCD))
\t \t \t \t {
\t \t \t \t \t SP203010WS.Screen context = new SP203010WS.Screen();
\t \t \t \t \t context.CookieContainer = new System.Net.CookieContainer();
\t \t \t \t \t context.AllowAutoRedirect = true;
\t \t \t \t \t context.EnableDecompression = true;
\t \t \t \t \t context.Timeout = 1000000;
\t \t \t \t \t context.Url = "https://sso.acumatica.com/Soap/SP203010.asmx";
\t \t \t \t \t PartnerPortalCreds loginCreds = GetCreds();
\t \t \t \t \t string username = loginCreds.PARTPRTUSE;
\t \t \t \t \t string password = loginCreds.PARTPRTPAS;
\t \t \t \t \t SP203010WS.LoginResult result = context.Login(username, password);
\t \t \t \t \t SP203010WS.Content CR306000 = context.GetSchema();
\t \t \t \t \t context.Clear();
\t \t \t \t \t var commands1 = new SP203010WS.Command[]
\t \t \t \t \t {
\t \t \t \t \t \t new SP203010WS.Value
\t \t \t \t \t \t \t {
\t \t \t \t \t \t \t \t Value = acumaticaCaseCD,
\t \t \t \t \t \t \t \t LinkedCommand = CR306000.Case.CaseID
\t \t \t \t \t \t \t },
\t \t \t \t \t \t new SP203010WS.Value
\t \t \t \t \t \t \t {
\t \t \t \t \t \t \t \t Value = "Yes",
\t \t \t \t \t \t \t \t LinkedCommand = CR306000.Case.ServiceCommands.DialogAnswer, Commit = true
\t \t \t \t \t \t \t },
\t \t \t \t \t \t CR306000.Actions.CloseCase
\t \t \t \t \t };
\t \t \t \t \t var data = context.Submit(commands1);
\t \t \t \t \t context.Logout();
\t \t \t \t }
\t \t \t }
\t \t }
\t }
}
メニューボタンはまだ表示されます。
閉じるケースパートナーポータルで確認ダイアログボックス。 Web APIを使用してケースを閉じるときに、このダイアログボックスにプログラムで応答する必要があります。
提案がありますか? – Krunal