I created a custom processing screen to transmit records to a web service but it returns a good record when it isn't. The web service always returns good record. To know if it is good or bad you have to loop through the response. Is there a way to stop that? I think I need to add a delegate, but everything I do fails. I keep being left with
[![enter image description here][1]][1]
The moment the good record comes back is when the Sendasync comes back. I've tried to mess around with a delegate but I can't get it to work. I think I need to create a delegate to do the error checking but either that is wrong or I use the wrong syntax.
public async Task<T> PostStreamAsync<T>(string requestUrl, CancellationToken cancellationToken, object content)
{
addHeaders();
using (var request = new HttpRequestMessage(HttpMethod.Post, requestUrl))
using (var httpContent = CreateHttpContentForStream(content))
{
request.Content = httpContent;
using (var response = await _httpClient
.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken)
.ConfigureAwait(false))
{
// response.EnsureSuccessStatusCode();
return JsonConvert.DeserializeObject<T>(await response.Content.ReadAsStringAsync().ConfigureAwait(false));
}
}
}
public class TransmitPurchaseOrder : PXGraph<TransmitPurchaseOrder>
{
public PXCancel<POOrder> Cancel;
public PXProcessing<POOrder, Where<POOrderExt.usrProcessed, Equal<False>>> UnprocessedRecords;
public TransmitPurchaseOrder()
{
UnprocessedRecords.SetProcessDelegate(ProcessPOLinesAsync);
UnprocessedRecords.SetSelected<POOrder.selected>();
}
The initial problem I had was that was in the line of the screen. That was because I had a form and filter that I added knowing it was going to come into play someday. Once both were removed, goes away.