Thursday 12 May 2022

Siebel GoTo View - Handling Realtime cases

 Hello All, 


We all must have used GoTo view functionality of siebel to navigate to a particular view from current view.

What if the requirement is to get to a particular record on a record? Well this cannot be directly achieved via GoTo View as we cannot pass Id there.

But this can be achieved if we pass the context BO in GoTo View, i.e. The syntax is TheApplication().GoToView("ViewName","BO"), we need to set the record context in BO then pass the BO.

Algo:

1.Take the RowId of the record we want to navigate to 

2. Query the record to set the context

3. Pass the BO Variable with GoTo View, to see the magic happen :-)


Sample Script:

 if(MethodName == "Navigate")
 {
 var sB0 = TheApplication().GetBusObject("Auto Vehicle")
 var gBc = sB0.GetBusComp("Auto Vehicle");
 var assetId = this.BusComp().GetFieldValue("Asset Id"); //Id for the record we want to navigate

 with(gBc)  //Set the context by querying the record
     {
     ClearToQuery();
     SetViewMode(AllView);
     SetSearchSpec("Id",assetId);
     ExecuteQuery(ForwardOnly);
     }
 TheApplication().GotoView("Auto Vehicle Service Request View",sB0);    //call goto view with BO context
   return(CancelOperation);
 }
//end method

Simple yet very useful, your comments and suggestion are always welcome.

Monday 4 April 2022

Working with Attachments in Siebel - Part3 Putting TypeRestriction

 Hello All, 

In this post let us try to put restriction on the Type of files while adding new Attachments.

The Logic is pretty simple, 

1. Identify the Target Attachment BC

2. Identify the File Type Field

3. Write Script on PreWriteRecord of Business Component

In any attachment applet, we can see the Fields Name, Size (in Bytes) ,Type etc.


 



Lets Try to write a Piece of Code to fetch the Type of File:

The code below prevent to attach exe, msi or apk files that can be cause potential threats to system 

function BusComp_PreWriteRecord ()

{

var ext= GetFieldValue("FileExt"); //Get the File Extension

switch(ext) {

  case "exe":  

TheApplication().RaiseErrorText("This Type of File is Not Allowed");                    

break;

  case "EXE":

TheApplication().RaiseErrorText("This Type of File is Not Allowed");

break;

  case "msi":

TheApplication().RaiseErrorText("This Type of File is Not Allowed");

break;

  case "apk":

TheApplication().RaiseErrorText("This Type of File is Not Allowed");

break;

  case "APK":

TheApplication().RaiseErrorText("This Type of File is Not Allowed");

break;

  default:

//do nothing 

}

}




Error Popup on Save Record:









This way we can keep our file system clean from any virus, unwanted apps etc..
Smart way to secure application :-) 


Previous Post                        Next Post

Friday 1 April 2022

Working with Attachments in Siebel - Part2 Putting Size Restriction

 Hello All, 

In this post let us try to put size restriction while adding new Attachments.

The Logic is pretty simple, 

1. Identify the Target Attachment BC

2. Identify the File Size Field

3. Write Script on PreWriteRecord of Business Component

In any attachment applet, we can see the Fields Name, Size (in Bytes) ,Type etc.


 



Lets Try to write a Piece of Code to fetch the Size:

function BusComp_PreWriteRecord ()

{

    this.ActivateField("FileSize");

    var size= this.GetFieldValue("FileSize"); //Field that has size

    var sizeMB = size/1000000 ; //converting Bytes to MB

if (ToNumber(sizeMB) >= 5 ) //checking the size to less then 5 MB

{

TheApplication().RaiseErrorText("Please add file less then 5 MB");                     

}

}


Error Popup on Save Record:









very simple effective solution to Keep Siebel File System under control :-) ,any suggestions are always welcome.


Previous Post                        Next Post

Tuesday 29 March 2022

Working with Attachments in Siebel - Part1 Calculating Size

 Hello All, 

Siebel Attachment's are very useful functionality to attach documents, files ,images etc. with parent records.

There are certain consideration with attachment that comes into picture one day or the other.

1. Size Restriction on Attachments

2. Type Restriction on Attachments

3. Size control for Siebel File System

4. FS Cleanup to clear orphan Attachments

lets cover these one by one, 

before starting let us first check the total size of attachments under a particular entity, (Service Request in my case)

Client Side BS to get the Size of attachment

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

