Eric Patrick
Eric Patrick

Reputation: 2247

qbo3 Task wizard

We have a QBO workflow comprising the following steps:

In most circumstances, users will:

In a few circumstance, determined by the fields present in Task A, the flow should be:

How does one accomplish this in a qbo3 workflow?

Upvotes: 0

Views: 13

Answers (1)

Eric Patrick
Eric Patrick

Reputation: 2247

Tasks, by design, will return a user to the referring page upon saving (or cancelling).

To cause a different page to render, use javascript to set the referring page to a different value.

From the Task GUI Designer:

  • click on the Foo field
  • in the Javascript > onblur field, enter code similar to the following (carriage returns are not required; just used here for readability):
if (this.value == 'Bar') 
  qbo3.getObject(this).setReferrer('api/importform/summary?Object={{Object}}
&ObjectID={{ObjectID}}
&Method=RenderEdit
&Template=Task B', this);
  • click Save

Some notes / gotcha's with respect to the javascript snippet above:

  • qbo3.getObject(this).setReferrer(...) changes the value of document.referrer
  • the URL being passed is a relative URL, and causes a Task to be rendered
  • the Object and ObjectID parameters tell qbo3 to render a task on the same parent object as the current task
  • using curly braces {} tell setReferrer to substitute the expressions with matching values in the current task (E.g. Task A and Task B should each have the same Object and ObjectID
    • because this data is being passed into XSLT, the curly braces must be doubled: {{}} so that XSLT does not attempt to interpret them
    • because this data is being passed into XSLT, the & must be XML-compliant; thus the use of &

Upvotes: 0

Related Questions