Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, August 29, 2025 
 
slxdeveloper.com Community Forums  
   
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Save Data Form to Database.
Michael Rivera
Posts: 41
 
Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Aug 09 11:00 AM
Hi all. First time poster. I have tried to do an extensive search to answer this n00b questions but to no avail.

I am a first time Saleslogix customizer with other CRM experience.

I have created a new table that is joined to my account table. I have created the fields necessary for my new data form. I have created the data form from my new database and created the fields. I have binded (correct lingo?) those fields to the corresponding fields in my database and given those fields unique names. I have created an account form datagrid using one of the wonderfull Howto from this site. I right click on the datagrid and it pops my new data form. I go to click save/ok and it doesn't post to the database.

What do i need to do to have it make a simple post to the database and/or edit if that is choosen for an existing record?

Thanks ahead of time.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Aug 09 7:23 PM
Have you verified that it isn't posting? Or could it be that the grid isn't refreshing? (In other words, take a look at the DB)





[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 09 4:12 AM
Michael

Did you populate the BindID of the grid that you created. This should be linked to the AccountID (in other words, it will set this ID to the current AccountID of the account you are looking at during runtime). Then, when you created your add/edit form - this would then know to insert/update the accountid for the extension table you created. The full scenario is:

1) Create the Table (either 1:1 or 1:M) off of the Acccount/table you want
2) If 1:1 - you can just create a new Account/table form - and directly pop on here the fields/columns you created for your new table
3) If 1:M - you need a data grid. Using the BindID of the grid, set the primary ID of the table you are working with (AccountID in this case)
4) Create a new data form - when prompted, select the table you created earlier
5) Add your cols to this form
6) Save it and then, finally, go back to (3) and add the EditView to the one created in (6).
7) You shouldn't need to manually refresh if all the above is OK

That should do it ! If all fails still then do this:

1) Get SLX into position where you are about to press OK on your new form
2) Run up SLXProfiler (you'll find it in Program Files)
3) Select the logo ball and select the running SalesLogix process
4) Press OK on your form - this should do the insert/update
5) In Profiler - you will see what it's done (it will also show errors) via the SQL it generated - you should be able to see everything that's gone on

Also, beware that SLX sometimes suffers from muteness (which I find OK) - for example, you create a new column, you type it as Integer. Your form (which ONLY has an EditBox control) is presented and you type "X" in the field and complete the other fields and press OK - nothing happens. No error, no post, no refresh. The reason is the "X" fails the DB type and the result is NOTHING is posted ! So, make sure you test for types and set the EditBox's/|Controls accordingly !

Regards
Mike
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 7:28 AM
Yes I check the database for verification. Thanks.
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 8:06 AM
Hey Mike,

I had not populated the BindID of the grid. This probably would have tripped me up down the road. The real problem is getting the data into the database from my Add/Edit data form.

I think I am missing generic scripting that will update the database with what I Click the OK button. I double checked the field types and ensured I was entering in valid data. I also tried just typing into one field that I know to be a txt field. It still doesn't seem to be creating a record in the table.

I opened the SLX profiler like you suggested. It seems to be calling a SELECT statement on a unique table ID but I don't see where it is trying to modify or add the data. Take a look:

---------- Executed SQL ----------
SELECT KEYVALUE,SITECODE,KEYTYPE FROM SITEKEYS WHERE SITECODE = '6UJ9' AND KEYTYPE = 25

---------- Executed SQL ----------
UPDATE SITEKEYS SET KEYVALUE = 'A00GLM1', MODIFYDATE = '20090803 13:00:03', MODIFYUSER = 'ADMIN' WHERE SITECODE = '6UJ9' AND KEYTYPE = 25 AND KEYVALUE = 'A00GLM0'

---------- Client SQL ---------
call slx_DBIDS('OTHER', 1)
---------- Executed SQL ----------
call slx_DBIDS('OTHER', 1)

---------- Client SQL ---------
SELECT * FROM ACCOUNTCOMMISSION WHERE ACCOUNTCOMMISSIONID = 'Q6UJ9A00GLM1'
---------- Executed SQL ----------
SELECT ACCOUNTCOMMISSION.ACCOUNTCOMMISSIONID,ACCOUNTCOMMISSION.ACCOUNTID,ACCOUNTCOMMISSION.CREATEUSER,ACCOUNTCOMMISSION.CREATEDATE,ACCOUNTCOMMISSION.MODIFYUSER,ACCOUNTCOMMISSION.MODIFYDATE,ACCOUNTCOMMISSION.AGENTNAME,ACCOUNTCOMMISSION.LEASEPURCHASEAMOUNT,ACCOUNTCOMMISSION.LEASETERM,ACCOUNTCOMMISSION.POS48,ACCOUNTCOMMISSION.POS24,ACCOUNTCOMMISSION.UNDERFLOOR,ACCOUNTCOMMISSION.LEASEAPPLICATIONFEE,ACCOUNTCOMMISSION.LEASECALLBANKLEAD,ACCOUNTCOMMISSION.LEASEOTHER,ACCOUNTCOMMISSION.LEASENETDUE,ACCOUNTCOMMISSION.REPROAPPLICATIONFEE,ACCOUNTCOMMISSION.REPROUDCSPLIT,ACCOUNTCOMMISSION.REPROBONUS,ACCOUNTCOMMISSION.REPRONETDUE,ACCOUNTCOMMISSION.CASHPURCHASEAMOUNT,ACCOUNTCOMMISSION.CASHLESSEQUIPCOST,ACCOUNTCOMMISSION.CASHBALANCE,ACCOUNTCOMMISSION.CASHUDCSPLIT,ACCOUNTCOMMISSION.CASTHTAXES,ACCOUNTCOMMISSION.CASHAPPLICATIONFEE,ACCOUNTCOMMISSION.CASHCALLBANKLEAD,ACCOUNTCOMMISSION.CASHOTHER,ACCOUNTCOMMISSION.CASHNETDUE,ACCOUNTCOMMISSION.BANKNAME,ACCOUNTCOMMISSION.POSDE FROM ACCOUNTCOMMISSION
WHERE ACCOUNTCOMMISSION.ACCOUNTCOMMISSIONID = 'Q6UJ9A00GLM1'