try

 {    

  if(MethodName == "DeleteAttachment")

  {

   var vSRBO = TheApplication().GetBusObject("Service Request (eService)");

   var vSRBC = vSRBO.GetBusComp("Service Request (eService)");

   var vSRBCAtt = vSRBO.GetBusComp("Service Request Attachment");

   var fileSize ="0",filebyte="0";

   with(vSRBC)

      {

      ActivateField("Id");

      ClearToQuery();

      SetViewMode(AllView);  

      var varSpec = "[Created] >= '1/1/2020' AND [Created] <= '1/1/2022'";

      SetSearchExpr(varSpec);

  ExecuteQuery(); 

      var vFirstRec = FirstRecord();

  while(vFirstRec)

   {

with(vSRBCAtt)

{

ActivateField("ActivityFileName");

ActivateField("ActivityFileSize");

ClearToQuery();

SetViewMode(AllView);  

ExecuteQuery(); 

var FirstRec = FirstRecord();

  while(FirstRec)

  {    

  var filename = GetFieldValue("ActivityFileName"); 

  filebyte = GetFieldValue("ActivityFileSize");

  fileSize = ToNumber(fileSize)+ToNumber(filebyte);

  FirstRec = NextRecord();

  }  

}     

   vFirstRec = NextRecord();

 

   }  

TheApplication().RaiseErrorText("TotalSize: "+fileSize);

   }  

   return(CancelOperation);

  }

 }//End Try

 catch(e)

 {

 // return(CancelOperation);

  if (typeof e.errText == "undefined")

  TheApplication().RaiseErrorText(e.toString());

  else

  TheApplication().RaiseErrorText(e.errText + "\n" + e.toString());

 }

 finally

 {

   vSRBO = null;

   vSRBC = null;

 }

}


the output will be in bytes , we can convert to MegaBytes by dividing by 1024, or GigaBytes by dividing 1024*1024

As Highlighted by Alex Sir , it will be divide by 1,000,000 not 1024 to convert to Mega Bytes

here, 10306580 if Divided by 1024*1024 gives 9.82 GB








We will continue with Putting restriction on file attachments in next post.

Sunday 27 March 2022

Application Level Functions in Siebel - LookupDesc

 Hello All,

There have been certain requirement that makes us write repetitive code, like sending email or SMS where we need to write either a function or script each time we need to call the code. Can there be some better way of handling this type of repetitive code? 

Application Level functions are the solution to these type of requirement. Consider one more case we use LookupValue functions to fetch LOV value that gives us either Name or Display Value. In case when length is more then 30 we need to call custom code.

Here we can make a Application level function say LookupDesc that returns Description and can be call by TheApplication() method.

See sample code for the same

//Your public declarations go here...
 function LookUpDesc(Type,Value)
{
 try
{
var sDesc = "";
var boLOV = TheApplication().GetBusObject("List Of Values");
var bcLOV = boLOV.GetBusComp("List Of Values");
with (bcLOV)
{
ClearToQuery();
SetViewMode(AllView);
ActivateField("Description");
SetSearchSpec("Type", Type);
SetSearchSpec("Value", Value);
ExecuteQuery(ForwardOnly);
if (FirstRecord())
 {
sDesc = GetFieldValue("Description");
 }
}
//with
return(sDesc);
}
catch(e)
 {
 throw(e);
}
 finally
{
bcLOV = null;
boLOV = null;
} }

Add this function in Application:















You can use this with below Syntax:








try and explore the code reusability :-)

Wednesday 31 March 2021

Apex Triggers in Salesforce

 Hello All, 

Before we write any example let us first understand what are Triggers.

Just like database triggers that execute on/after/before certain event to execute a set of statements, Apex triggers also server the same purpose.

Triggers allows us to do custom actions on events, i.e. do some field setting, fire SOQL statement, execute some complex equation,

supported events ,

  • before insert
  • before update
  • before delete
  • after insert
  • after update
  • after delete
  • after undelete

sample Trigger syntax,

trigger TriggerName on ObjectName (trigger_events) {                  

//code here 

}


TriggerName is unique Name for Trigger, Object Name is Entity Name,

Note : in the below example we are using Context to get the current record details,
for(Opportunity opp : Trigger.New)

e.g.

1. set a Field value when a Opportunity record is updated

trigger SetBuyingTimeFrame on Opportunity (before update) {
for(Opportunity opp : Trigger.New)
{
opp.Buying_Time_Frame__c = '1-Immediate';
}
}

2. Using a If Else condition in trigger

