megaphone
A inscrição para o SuiteWorld 2026 já está aberta — economize US$ 300. Inscreva-se agora

Discussões

New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.

Criar Tabela de faturamento particular vinculada ao Pedido de venda existente usando SuiteScript 2.0

editado Jun 2, 2025 2:37PM Dentro SuiteCloud / Personalização

Aplica-se a

Produto:  NetSuite 2024.2

Cenário

Um script de Evento do usuário do SuiteScript 2.0 que cria uma Tabela de faturamento privada vinculada a um Pedido de venda existente.

Solução

Num Script de Evento do Usuário implementado nos registros do Pedido de venda, o código de exemplo abaixo pode ser executado no ponto de entrada após o envio em um Pedido de venda existente:

if(context.type == context.UserEventType.EDIT){

var recordId = scriptContext.newRecord.getValue({
fieldId: "id" // get internal Id of the current sales order
})

var billingScheduleRec = record.create({
type: 'billingschedule',
isDynamic: true //create a billing schedule record
});

billingScheduleRec.setValue({
fieldId: 'name',
value: 'BlilingSchedViaScript' //set the name of the billing schedule record
});

billingScheduleRec.setValue({
fieldId: 'initialamount',
value: 2 // set the initial amount field
});

billingScheduleRec.setValue({
fieldId: 'numberremaining',
value: 2 // set the number remaining field
});

var frequencyField = billingScheduleRec.getField('frequency');
var frequencyOptions = frequencyField.getSelectOptions(); //get the list of frequency options

billingScheduleRec.setValue({
fieldId: 'frequency',
value: frequencyOptions[2].value //set the frequency field this is weekly
});

billingScheduleRec.setValue({
fieldId: 'ispublic',
value: false // set the public checkbox to false
});

billingScheduleRec.setValue({
fieldId: 'transaction',
value: recordId // set the transaction field to the current sales order internal Id
});

var billingSchedId = billingScheduleRec.save({
enableSourcing: true,
ignoreMandatoryFields:

Olá, bem-vind@!

Faça login

Para ver todos os detalhes, faça o login.

Cadastre-se

Não tem uma conta? Clique aqui para começar!

Ranking

Gênio da Comunidade

2º Trimestre (Apr-Jun 2026)

Líderes desta semana

Líderes deste mês

Líderes de todos os tempos