submitConfig()

The submitConfig() function submits the configuration to the transaction record and lets you choose whether resetting questions and answers after submitting it. At the end of the processing, the function saves the transaction.

Syntax

Use this syntax for the submitConfig() function.

            submitConfig({
    afterSubmitAction: string,
    restart: true | false,
    product: number
}); 

          

Parameters

Note:

All parameters are optional.

The submitConfig() function can take the following parameters:

  • afterSubmitAction - Determines what happens after submitting the configuration. This parameter is optional. If omitted, it defaults to the close value. This parameter can take the following values:

    • close - Submits the configuration and doesn't reset questions and answers. This is the default value.

    • copy - Submits the configuration and doesn't reset questions and answers.

    • new - Submits the current configuration and then resets questions and answers.

  • restart - If false, the processing flow continues to the next action. If true, the processing flow restarts from the first before-event action and continues to refresh building blocks, and run after-event actions. This parameter is false by default, and you can omit it.

    Note:

    If you call submitConfig with restart : true, any actions after that action won't run because the restart will happen after the current action has completed. If you need all actions to run, make sure you apply it to the last action of the queue.

  • product - The product ID used when restarting the processing flow with a new product.

Parameter Combinations

The table shows the possible parameter combinations for the submitConfig() function.

afterSubmitAction Parameter

restart Parameter

product Parameter

Defaults To

Description

Not set

Not set

Not set

  • afterSubmitAction: 'close'

  • restart: false

  1. Submits the configuration.

  2. Runs the next action.

new

Not set

Not set

restart: false

  1. Submits the configuration.

  2. Resets questions and answers.

  3. Runs the next action.

close

true

Not set

-

Warning:

This parameter combination is incompatible. Restarting the processing flow isn't possible when afterSubmitAction is set to close.

Not set

true

Not set

afterSubmitAction: 'new'

  1. Submits the configuration.

  2. Resets questions and answers.

  3. Restarts the processing flow.

new

true

Not set

-

  1. Submits the configuration.

  2. Resets questions and answers.

  3. Restarts the processing flow.

Not set

true

Set

afterSubmitAction: 'new'

  1. Submits the configuration.

  2. Resets questions and answers.

  3. Restarts the processing flow.

  4. Loads a new product.

new

true

Set

-

  1. Submits the configuration.

  2. Resets questions and answers.

  3. Restarts the processing flow.

  4. Loads a new product.

copy

true

Not set

-

  1. Submits the configuration.

  2. Restarts the processing flow.

copy

true

Set

afterSubmitAction: 'new'

  1. Submits the configuration.

  2. Resets questions and answers.

  3. Restarts the processing flow.

  4. Loads a new product.

Note:

The copy value is ignored when specifying a different product ID.

Examples

See examples for the submitConfig() function.

Restarting the Conversion Process with a Specific Product

This examples submits the configuration and restart the processing flow using a specific product (product ID 13).

              submitConfig({
    afterSubmitAction: 'new',
    restart: true,
    product: 13
}); 

            

Related Topics

General Notices