Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

workflow - qbo3 Task wizard

We have a QBO workflow comprising the following steps:

  • Task A
  • Wait a day
  • Task B

In most circumstances, users will:

  • start from their worklist
  • navigate to a Task A
  • upon completion be returned to their worklist
  • the next day, Task B should appear on their worklist

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

  • start from their worklist
  • navigate to Task A
  • upon completion:
    • if Foo = 'Bar', move to Task B for the same parent record,
    • otherwise return to their worklist

How does one accomplish this in a qbo3 workflow?

question from:https://stackoverflow.com/questions/65832939/qbo3-task-wizard

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 &

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...