trigger SetBuyingTimeFrame on Opportunity (before update) {
for(Opportunity opp : Trigger.New)
{
if(opp.Enquiry_Classification__c=='1-Excellent')
{
opp.Buying_Time_Frame__c = '1-Immediate';
}
else 
{
opp.Buying_Time_Frame__c = '5-Within 3 Months';
}
}
}

2. Using a switch statement in trigger

ttrigger SetBuyingTimeFrame on Opportunity (before update) {
for(Opportunity opp : Trigger.New)
{
switch on opp.Enquiry_Classification__c{
when '1-Excellent' {opp.Buying_Time_Frame__c = '1-Immediate';}
when '2-Very High' {opp.Buying_Time_Frame__c = '2-Within 1 Week';}
when '3-High' {opp.Buying_Time_Frame__c = '3-Within 2 Weeks';}
when else {opp.Buying_Time_Frame__c = '5-Within 3 Months';}
}
}
}

the examples are endless :-), more details are available on link, 

Creating a Lookup Relation in Salesforce

 Hello All, 

Many times we require data from other entity being stored and referenced in source entity. i.e. Account Details in Opportunity.

We have Lookup relationship type for implementing the requirement, so lookup defines a way to get fields data from some Target entity to the source Entity

let see a simple scenario, we require to bring Financer to Opportunity (Financer is a type of Account with Type having value Technology Partner)

1. Setup- Objects - Fields ,click New

Select Lookup Relationship






2. Select the Target Entity, Since i need to fetch account details i will choose Account.








3. Provide Field Label and Description, 

there are Option to make the Fields Required, by Ticking the Required Flag

and option for deleting the Relationship (clear the value or do not delete)  








4. Now Comes the Important part, setting the Filter Criteria

As mentioned in the beginning, i need to show Account in the Lookup, that have Type as Technology Partner.

Select the field in Account on which we need to Filter 

Account:Type ,and in value choose Technology Partner from the Popup List.














Now when we see the Financer in the Form , we see only Records that match the Filter Criteria specified. Save and add field on the layout. 











I will be covering some more complex scenarios in upcoming posts.


Tuesday 30 March 2021

Validation Rules in Salesforce

 Hello All, 

Very often we require to make system throw errors based on Values of Different fields.

i.e. Suppose field Purchase Type has value "Finance" then, Finance Stage and Financer must be filled else there should be error popup.









This can be configured with Validation Rules, and no Apex code is required for this, 

Lets see the steps for this,

1. Go to Setup -- Customize -- select the Entity to customize(Opportunity in my case) -- select Validation Rules











2. List appears for the validation Rules, here we need to write a New rule or Edit an Existing one.






3. Writing the Formula, 












we need to Give a meaningful name to the Rule, 

The expression builder is very user friendly, we can select the Field from Select Field Button, and Insert Operator button to Insert functions, 

Check syntax to validate the expression, and Provide the error message as desired.

Tips to write expression , 

to check if Finance field is  null 

ISBLANK() function can be used for this, as the name suggest it returns Y for Blank values 

to check if Finance Stage Picklist has null value

ISPICKVAL(Name,""), can be used as for picklist field we cannot use ISBLANK() function 

and then clubbing the Equation to be 

ISPICKVAL(Purchase_Type__c,"2-Finance") && (ISPICKVAL(Finance_Stages__c,"") || ISBLANK(Financer__c))

Which is equivalent to

IF (Purchase type = '2-Finance' AND (Finance Stage is NULL OR Financer is NULL))

this can be written to handle more complex cases see examples here 

https://trailhead.salesforce.com/content/learn/modules/advanced_formulas/picklist_formulas


Changing the Default Form Layout in Salesforce

 Hello All, 

Setting up Layout form of any entity, is very basic step when developing a form/Process for the client.

Salesforce provides vanilla layout and new fields are added automatically on the layout, but grouping, Layout and Read-only Behavior need to be edited as per the Business requirement.

so Lets start this customization step wise , 

1. Go to Page Layout Option , Setup -- Customize -- Entity (Opportunity in my case) -- Page Layout











2. Once page Layout is clicked the default layouts are visible for different applications, select the one for your Application and Click Edit,








3.The below Wizard appears , here we can drag drop and arrange the fields as per requirement,





















There are option to remove a fields, Edit its property or Replace it to other place by click and Dragging it 

4. Once done, Click on Page Layout Assignment and Edit Assignment, 

