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 fields to Contacts
Posted: 19 Jul 08 6:02 AM
|
Hi everyone, Newbie here to the forums & saleslogix, so please bare with me...
Well I was thinking adding new fields to contacts should be simple enough so we dont have to pay 3rd party people to do it for us. I just wanted to add a few tick boxes & maybe a text field, how would I approach this? we're currently using 7.2 and I got architech here with me which im still messing about with. Well if someone could point me into the right direction I would really appreciate it.
Thanks in advance
|
|
|
|
Re: Adding fields to Contacts
Posted: 20 Jul 08 6:09 AM
|
You are correct - adding these controls is not at all difficult and, in a nutshell, you would:
(a) Click the control you want (b) Click on the form where you want it - drag it about and don't make the ultimate mistake of not keeping the object in line (both vertical and horizontal) with other controls on the same form. It'll look like a mess otherwise. (c) Double-click the object and find the Text (or bolded item) item - this indicates a data binding property. Click the ellipse - this will lauch the query control - find your data item and press OK. (d) That's it !
The item will now work and data will save.
If you want to add new fields - this is a little bit more involved but can be done - in Architect, go to Database Manager, click the account table (for example) and right click/add new field - name it based on what it's going to store e.g. AccountRef, StaffQty. Define it's type (depending on what you want to store). Press the tick to commit the change.
Press F5 to refresh.
Open the form you want it to display on - and follow instructions above - this time selecting your field. Job done ! check out http://www.goodtraining.com for more lessons and examples.
Regards Mike
|
|
|
|
Re: Adding fields to Contacts
Posted: 13 Aug 08 8:09 AM
|
Thanks Mike,
I have another issue, i've added a new field it works perfectly. Now i want to include that field into the form where users Adds/Create a new contact/account. I made sure the control and script matches like the other fields(copy and paste named it correctly etc.) but when i create a new account and it is been succesfully added all the other details are the correct, except my custom field there's no data. Is there something that i am missing?
thanks in advance. |
|
|
|
Re: Adding fields to Contacts
Posted: 13 Aug 08 8:21 AM
|
Unfortunately, this form (Ins Acc/Con) is not "databound". What this means is that you can't use the databinding method above. You need to actually alter the code to post the data. This, in itself, isn't that difficult either:
Within the Add New Contact Account form go to the Script tab.
If you adding **Account** data find:
Sub InsertNewAccount
Add a new line at the end and before the .Update:
objRS.Fields("MYDATACOLUMN").Value = CheckForNull(MyObject.Text) 'DNL
Replace above as necessary. If you are doing this for a **Contact**:
Find:
Sub InsertNewContact
And do the same as above.
Regards! Mike
|
|
|
| |
| |
|
Re: Adding fields to Contacts
Posted: 13 Aug 08 7:24 PM
|
This should work, looks good. Suggest you put a
MsgBox pklAccRegion.txt
on the line before you set REGION, just to verify that there is data there at the point where the DB is updated.
Phil |
|
|
| |
|
Re: Adding fields to Contacts
Posted: 14 Aug 08 5:53 AM
|
Hi, I don't know if that's relevant or not, but, where is your custom field? on Contact detail or Account detail? You're talking in your first post of adding fields to the Contact detail form? And you are updating the Account's information part of the Add New C/A form? In this case don't you need to update the Sub InsertNewContact? Best Regards, |
|
|
|
Re: Adding fields to Contacts
Posted: 14 Aug 08 6:14 AM
|
Hi,
Firstly the msgbox you added should read MsgBox pklAccRegion.text not MsgBox pklAccRegion.txt - change that and release it.
The Insert looks good suggest you try the following.
1) Insert a new Account called InsertTest - make sure and fill in the region field - when you hit OK you should get a message confirming the value of the region you entered 2) Create a new Account Group with just one condition Account.Account = "InsertTest" - in the layout of the group add the region field.
When you look at the group you have created (just one row) is the region value visible. If Yes - your insert is fine - it's the detail view thats wrong If No - then it is indeed the insert form that's not doing it right.
Nick
|
|
|
| |
|
Re: Adding fields to Contacts
Posted: 14 Aug 08 9:38 AM
|
You have saved the pick list Itemid rather than the pick list Text in the Database.
Select the correct region, save this into the database field and all should be ok. |
|
|
|