cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Manual changes in InvoceNo via database get deleted within a day

Hi All,

We need to copy the data from PurchaseOrderNo field to InvoceNo field, to do that we have set the new values with an update SQL query. (below you can find the query)

UPDATE pod
SET
pod.InvoiceNo= po.purchaseorderno,
pod.InheritPOInvoiceDetails = 0
FROM PurchaseOrderDetail pod
INNER JOIN
PurchaseOrder po
ON pod.PurchaseOrderID = po.PurchaseOrderID
WHERE pod.InvoiceNo IS NULL OR pod.InvoiceNo = ''

 

Inmediately after doing the query it appears in the database and in Flexera Suite GUI. But after one day it gets deleted for apparently no reason.

Could anyone, please, assist us on this? 

Thanks!

(1) Solution

As the History tab and ComplianceHistory_MT got deleted too and it was not the solution, I share here the response to the case that finally worked in case anyone find it useful:

It looks as though the invoiceNo and invoiceDate cannot be updated if the following fields in the “PurchaseOrder” table are set to a value of 1:

  • InheritPOEnterpriseGroups
  • InheritPOInvoiceDetails

If these Inherit properties are set to 1, the values on the PurchaseOrderDetail record will be overridden by what is on the PurchaseOrder record. That is the purpose of these settings. They both need to be set to 0 to specify separate details per PurchaseOrderDetail.

While InheritPOInvoiceDetails is being set in your script, InheritPOEnterpriseGroups may still have a value of 1 and this would cause the values to get rolled back and would explain why the entry is removed from the history tab.

I would recommend setting the values for InheritPOInvoiceDetails and InheritPOEnterpriseGroups to 0 first, then updating invoiceNo as a separate step.

View solution in original post

(2) Replies
ChrisG
By Community Manager Community Manager
Community Manager

You may get some insight into what process is reverting the changes by looking at the details on the History tab when viewing the purchase record. Do it show when changes are occurring on the Invoice Number field, and who is making them?

I wonder whether there is a business adapter or some other automation in place that is making a change here.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

As the History tab and ComplianceHistory_MT got deleted too and it was not the solution, I share here the response to the case that finally worked in case anyone find it useful:

It looks as though the invoiceNo and invoiceDate cannot be updated if the following fields in the “PurchaseOrder” table are set to a value of 1:

  • InheritPOEnterpriseGroups
  • InheritPOInvoiceDetails

If these Inherit properties are set to 1, the values on the PurchaseOrderDetail record will be overridden by what is on the PurchaseOrder record. That is the purpose of these settings. They both need to be set to 0 to specify separate details per PurchaseOrderDetail.

While InheritPOInvoiceDetails is being set in your script, InheritPOEnterpriseGroups may still have a value of 1 and this would cause the values to get rolled back and would explain why the entry is removed from the history tab.

I would recommend setting the values for InheritPOInvoiceDetails and InheritPOEnterpriseGroups to 0 first, then updating invoiceNo as a separate step.