- ~ 200 records are created in a batch in Dataverse
- The rows get validated that vendor exists, document number doesn't exist etc or error populated and /import/ status not updated.
- If there is an error this needs to be resolved an error cleared then reprocessed by the scheduled job or activating via button on page
- When the job is run on schedule we see no issues, owner has super permissions
- Records being created in Dataverse
- User opens that page in Dataverse only a small percentage of the records are visible as not all were created/ready when page opened.
- User runs the job from button only visible records get inserted.
- Non visible records are updates as /imported/ however are never inserted into Business Central
repeat
Imported := false;
ValidateData(CDSWiiseRemittance);
Clear(D365BCWiiseRemittance);
if CDSWiiseRemittance.Error_Description = '' then begin
D365BCWiiseRemittance.Init();
//D365BCWiiseRemittance.TransferFields(CDSWiiseRemittance);
//D365BCWiiseRemittance./EntryNo./ := FindEntryNo();
D365BCWiiseRemittance.d365_WiiseRemittanceId := CDSWiiseRemittance.d365_WiiseRemittanceId;
D365BCWiiseRemittance.statecode := CDSWiiseRemittance.statecode;
D365BCWiiseRemittance.statuscode := CDSWiiseRemittance.statuscode;
D365BCWiiseRemittance.d365_DocumentNo := CDSWiiseRemittance.d365_DocumentNo;
D365BCWiiseRemittance.d365_PostingDate := CDSWiiseRemittance.d365_PostingDate;
D365BCWiiseRemittance.d365_DocumentDate := CDSWiiseRemittance.d365_DocumentDate;
D365BCWiiseRemittance.d365_DocumentType := CDSWiiseRemittance.d365_DocumentType;
D365BCWiiseRemittance.d365_ExternalDocumentNo := CDSWiiseRemittance.d365_ExternalDocumentNo;
D365BCWiiseRemittance.d365_AccountType := CDSWiiseRemittance.d365_AccountType;
D365BCWiiseRemittance.d365_ABN := CDSWiiseRemittance.d365_ABN;
D365BCWiiseRemittance.d365_VendorName := CDSWiiseRemittance.d365_VendorName;
D365BCWiiseRemittance.d365_BalAccountType := CDSWiiseRemittance.d365_BalAccountType;
D365BCWiiseRemittance.d365_BalAccountNo := CDSWiiseRemittance.d365_BalAccountNo;
D365BCWiiseRemittance.d365_ClientCode := CDSWiiseRemittance.d365_ClientCode;
D365BCWiiseRemittance.d365_WiiseVendorNumber := CDSWiiseRemittance.d365_WiiseVendorNumber;
//D365BCWiiseRemittance.d365_ImportedStatus := CDSWiiseRemittance.d365_ImportedStatus;
//D365BCWiiseRemittance.d365_PostedStatus := CDSWiiseRemittance.d365_PostedStatus;
D365BCWiiseRemittance.d365_Amount := CDSWiiseRemittance.d365_Amount;
D365BCWiiseRemittance.d365_amount_Base := CDSWiiseRemittance.d365_amount_Base;
//D365BCWiiseRemittance.Error_Description := CDSWiiseRemittance.error_description;
//D365BCWiiseRemittance.d365_Paid := CDSWiiseRemittance.d365_Paid;
//D365BCWiiseRemittance.d365_ImportedStatus := true;
if not D365BCWiiseRemittance.Insert(true) then
CDSWiiseRemittance.d365_ImportedStatus := false
else begin
CDSWiiseRemittance.d365_ImportedStatus := true;
Imported := true;
end;
//D365BCWiiseRemittance.Modify();
if Imported then
CDSWiiseRemittance.Modify();
end else begin
CDSWiiseRemittance.d365_ImportedStatus := false;
CDSWiiseRemittance.Modify();
end;
NewD365BCWiiseRemit.Reset();
CDSWiiseRemittance.d365_ImportedStatus := false;
CDSWiiseRemittance.Modify();
end;
end;