---------- Client SQL ---------
call slx_ClearGlobalID
---------- Executed SQL ----------
call slx_ClearGlobalID


Thanks for all your help ahead of time.
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 9:04 AM
---------- Client SQL ---------
SELECT * FROM ACCOUNTCOMMISSION WHERE ACCOUNTCOMMISSIONID = 'Q6UJ9A00GLM1'
---------- Executed SQL ----------
SELECT ACCOUNTCOMMISSION.ACCOUNTCOMMISSIONID,ACCOUNTCOMMISSION.ACCOUNTID,ACCOUNTCOMMISSION.CREATEUSER,ACCOUNTCOMMISSION.CREATEDATE,ACCOUNTCOMMISSION.MODIFYUSER,ACCOUNTCOMMISSION.MODIFYDATE,ACCOUNTCOMMISSION.AGENTNAME,ACCOUNTCOMMISSION.LEASEPURCHASEAMOUNT,ACCOUNTCOMMISSION.LEASETERM,ACCOUNTCOMMISSION.POS48,ACCOUNTCOMMISSION.POS24,ACCOUNTCOMMISSION.UNDERFLOOR,ACCOUNTCOMMISSION.LEASEAPPLICATIONFEE,ACCOUNTCOMMISSION.LEASECALLBANKLEAD,ACCOUNTCOMMISSION.LEASEOTHER,ACCOUNTCOMMISSION.LEASENETDUE,ACCOUNTCOMMISSION.REPROAPPLICATIONFEE,ACCOUNTCOMMISSION.REPROUDCSPLIT,ACCOUNTCOMMISSION.REPROBONUS,ACCOUNTCOMMISSION.REPRONETDUE,ACCOUNTCOMMISSION.CASHPURCHASEAMOUNT,ACCOUNTCOMMISSION.CASHLESSEQUIPCOST,ACCOUNTCOMMISSION.CASHBALANCE,ACCOUNTCOMMISSION.CASHUDCSPLIT,ACCOUNTCOMMISSION.CASTHTAXES,ACCOUNTCOMMISSION.CASHAPPLICATIONFEE,ACCOUNTCOMMISSION.CASHCALLBANKLEAD,ACCOUNTCOMMISSION.CASHOTHER,ACCOUNTCOMMISSION.CASHNETDUE,ACCOUNTCOMMISSION.BANKNAME,ACCOUNTCOMMISSION.POSDE FROM ACCOUNTCOMMISSION
WHERE ACCOUNTCOMMISSION.ACCOUNTCOMMISSIONID = 'Q6UJ9A00GLM1'

This is definitely doing the select for this particular ID. But, I'd expect to see an update statement here (if this is an edit) - can you re-do for an Insert ?
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 9:35 AM
On the Add/Edit Form, put in a field bound to the AccountID field, and check to see if it gets populated with the Account ID.

Also, out of the SLX Profiler, did you check the "Error Log" tab to see if there are any errors. Certain versions of the Profiler will not log the statements on the SQL Log tab if they failed. I would suggest you also check the "All Messages" tab.

Finally, what if you call the view using the "ShowViewFor" function and manually populate the AccountID, does it still fail to save?
If so, could you create a new form with just one or two fiels on it, and save it without populating any values, just to see if it creates records on the DB?
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 9:39 AM
This should be an insert. There isn't anything in the table right now and I am opening this by right clicking on the datagrid and clicking add. I used the scripting that was provided on this site to create this functionality.
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 9:43 AM
That's potentially the issue. If this is a simple grid + form (all databound) you need NO scripting whatsoever. It's all handled by SLX

- Bind the ID in the grid to the accountid
- Create a new DATA form based on the table you are inserting to (your table in your case)
- Add to this form the objects you need
- On the original grid - modify the EditView to be the form you created above.

No further code is required ! SLX will *automatically* no whether this is an insert or edit.
Mike
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 11:17 AM
Hey Mike,

I am going to be as descriptive as possible. I am probably only missing one thing. Thanks again for all the help.

I have an Account Data Form with my datagrid. It has a BindID of Account:AccountID. It has an EditView of Account:Myformname. Now, I'm not sure if this should be AccountCommission:myformname (I called my table AccountCommission) or not because the AddEdit form is a AccountCommission data form but part of the Account Family. When I look through the AddEdit screen that pops up to add the form it only lists Account and not AccountCommission. Like I was saying before I'm not sure if this is listing tables or families. If it is listing tables I need to find out how to include/join my table. It didn't give me the option to do a local join, etc either. BUT, I have added a text label to test and it seems to be popping the correct Add/Edit form I created. The keyfield is AccountCommissionID.

The Add Edit form I created is an AccountCommission Data Form. I have added all the corresponding fields from my table to the Text field (ie. AccountCommission:AgentName).

I have removed all scripting from both forms. I also make sure that I reset all screens inbetween changes, etc.

Do I need to add these forms to the project manager?
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 11:24 AM
Thanks! It is irrelevant what the form is called or what family it is in (in terms of the edit form). However, my personal preferences is this :

Create a new account form in Architect - save it in the family account as "Commissions". Open this form and add a new datagrid to it and then bind the ID to the ACCOUNT:ACCOUNTID (as you have done).
** In the SQL property - select this and ensure the Account is in the drop-down and the account.accountid is in the Join section
** Add to the layout anything you want
Save and release it (this puts it in the More Tabs for Account.
Create a new data form - select the base table as AccountCommission. Save this in the System family as "Add Edit Account Commissions"
Add to this form the objects needed for the update of this table. Save and Release
Go back to the Commissions form and set the EditView to the new form created above (System: Add Edit Account Commisions"

This should be it !! I think the thing we missed was the ** items above !

Mike
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 11:42 AM
Should I be using an INNER join as opposed to a LEFT join? The Account->AccountID join is under the AccountCommission as I have choosen AccountCommission as my table in the SQL property. I have added a few items to the layout. Last changed, Net due etc.
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 11:51 AM
An inner simply means you MUST have a commission per account. A left means it's an option. Always go with Left if unsure.
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 4:47 PM
Hey Raul,

I tried adding the Account ID from both the Account and AccountCommission table but neither are showing up in the Add Edit form I created. I looked in the Error log and there wasn't anything posted. I also looked at the all messages tab and it says essentially the same thing as the SQL tab.

Sorry, I am not familiar with the "ShowViewFor" function. Where would I find that property/function?

I created a new AccountCommission Data Form with one field which the Text property included the AccountCommission:AgentName. Changed the datagrid so that it would pop my tester form and tried saving without anything in the field. It did not update the database and even when I populated the field and tried to save it didn't update the database.

Thanks ahead of time.
[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 4:58 PM
I completely deleted the datagrid and started from scratch. Still isn't creating a record in the database. I am version 7.2 does that make a difference? When I called Saleslogix technical support they said I have to have some kind of scripting for the OK button to insert/update a record in the database. They of course won't give it to me unless I pay for the $900 developer pack... or something to that effect.

Thanks ahead of time.
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 09 5:54 PM
From what I've gather from what it is you are trying to do - I can categorically say (or I'll pay the $900!) that you don't need script. This is all "bread and butter" stuff ! What I suggest you do is create a bundle of the table (go into Architect, create a new project and then expand the right hand window and hit the green + symbol and add the "Creat Table" option. Then add the table you created to this project - finally, save the project as a bundle (should end up with a .SXB file) and then email me it at mike.spragg@empath-e.com - I'll send you back the bundle with the form/add-edit etc.

It really does work that simply - you are just suffering from lack of training and SLX Tech Support (quite rightly) aren't giving up the goods if you've not paid the course ! (just doing their job of course) !
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 09 12:11 AM
Quote:
Originally posted by Mike Spragg

From what I've gather from what it is you are trying to do - I can categorically say (or I'll pay the $900!) that you don't need script. This is all "bread and butter" stuff ! What I suggest you do is create a bundle of the table (go into Architect, create a new project and then expand the right hand window and hit the green + symbol and add the "Creat Table" option. Then add the table you created to this project - finally, save the project as a bundle (should end up with a .SXB file) and then email me it at mike.spragg@empath-e.com - I'll send you back the bundle with the form/add-edit etc.

It really does work that simply - you are just suffering from lack of training and SLX Tech Support (quite rightly) aren't giving up the goods if you've not paid the course ! (just doing their job of course) !



I agree with Mike.
Based on the scenario that you are describing, there shouldn't be a need for any scripting.



[Reply][Quote]
Michael Rivera
Posts: 41
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 09 10:48 AM
Mike,

Thank you for all your help this morning. The final problem was I didn't drag and drop the AccountID from AccountCommission in the SQL property under the AccountCommission table. With this and the BindID property set to Account:AccountID it worked perfectly.

You were right. Not a script in site.

THANKS!
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Save Data Form to Database.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 09 10:57 AM
You're welcome - glad we got to the bottom of it !
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/29/2025 12:30:07 PM