Here assign the page to role as per requirement

Suppose You need to Assign the New Layout to Sales Profile then choose Sales in Profile and Select the Page Layout you Just Changed









Update Layout, 







very basic, yet Most Important :-)

Wednesday 17 March 2021

Replacing Special Characters in Siebel

 Hello All, 

Recently i had a requirement where i had to replace some special character's like &,@ from SMS body that was sent as notification.

solution is very simple and basic :-), we need to use string function replace() for this and pass the pattern to replace.

var str= "Dolce & Gabbana";

var pat = "&";

var rtn = str.replace(pat, "%26");

TheApplication().RaiseErrorText(rtn );                                            



We can write a business service for this and call this in WF or Script which we are using to send the SMS/EMAIL.

Tuesday 2 February 2021

Collapsible Applets in Siebel - Making Applets Mobile Friendly

 Hello All , 

With complex business process comes lot of Fields :-) , and with increased fields UI becomes more cumbersome.

Lets see a generic UI screen 












This can be converted in more manageable and UI friendly Applets.





Improved isn't it, share your thoughts in Comments

Disable Copy Record in Siebel Applets

 Hello All, 

This is very common requirement where we need to disable some particular operation on a applet i.e. New Record, Delete Record, Copy Record.

SRF solutions are many for these types of requirements ,Applet User Property, No Delete ,No Update, No Copy properties at applet and BC level.

Lets Try to Do this the Non-SRF way.

1. Create a Run Time Event , with Applet Object and SubEvent as CopyRecord


2. Create a Action Set, with below Configuration





Reload the events and see the changes, We have successfully Disable Copy Record without any SRF change :-)



Wednesday 21 October 2020

Disabling Copy Paste in Siebel Fields - List applets

 Hello All, 

In my previous post , 

http://www.siebelfoundations.com/2020/09/disabling-copy-paste-in-siebel-fields.html

i explained how can we disable any UI feature like Copy, Paste, Cut on a field. The limitation of the previous post was that the code works for only form applets, as for list applets we do not have a unique selector (we have multiple columns and we cannot get a unique identifier)

So we can use the Like (*) selector of JQUERY framework, and can extend the functionality for list applets too,

e.g. 







here the Id of first record is 2_s_1_l_Contact_Last_Name, for 2nd it will be 2_s_2_l_Contact_Last_Name ,, likewise for subsequent records.

We can use the * operator and pass the common parameter, 'Contact_Last_Name' in this case, and it will apply to all records in list applet


$( "td[id*='Contact_Last_Name']").bind('copy paste cut',function(e) {

e.preventDefault();

alert('cut,copy & paste options are disabled on this Field!!');

});





Monday 28 September 2020

Extracting Multiple Nodes from Hierarchy - Working with XSL Transformation

 Hello All, 

Recently i was working on a integration where i was getting multiple errors in case of failures.

I was first planning to use FINS Industry XML service for the Error property extraction or Workflow Utility Echo, but these business services have limitations that they can only get one Node/Process Property from the hierarchy. i.e. return the first matching node in case multiple child are present at same level .

In the below XML if we try getting the Value of Error Code, using any Siebel provide vanilla business service ,we will only get "ErrorCode:500" and not the other nodes.







so, to get multiple Node we need to write custom Business Service that traverses the Hierarchy and do looing, that can be a bit confusing and requires multiple looping.

SiebelMessage.GetChild(0).GetChild(0).GetProperty("ErrorCode"); 

here, SiebelMessage.GetChild(0) is the IO instance

SiebelMessage.GetChild(0).GetChild(0) is the IC Instance

SiebelMessage.GetChild(0).GetChild(0).GetProperty("ErrorCode") is the location of process property we need to extract

XSL to the Rescue :-)

Well not a traditional approach, but yes we can use XSL for the multiple Node extraction, and that too without writing a custom BS. The code is pretty simple and can get to any level of hierarchy.

Below code Searches for ErrorCode and ErrorMessage under XMLResult/ErrorDetails path and uses for-each loop to iterate and get the values 





the final Result looks like, 

ErrorCode: 5002 ErrorMessage: The JSON value could not be converted to System 

ErrorCode: 5003 ErrorMessage: The Total value cannot be Negative. 

ErrorCode:5004 ErrorMessage: The Taxes must be passed in Input


I will share more details on how to use this in workflow in my next post, till then happy exploring

Sunday 27 September 2020

Siebel Integration: Search Spec in Data Maps

 Hello All, 

