Professional Documents
Culture Documents
Scenario # 1
IN TOOLS
On the Business Component Opportunity, RCNR and fill in the following details.
Name: Closed By
Join: S_OPTY_X
Column: ATTRIB_47
On the Opportunity Business Component, right click and choose Edit Server Script. Choose
eScript as your language of scripting. On the PreSetFieldValue event, write the code below.
Hit the Save button. Compile the Opportunity Business Component by right-clicking on the
Opportunity Business Component and choosing Compile Selected Object.
On the Account Business Component, right click and choose Edit Server Script. Choose eScript
as your language of scripting. On the NewRecord event, write the code below.
function BusComp_NewRecord ()
{
var loginName = TheApplication().LoginName();
if (loginName == "SADMIN") {
this.ActivateField("Type");
this.SetFieldValue("Type","Commercial");
}
}
Hit the Save button. Compile the Account Business Component by right-clicking on the Account
Business Component and choosing Compile Selected Object.
On the Service Request Business Component, right click and choose Edit Server Script. Choose
eScript as your language of scripting. On the PreSetFieldValue event, write the code below.
vACTBC.ClearToQuery();
vACTBC.SetViewMode(AllView);
vACTBC.ActivateField("Activity SR Id");
vACTBC.SetSearchSpec("Activity SR Id",vSRID);
vACTBC.ExecuteQuery();
Hit the Save button. Compile the Service Request Business Component by right-clicking on the
Service Request Business Component and choosing Compile Selected Object.
1. For Contact’s, Last Name and the First Name should not be the same.
(Hint: Contact BC, Server Script, Write Record Event)
2. If SADMIN logins in, whenever he queries on any of the Account views, show only
Accounts with the Status as Active
(Hint: Account BC, Server Script, PreQuery Event)