Apply and release Hold on Payables workbench at API

Hi, this post I will show how to apply and release a hold on workbench in payables.

Sem título

DECLARE
v_rowid ROWID;
v_hold_id NUMBER := NULL;
BEGIN

mo_global.set_policy_context('S', 81);

FOR C IN ( SELECT hold,
reason,
hold_lookup_code
FROM ap_holds_hold_name_v
WHERE hold_lookup_code = 'RET. PAGAMENTO' )

LOOP

AP_HOLDS_PKG.Insert_Row(x_rowid => v_rowid,
x_hold_id => v_hold_id,
x_invoice_id => 155074, 
x_line_location_id => NULL,
x_hold_lookup_code => c.hold,
x_last_update_date => SYSDATE,
x_last_updated_by => 1139,
x_held_by => 1139,
x_hold_date => SYSDATE,
x_hold_reason => c.reason,
x_release_lookup_code => NULL,
x_release_reason => NULL,
x_status_flag => NULL,
x_last_update_login => NULL,
x_creation_date => SYSDATE,
x_created_by => 1139,
x_responsibility_id => NULL,
x_attribute1 => NULL,
x_attribute2 => NULL,
x_attribute3 => NULL,
x_attribute4 => NULL,
x_attribute5 => NULL,
x_attribute6 => NULL,
x_attribute7 => NULL,
x_attribute8 => NULL,
x_attribute9 => NULL,
x_attribute10 => NULL,
x_attribute11 => NULL,
x_attribute12 => NULL,
x_attribute13 => NULL,
x_attribute14 => NULL,
x_attribute15 => NULL,
x_attribute_category => NULL,
x_org_id => 81,
x_calling_sequence => NULL );
END LOOP; 
END;

Hold applied..

Sem título1

Now we going to release this hold.

BEGIN

mo_global.set_policy_context('S', 81);

FOR C IN (SELECT release_lookup_code
FROM ap_holds_release_name_v
WHERE release_lookup_code = 'LIB. PAGAMENTO')

LOOP

AP_HOLDS_PKG.release_single_hold ( x_invoice_id => 155074,
x_hold_lookup_code => 'RET. PAGAMENTO',
x_release_lookup_code => c.release_lookup_code,
x_held_by => 1139,
x_calling_sequence => NULL);

END LOOP;
END;

hold was released….

Sem título

Thanks……

 

 

 

Deixe uma resposta

Powered by WordPress.com. Tema: Baskerville 2 por Anders Noren

Acima ↑

%d blogueiros gostam disto: