Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009
Accepted Solution

Inserting ID for custom table

Hi all.

 

We created a custom table via the Architect (C_MyTable) it has a one-to-many relationship with the ACCOUNT table.

 

Next, we created picklist (myPickList) where the user will choose a value and that value will be entered into the custom table (C_MyTable).

 

I setup up the text field of the field (created a local join from LEFT join ACCOUNT to C_MyTable) and in the picklist field of the properties chose myPickList.

 

Now when I test it out by going to account details and choose a value from the pick list and click Save I get the following error:

 

Field 'C_MyTableID' must have a value

 

It seems like it's not entering the C_MyTableID, yet I checked the checkbox: Fied is Auto Increment in Database Manager for that field.

 

Any ideas how can insert an ID for that field?

 

We are using SalesLogix v7.2.1

 

Thank you in advance!

Bronze Super Contributor
Posts: 349
Registered: ‎03-24-2009

Re: Inserting ID for custom table

Based on your comment that you used a join from Account to C_MyTable on your data form I suspect you added an Account form rather than adding a data form based on C_MyTable.

 

Generally speaking you will add an Account form that has a datagrid to list your one to many records.  You will add a data form based on your one to many table for the add/edit form.

 

Hope this helps!

Timmus Agersea
Black Moth CRM
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Inserting ID for custom table

But I want the picklist whose data source is C_MyTable to appear in the account detail area (for example, under the account website). Can I bring in a data form into the account detail form?
Bronze Super Contributor
Posts: 349
Registered: ‎03-24-2009

Re: Inserting ID for custom table

[ Edited ]

I am assuming you are working with the LAN client.  Please correct me if I am mistaken.

 

You cannot databind picklist controls to tables - they are driven off of the picklist table.  The SalesLogix databinding engine thinks you are trying to store data in the C_MyTable table, not use it as a lookup.  You must use a dropdown control and programmatically populate the items collection with the contents of C_MyTable.  You will databind that control to the appropriate Account column.

 

Make sense?

Message Edited by tagersea on 04-15-2009 11:09 AM
Timmus Agersea
Black Moth CRM
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Inserting ID for custom table

Yes we are using the LAN client.

 

And C_MyTable will be used to store the value chosen from the picklist, for the account that this currently displayed in the account detail view.

Bronze Super Contributor
Posts: 349
Registered: ‎03-24-2009

Re: Inserting ID for custom table

You cannot databind to a one-to-many table.  The only tables that you can include on the Account Detail form, via databinding, are one-to-one tables.  Was the table added as one-to-many by mistake?

Timmus Agersea
Black Moth CRM
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Inserting ID for custom table

You are right Timmus, it has a one-to-many relationship with the ACCOUNT table.

 

So how can I get this to work? I can't use a picklist?

 

We want to keep track of how many different values an account can have for this field based on the value chosen by the user from the picklist.

Bronze Super Contributor
Posts: 349
Registered: ‎03-24-2009

Re: Inserting ID for custom table

No you cannot use a picklist with the table structure you have in place.  If you want to use a multi select picklist, simply add a column to the Account table and you can then databind a picklist control to it. 

 

If you have existing data in the table then things become more interesting - especially if there is more than one column.  In this case I would either add a new account tab that lists the records from the custom table and/or add a datagrid to the Account Detail that is bound to the custom table.

Timmus Agersea
Black Moth CRM
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Inserting ID for custom table

Ok Timmus thanks for all your help.

 

I'll make a datagrid and then a Data Form where the user could select a value from the picklist.

 

Smiley Happy

New Member
Posts: 15
Registered: ‎12-07-2010

Re: Inserting ID for custom table

hi - I'm using the auto increment on the HISTORY table so I can insert bulk records through DTS/SSIS. I have checked the auto increment in the DB manager and am leaving the HISTORYID field out of my insert statement but am still getting the "cannot insert NULL" error. I have restarted the service/server after enabling auto increment, have set my connections using the SLX provider and have even tried run the SQL code within the SLX admin and client with the same result.

 

Anything else I need to do?

 

SLX V7.2.1

 

Thx
Leon