Recently i had a requirement where i had to pass some data over Outbound web service. There was a challenge that required me to pass data of a particular type only from the input data. i.e. The master data has Orders of Type A and Type B and i had to send only Type A Orders.

To achieve this there are multiple way but the best possible i found was Data Map SeachSpec.

This is very simple yet powerful approach for filtering the records.

Sample Data Map:

We need to put the Expression in Source Search Spec and the filtration will be done .
We can pass Expression like [Field] IS NULL, [Field]="TypeA", [Field]>Created etc.








Try and share your experiences.

Disabling Copy Paste in Siebel Fields

 Hello All, 

Recently i had a requirement where i had to Disable Copy Paste on a particular field, to force user to Open Pick Applet rather then directly entering the value for some performance issues.

This is very simple to achieve if we use Open UI, and below piece of code can be used for the purpose.


$('[aria-label="Account"]').bind('copy paste cut',function(e) {

e.preventDefault();

alert('cut,copy & paste options are disabled on this Field!!');

});

Error Popup:




Sample PR File:










Hope this was helpful.

to extend this to List applet please follow the Post

http://www.siebelfoundations.com/2020/10/disabling-copy-paste-in-siebel-fields.html

Friday 24 July 2020

Exposing Siebel API as Auto Search

Hello All,

I have posted multiple article on Siebel Auto Suggestion, where we get the Suggested results based on the keyword typed.

In this post i will share how we can expose Siebel REST API url to be used as Auto Suggestion result fetching.

below Video shows, where a Front End User is entering some Product Name and Siebel API sends the request to Siebel and displays the Siebel Products results.
























Siebel Structure:

The Rest API of Siebel has the features where a search expression can be set and we can return a particular field or set of field.

https://<<hosturl>>/siebel/v1.0/data/Internal Product/Internal Product/?searchspec=([Name] LIKE '"+a+"*')&fields=Name", false);  // `false` makes the request synchronous

here, a is the value that will be entered in text box and passed to Siebel REST API url.

Pretty Simple :-), yet effective

Sample HTML Form
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body  style="background: beige;">
<div class="container">
<div id="emailcontainer">
<label>Search  a product here by entering the keywords</label>
<label for="emailaddress">Product Name</label>
<input type="" class="dataholder ui-autocomplete-input" id="emailaddress" name="emailaddress" placeholder="Email Address.." autocomplete="off">
</div>
</div>
<script>
$('#emailaddress').autocomplete({
  source: function( rqst, response ) {
       var txt='',tags='';
       var request = new XMLHttpRequest();
var a = $('#emailaddress').val();
request.open('GET', "https://<<youraddresshere>>/siebel/v1.0/data/Internal Product/Internal Product/?searchspec=([Name] LIKE '"+a+"*')&fields=Name", false);  // `false` makes the request synchronous
request.send(null);

if (request.status === 200) {

var obj = JSON.parse(request.responseText);
var Items = obj.items;
var length = Items.length;
a = new Array();
for (var i=0;i<length;i++) {
 a[i]= Items[i]['Name'];
}

}
console.log(a);
tags = a;
            var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( rqst.term ), "i" );
            response( $.grep( tags, function( item ){
            return matcher.test( item );
          }) );
      }
});
</script>
</body>
</html>



This can also be implemented in Siebel UI as well, will share the details of that in upcoming posts. 


Tuesday 19 May 2020

Attaching Multiple PR Files in a Applet : Siebel Open UI

Hello All,

This article explains how to tag multiple PR file with a single applet, by design we cannot tag multiple PR file to a Applet, this is Siebel Open UI Limitation.

Then how can we still tag multiple PR ??,  well this is very basic yet difficult to get in first try.

The Crux of the solution lies in Dependencies, i.e. the PR files usually extend their function and behavior from JQGridRenderer or PHYRenderer as shown in below files ,



So we have to pass our 2nd PR File name here in Place of JQGridRenderer in 1st PR File, and 2nd PR file will have the normal syntax.

PR1:

Will have PR2 as its dependency, so when PR1 is Loaded it will automatically Load PR2.








PR2: 

Will have normal structure of extending JQGridRenderer.









Now we need to make entries for Both PR files in Manifest Files, and tag only PR1 with the Applet in Manifest Administration and it will do the work.

Oracle Doc mentioning the issue and suggested Solution

https://drive.google.com/open?id=1Q3z6FCc6aiDsI9eqvG0TxWVUSfneTc36

