NextGen Consulting

IT Consulting CRM BSS OSS

Using Contained Core Business Objects

Q. When working with establish relation, I had a problem with a Bo having many parent, like:

1. We have an exist CaseBo object:  caseBo
2. By using XVO, we create 2 new row to insert: emailLogBo and actEntryBo
3. In which: actEntryBo is child of both caseBo and emailLogBo, emailLogBo also is child of caseBo.

=> how can I insert emailLogBo and actEntryBo to database ?

Note that: Both emailLogBo and caseBo are parent of actEntryBo, so we can’t use actEntryBo.setParentBo(..) to set up relation. So, please suggest how to solve this problem.

 

A.  Note that CaseBo object contains all the logic to do it automatically for you.
All you need to do is to add your new emailLog record to the CONTAINED emailLogBo.
When doing so, an actEntry will automatically be added and related with all relevant BO parties (CaseBo, UserBo, EmailLogBo).

About Contained Business Objects

Many BOs Contain other Business Objects. These contained CBOs are exposed as properties of the containing BO. For example, when a Case BO is created, contained BOs are automatically created for the logs related to the cases, the site and contact that reported the cases, and the installed part identified in the case

These contained CBOs are automatically related to the Case BO, usually as child BOs of the parent BO. They are accessed through CaseBO properties.

Field values for contained CBOs are accessed through properties of the containing BO
The following code shows how to get the first name of the contact who logged a case: String firstName=boCase.getContact().toString(“first_name”); 

     
Note:

  1.  Most contained CBOs are Generic BOs.
       
  2. To reduce network traffic and improve response times, many contained BOs set bo.DataFields and bo.QueryMode to minimize the amount of data retrieved. Make sure to modify the DataFields property of the contained Bo to include necessary fields before performing the query.

 

  
Example:

String fields= boCase.getContact().getDataFields() + ",e_mail";
boCase.getContact().setDataFields( fields );
boCase.query();

  

Example of adding email log to a CaseBo: 

  
// Add a new row to the contained EmailLog BO.
boCase.getEmailLog().addNew(); 

// Set the note description for the new row.
boCase.getEmailLog().setValue("description",
  "Customer mailed again to ask about the case status"); 

// Commit changes to the database.
boCase.update();
 
Advertisements

01/10/2010 - Posted by | Amdocs, Backend, BSS, CRM, CRM, Development, Smart Client, Technology

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: