Closed arook closed 4 years ago
@arook What additional code are you wanting to see there? The transaction module only has one documented method.
@MrRob this looks like it's been untouched for a while, but since it's still open... Maybe they're looking for a type enumeration instead of "string". Similar to search.Type.SALES_ORDER or record.Type.CUSTOMER. That way you could be sure the of available transactions to void.
You can see this is used in the SS2.0 API Guide (pg. 1006):
var voidSalesOrderId = transaction.void({
type: transaction.Type.SALES_ORDER,
id: salesOrderId
});
@MrRob to follow up:
interface VoidOptions {
id: number | string;
type: Type | string;
}
interface TransactionVoidFunction {
(options: VoidOptions): number;
promise(options: VoidOptions): Promise<number>;
}
declare var voidFunc: TransactionVoidFunction;
export {voidFunc as void};
/** N/transaction.Type enum */
export enum Type { // As of 15 June 2020
ADV_INTER_COMPANY_JOURNAL_ENTRY, // 'advintercompanyjournalentry'
CASH_REFUND, // 'cashrefund'
CASH_SALE, // 'cashsale'
CHECK, // 'check'
CREDIT_MEMO, // 'creditmemo'
CUSTOMER_DEPOSIT, // 'customerdeposit'
CUSTOMER_PAYMENT, // 'customerpayment'
CUSTOMER_REFUND, // 'customerrefund'
ESTIMATE_QUOTE, //
EXPENSE_REPORT, // 'expensereport'
INTER_COMPANY_JOURNAL_ENTRY, // 'intercompanyjournalentry'
INVOICE, // 'invoice'
JOURNAL_ENTRY, // 'journalentry'
PAYCHECK_JOURNAL, // 'paycheckjournal'
RETURN_AUTHORIZATION, // 'returnauthorization'
SALES_ORDER, // 'salesorder'
TRANSFER_ORDER, // 'transferorder'
VENDOR_BILL, // 'vendorbill'
VENDOR_CREDIT, // 'vendorcredit'
VENDOR_PAYMENT, // 'vendorpayment'
VENDOR_RETURN_AUTHORIZATION, // 'vendorreturnauthorization'
WORK_ORDER, // 'workorder'
}
Okay, I've added the enumeration now in version 2020.1.14 :)
Thank you!
https://github.com/headintheclouddev/typings-suitescript-2.0/blob/dd102b7bca633516b349225f56efc1921b6fcfbe/N/transaction.d.ts#L4
Can this be improved?