Try this and let me know in case of any issues.

Monday 11 May 2020

MVG in Siebel : Association and Disassociation

Hello All,

This post is in continuation of my previous post http://www.siebelfoundations.com/2020/05/record-association-and-disassociation.html , Association and Disassociation in MVG applet.

So if the case arise wherein we have to write script of parent BC not the MVG BC. i.e. a case where Order is parent and Voucher is MVG BC, we have to write script on Order.

For Association of Records

The Steps are very simple.

1. Instantiate the Current BC (Order in this case)
2. Get MVG Bus comp from the field on which MVG is based
3. Get Assoc Bus comp from the MVG Bus Comp
4. Specify the search on the Assoc Bus comp
5. Trigger Associate Event


//Add Record in MVG -- Initiate BC - Get MVG BC from Field - Get Assoc BC - Fire Search Spec and Associate

var oNumber = "1-12345TXN";
var oBusObject = TheApplication().ActiveBusObject();
var oBusComp = oBusObject.GetBusComp("Order Entry - Orders");
with(oBusComp)
{
ActivateField("Voucher Number");
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Order Number",oNumber);
ExecuteQuery(ForwardBackward);
if(FirstRecord())
{
var oMVGBuscomp = GetMVGBusComp("Voucher Number");
var oAssocBusComp = oMVGBuscomp.GetAssocBusComp();
with(oAssocBusComp)
{
ActivateField("Order Number");
ActivateField("Voucher Expiry Date");
ClearToQuery();
var expr = "[Order Number] = '"+oNumber+"' AND [Voucher Expiry Date] >= Today()";
SetSearchExpr(expr);
ExecuteQuery(ForwardBackward);
var isRec = FirstRecord();
while(isRec != "")
{
Associate(NewBefore);
isRec = NextRecord();
}
}
}
}

In case of deleting record from MVG 

The Steps are very simple.

1. Instantiate the Current BC (Order in this case)
2. Get MVG Bus comp from the field on which MVG is based
3. Specify the search and till no records left
5. Delete record


////Delete from MVG -- Initiate BC - Get MVG BC from Field  - Delete Record from MVG
var oNumber = "1-12345TXN";
var oBusObject = TheApplication().ActiveBusObject();
var oBusComp = oBusObject.GetBusComp("Order Entry - Orders");
with(oBusComp)
{
ActivateField("Voucher Number");
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Order Number",oNumber);
ExecuteQuery(ForwardBackward);
if(FirstRecord())
{
var oMVGBuscomp = GetMVGBusComp("Voucher Number");
with(oMVGBuscomp)
{
ClearToQuery();
ExecuteQuery(ForwardBackward);
var rec = FirstRecord();
while (rec)
{
DeleteRecord();
rec = FirstRecord();
}
}
}
}

Here in this case we delete record from MVG Bus comp instance.

Tuesday 5 May 2020

Record Association and Disassociation in Siebel : MVG Applets

Hello All,

We have many time worked wth MVG Applets, where 2 Applets opens in Form of Shuttle applet.
The one of left is Associate applet and Right is MVG Applet.

When we Move record from Assoc to MVG is called Association, and Removing/Deleting from MVG is called Disassociation.



Recently i had a requirement wherein i had to perform Association, and update some field in Asso BC to keep some check
i.e. Suppose we are associating a custom entity "Vouchers" with a Account, and once we associate the Voucher we want to update a field in Voucher say Account Name, so that it does not appear again in Assoc list to prevent it from multiple tagging

and the same way we wanted to Nullify the Field, Account Name on the Voucher when Disassociation happen.

Choosing the Events:

Association triggers Associate Event of Corresponding Business Component, so update a field value of assoc BC when Association happen we will have to write script in Associate Event.


function BusComp_Associate ()
{
var AccNum = this.ParentBusComp().GetFieldValue("CSN Number");//to get the field in corresponging parent BC
ActivateField("Account Number"); 
SetFieldValue("Account Number", AccNum);       
WriteRecord(); 

}

There is no such event Disassociate in siebel, rather DeleteRecord is triggered when Disassociation occurs, so to remove the field value we can use Delete event.
I am using preDelete event, to make my code run before the record is deleted.

function BusComp_PreDeleteRecord ()
{
ActivateField("Account Number"); 
SetFieldValue("Account Number", ""); 
WriteRecord(); 
return (ContinueOperation);
}

we will explore how to associate/disassociate from different BC, in our next post

Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...