views:

126

answers:

1

Hi,

how can I get all accounts of am employee? In the "Siebel Object Interaces Reference" I found an example, how to get all industries of an account:

var myAccountBO = TheApplication().GetBusObject("Account");
var myAccountBC = myAccountBO.GetBusComp("Account");
var myAssocBC = myAccountBC.GetMVGBusComp("Industry");

So I would like to do something like:

var myEmployeeBO = TheApplication().GetBusObject("Employee");
var myEmployeeBC = myAccountBO.GetBusComp("Employee");
var myAssocBC = myAccountBC.GetMVGBusComp("Account");

But I get an error

Semantic Warning around line 23:No such predefined property Account in class BusComp[Employee].MVGFields.

I can see in Tools that there is no Multi Value Link called "Account" in Business Component "Employee", so I can actually understand the error message.

So I wonder how I can get all accounts of an employee.

I found the Business Component "User" which has a Multi Value Link to "Organisation" and another link "User/Account".

  • Is this what I am looking for?
  • How can I know? Where is documentation which tells me about the semantics of links? (Is this described in "Siebel data model reference"? I cannot download this document, although I have signed in...) This link could also link a user to the organization it belongs to.
  • If one of these links IS what I am looking for, what would be the way to go to get the "User" Business Component of a corresponding "Employee" Business Component?

Many questions of a Siebel newb...Thanks for your patience.

+1  A: 

Hello again, Nang. An easy way to approach this (and to learn it) is to figure out how you'd do it in the UI. Then move onto figuring out how to do the same thing in script.

When you say, "get all account of an employee," do you really mean get all accounts where a particular employee is on the account team? In the UI, that would be done by going to: Accounts > All Accounts Across Organizations, and querying for that specific user in the "Account Team" multi-value field.

From that same view, go to Help > About View in the application menu. You'll see in the popup that the view uses the Account business object and the Account business component. A quick examination of the applet you queried on will show you that the "Account Team" field on the applet is really the "Sales Rep" field on the Account business component. Here's how to mimic what we did in the UI, in script:

var boAccount = TheApplication().GetBusObject("Account");
var bcAccount = boAccount.GetBusComp("Account");
bcAccount.SetViewMode(AllView); // like All .. Across Orgs
bcAccount.ClearToQuery();
bcAccount.SetSearchSpec("Sales Rep", "NANG");
bcAccount.ExecuteQuery();

Then you can walk through the list of accounts and do something with each one like this:

// for each account
for (var bIsRowActive = bcAccount.FirstRecord();
    bIsRowActive; b = bcAccount.NextRecord())
{
    // do something here
}

I hope you're enjoying Siebel.

Mike M. Lin
Thanks, now I got it. Enjoying Siebel? Not quite yet, however I really enjoyed your help!
nang