Monday, March 8, 2010

Create a standard Work Order

you can create predefined activity plans templates.
In order to stay the more standard possible, you can use EIM load such as:

1. Entity

EIM Plan (EIM_TMPL_PLNITM) --> Plan (S_TMPL_PLANITEM)
EIM Activity (EIM_ACTIVITY) --> Activity (S_EVT_ACT)

2. Fill EIM tables

Prepare INSERT INTO EIM_TMPL_PLNITM and EIM_ACTIVITY

3. Prepare ifb archive:

Plan.ifb
[Siebel Interface Manager]
PROCESS = IMPORT
[IMPORT]
TYPE = SHELL
INCLUDE = Plan
[Plan]
TYPE = IMPORT
BATCH = NUMBEREXAMPLE
TABLE = EIM_TMPL_PLNITM
ONLY BASE TABLES = S_TMPL_PLANITEM
Activity.ifb
[Siebel Interface Manager]
PROCESS = IMPORTAR
[IMPORTAR]
TYPE = SHELL
INCLUDE = Activity
[Activity]
TYPE = IMPORT
BATCH = NUMBER_EXAMPLE
TABLE = EIM_ACTIVITY
ONLY BASE TABLES = S_EVT_ACT

4. Execute EIM process:

set SentEIMA="Run task for component EIM with config=d:\Plan.ifb, errorflags=1"
%SRVRMGR%srvrmgr /g %NTServidor% /e %ENTservidor% /u %USUARIO_TGT% /p %PASSWORD_TGT% /s %NTservidorEIM% /c %SentEIMA% /o EIM.LOG

Finally, in order to create a Work Order, use a script such as:

var BOPlanActivity= TheApplication().GetBusObject("Com Work Order");
var BCComWorkOrder = BOPlanActivity.GetBusComp("Com Work Order - Orders");
with (BCComWorkOrder)
{
NewRecord(NewAfter);
/* Set required information */
WriteRecord();
}
var BCActivityPlan = BOPlanActivity.GetBusComp("Activity Plan");
BCActivityPlan.NewRecord(NewAfter);
BCActivityPlan.SetFieldValue("Template", Activity Plan Name);
BCActivityPlan.WriteRecord();

BCActivityPlan = null;
BCComWorkOrder = null;
BOPlanActivity = null;