This
week I received a question regarding the Description that is used by
Opportunities. In the Opportunities Defaults options, it states that
you can customize this option by “contacting your Administrator”. This
option can only be customized via scripting, not via a SalesLogix
dialog box.
If you open Architect, go to Manage/Plugins. You will need to open the “Insert Opportunity” plugin.
On the Insert Opportunity Plugin, Script Tab, you can go to the Procedure called “SampleDescription”
This script will pull the Account Name from the Account Name on the Opportunity Screen, then
adds the Text “-phase” , then counts the existing opportunities for
this accounts and adds 1. This is the description that is then put in
the Opportunity Description field.
Note: Always use a Test Database
The Sample Description procedure is as follows:
Function SampleDescription()
Dim strAccountName, strUserDefined, strOppCount, strAccountID, strSQL
Dim objRS
On Error resume Next
Set objRS = objSLXDB.GetNewRecordSet
strSQL = “Select ACCOUNTID from ACCOUNT where ACCOUNT = ‘” & lveAccount.Text & “‘” ‘DNL
objRS.Open strSQL, objSLXDB.Connection
strAccountID = objRS.Fields(“ACCOUNTID”).Value ‘DNL
objRS.Close
Set objRS = objSLXDB.GetNewRecordSet
strSQL = “Select Count(*) From OPPORTUNITY Where ACCOUNTID = ‘” & strAccountID & “‘” ‘DNL
objRS.Open strSQL, objSLXDB.Connection
strAccountName = lveAccount.Text
strUserDefined = Application.Translator.Localize(“-Phase”)
strOppCount = objRS.Fields(0).Value + 1
objRS.Close
Set objRS = Nothing
SampleDescription = strAccountName & strUserDefined & strOppCount



