The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Adding new fields in Opportunity Screen.
Posted: 11 Aug 11 7:32 AM
|
fiogf49gjkf0d I need to make some changes in the Opportunities screen like, I need to add two fields to enter additional data regarding the opportunity. (say, Amount funded).
For this, I assume, i need to make changes in database too, say adding two columns to an existing table.
Can someone please help me regarding this. I've been googling and searching on the development, but I couldn't find much help. It would be great, if someone give me the steps regarding this or share me a pdf to study more on development. |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 15 Aug 11 10:36 PM
|
fiogf49gjkf0d Open up the salesl;ogix Architect program.
open up the Database Manager. Scroll to the opportunity table add your two fields commit the changes to the database.
Open up the Plugins
form System:Opportunity Detail
Add an active X control for your data fields and 2 labels.....
Save and Release the form. |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 27 Aug 11 12:38 PM
|
fiogf49gjkf0d Gotcha.. !! Done and successful.. Just a doubt, when i install the bundle through administrator, will it get released to everyone, or i should use the "Release plugin" to release the forms to individuals or a team? |
|
|
| |
|
Re: Adding new fields in Opportunity Screen.
Posted: 15 Jun 12 1:58 PM
|
fiogf49gjkf0d I need to add a couple of fields to the Opportunity Detail form, but these fields are on a custom table that has a 1:1 association with the account table.
How would I do this? The user needs to be able to enter data in the field and have it update the custom table.
Thanks |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 15 Jun 12 9:32 PM
|
fiogf49gjkf0d Add the control. Databind the control property (usually Text property) to the 1:1 field.
Save the form, release to Everyone.
When you Insert an Opportunity, it's usually best to store the 1:1 table at the same time. |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 16 Jun 12 4:34 AM
|
fiogf49gjkf0d You can't - the data doesn't relate to the Opp. SLX will allow you to display that - but will gray out the changeability. You'll need to have some unbound (not linked to those fields) objects on the form and deal with the display/update yourself. |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 18 Jun 12 9:01 AM
|
fiogf49gjkf0d Thanks for the reply Mike - I has a feeling it had something to do with that. Could you give me some sample code that I could use as an example of how to do this? |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 18 Jun 12 9:33 AM
|
fiogf49gjkf0d Here's the starting point:
' Assume strCurrOppID holds the opportunityID. obj1 & obj2 are your display/update fields ' lueAccID is the control holding the Account Name (and the ID for the account) at Opportunity Level ' aData is an array containing results of Query (1 based)
' Get the data and display it - add this part to the WhenChange of the form.
If GetFields("yourFieldA,YourFieldB","ACCOUNT_EXT","ACCOUNTID='" & lueAccID.LookupID & "'",aData) Then
obj1.Text = aData(1) obj2.Text = aData(2)
End If
' On the WhenBeforeRecordChange of the form - write the data back from above (otherwise, it'll be lost)
Dim objSLXDB, objRS, strSQL Set objSLXDB = New SLX_DB Set objRS = objSLXDB.GetNewRecordSet strSQL = "SELECT * FROM ACCOUNT_EXT WHERE ACCOUNTID = '" & lueAccID.LookupID & "'" objRS.Open strSQL, objSLXDB.Connection
With objRS .Fields("yourFieldA").Value = CheckForNull(obj1.Text) .Fields("yourFieldB").Value = CheckForNull(obj2.Text) .Update .Close End With Set objRS = Nothing
|
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 18 Jun 12 1:59 PM
|
fiogf49gjkf0d Thanks so much for your help Mike. I have it working for the most part, but I am getting an error when I open an Opportunity where my new field (ESTCLOSEVALUE) is NULL. THis field is defined on the database as type float. Here's what my code looks like in Sub AXFormChange(Sender):
If GetFields("ESTCLOSEVAL","ACCOUNT_EXT","ACCOUNTID='" & lnkAccount.LinkID & "'",aData) Then txtEstCloseVal.Text = CheckForNull(aData(1)) End If
The CheckForNull doesn't appear to be working here.
I then tried changing it to
txtEstCloseVal.Text = NullToZero(aData(1))
but this will store a zero on the database when the field is updated instead of a NULL. How do I get around this error? |
|
|
|
Re: Adding new fields in Opportunity Screen.
Posted: 19 Jun 12 5:10 PM
|
fiogf49gjkf0d Easiest way is to do this:
If GetFields("IsNull(ESTCLOSEVAL,0)","ACCOUNT_EXT","ACCOUNTID='" & lnkAccount.LinkID & "'",aData) Then txtEstCloseVal.Text = CheckForNull(aData(1)) End If
Also, if you do expect Nulls you can always get around it another way:
txtEstCloseVal.Text = aData(1) & ""
|
|
|
|