---
sourceDocument: Australia Finance and Supply Chain
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/source-to-pay-operations

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Finance and Supply Chain

ft:clusterId :

    - stpop

bundleId :

    - stpop

workflow :

    - Creator


---

# Run scheduled job for cost allocation

# Run scheduled job for cost allocation {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

Run a scheduled job to copy cost allocations from invoice line to purchase order line when upgrading Accounts Payable Operations from lower to higher version.

## Antes de Iniciar

Role required: admin

## Procedimento

1. Navigate to AllScheduled JobsUpdate Cost Allocation for the invoice.
2. Select the Active check box.
3. In the script, add the following encodedQuery:  

       var encodedQuery = sn_shop.InvoiceLine.ORDER_LINE + 'ISNOTEMPTY^' + sn_shop.InvoiceLine.INVOICE + '.' + sn_shop.Invoice.STATE + 'IN' + sn_shop.Invoice.STATE_DRAFT + ',' + sn_shop.Invoice.STATE_PO_MAPPING_ERROR + "," + sn_shop.Invoice.STATE_SUSPECTED_DUPLICATE;

4. Select Save and Execute Now.  
   During the upgrade Accounts Payable Operations, cost allocation is auto-updated when purchase order lines are mapped to invoice lines.

