The pending invoices are not visible in the AP>Enquires>History>Invoice history and Matching tables. But it is present in the VendInvoiceInfoTable.
I tried deleting it from the table I still get the same error. I can able to delete it by writing a job using dodelete(), but i want a permanent solution for this.
When I get the sourceDocumentHeader from the vendInvoiceInfo table and when I check in Accounting Distribution I can find 2 records related to it. If i delete those records I can able to delete the invoice from the front end.
Bu its not best practice to delete records from accounting distribution .
Anything deleting directly form the table is not suggested. Rather you should identify the route cause and fix it (so that it will allow you to delete from the User interface).
How this invoice is been created?
Have you tried to investigate, why it is not showing in AP>Enquires>History>Invoice history and Matching tables?
What is the value of this.SourceRelationType ?
dictTable = new DictTable(this.SourceRelationType);
I tired to identify the route cause but couldn’t able achieve where things are going wrong. "this.SourceRelationType"is a field . SourceRelationType is a field from sourceDocumentLine table which contains the tableID value.
Yes its a field. I was asking what value you are getting in that field while debugging. (as it is unable to create the DictTable object based on that value)
It actually runs 4 times and for the first 3 times I am getting values of vendInvoiceInfo table(twice) and purchorderInvoice table once the 4th time I am getting a null value
On checking in sourceDocumentLine table find method returns a null value . But the passed recId value is present in the table but still it returns null value