miércoles, 22 de octubre de 2008

Navigate to a Custom View after Task UI was completed

We are implementing Task UI for our Business Process Requeriments and we have an issue for the next scenario.
We are using e-Script (in a custom button) to call a Task UI (Process of Account creation). After the task was completed, we need to navigate to a Custom View. The code will be like this:

function WebApplet_PreInvokeMethod (MethodName)
{
if (MethodName == "LaunchTask")
{
var BO = TheApplication().GetBusObject("MyBO");
// The Task in the last step will set this ProfileAttrib called "Value"
var MyValue = TheApplication().GetProfileAttr("Value");

TheApplication().GoToView("My Custom View", BO);
return(CancelOperation);
}
else
return(ContinueOperation);
}

Is this possible?. If not, do you have a method to navigate after Task was completed?. Is possible to use this functionality without code?.

Solution:
I solved the problem with some code in the Task PlayBar Applet using the NavigateNext method. After the task was commited and the Next Button was pressed, we use the next code:
function WebApplet_InvokeMethod (MethodName)
{
if (MethodName == "NavigateNext")
{
var BO: BusObject = TheApplication().GetBusObject("Service Request");
var BC: BusComp = BO.GetBusComp("Service Request");
var IdSR = TheApplication().GetProfileAttr("SR_Id");
TheApplication().GotoView("Service Request RMA List View", BO);
with (BC)
{
SetViewMode(3);
ActivateField("Id");
ClearToQuery();
SetSearchSpec("Id", IdSR);
ExecuteQuery();
}
}
}

With a Business Service step in the Task, we set a ProfileAttrib (for save the New SR created, called SR_Id). Remember that if you use "NavigateNext" you need to ask for the Name of the View where you are focus on. Hope that helps you in new customer's SR.

No hay comentarios: