Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, August 28, 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: new problem - SLX3.10
Andrew
Posts: 29
 
new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Apr 09 8:30 PM
Can somone tell me why this code does not work?:

Handle = DBOpenTable("vendor", False)
DBInsert Handle

DBSetValue Handle, "vednorId", vend_ID
DBSetValue Handle, "CreateUser", CurrentUserID
DBSetValue Handle, "CreateDate", Trim(Date) & Trim(Time)
DBSetValue Handle, "vend_name", GetPropertyOf("EdtBx1","Text")
DBSetValue Handle, "ModifyUser", CurrentUserID
DBSetValue Handle, "ModifyDate", Trim(Date) & Trim(Time)
DBPost Handle
DBClose Handle

No error messages and no new records in the table.

I just checked " DBExecuteSQL " command - this same!

Thanks,
Andrew
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Apr 09 4:34 AM
Use this instead:

strSQL = "select * from vendor where 1=0"
h = DBOpenSQL (sql, false)
DBInsert h
DBSetValue "VendorID", vend_id
DBSetValue "CreateDate", cstr(Now)
..
..
DBPost h
DBClose h

Essentially, don't use DBOpenTable, don't try and concatenate date/time - and always cstr() anything that isn't already a string. This stuff only applies to Legacy code of course.
[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Apr 09 9:17 AM
It did not work.

I will try to create this table again.


Andrew
[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Apr 09 9:29 AM
I did try to recreate this table and during process of applying changes to database it stoped with popup message: "Invalid Password". It is starange because I don't remember having problems with passwords within this installation.


Any ideas/sugestions?
Andrew
[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Apr 09 9:43 AM
It is still not working!

Other question:
I'm using vend_ID = DBCreateIDFor("vendor") to to set id for records in this table. Now I have new vendor table but this function is generating id like for old table. Table is empty but it shows id=.......288

Thank you for any help.
Andrew
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Apr 09 3:19 PM
The IDs for Custom tables are generated out of the "Other" key: (SELECT * FROM SITEKEYS), thus you will not see the IDs on this table be in order, it will jump around as there are several tables that share this key.


[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Apr 09 3:26 PM
Quote:
Originally posted by Andrew

DBSetValue Handle, "vednorId", vend_ID


Did you type this code or pasted it?
- The ID field seems to have a wrong spelling since the Table Name is Vendor.

- Also, seems as if the Concatenation for the Create Date and Modify Date could be causing problems as well (haven't tested it, but I see a potential there). I would recommend you just use the Now() function:
DBSetValue Handle, "CreateDate", CStr(Now())
DBSetValue Handle, "ModifyDate", CStr(Now())

- Also, do you know if the code is executing? Any errors?
Use LogixClearError and LogixErrorText to clear the Error before executing and checking the errors after you do the Post.

[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Apr 09 10:01 PM
Quote:
Originally posted by Raul A. Chavez

The IDs for Custom tables are generated out of the "Other" key: (SELECT * FROM SITEKEYS), thus you will not see the IDs on this table be in order, it will jump around as there are several tables that share this key.




So far I didn't spot any out of ordeer id, allways were in order and advanced by 1.

Andrew
[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Apr 09 10:09 PM
Quote:
Originally posted by Raul A. Chavez



Did you type this code or pasted it?
- The ID field seems to have a wrong spelling since the Table Name is Vendor.

- Also, seems as if the Concatenation for the Create Date and Modify Date could be causing problems as well (haven't tested it, but I see a potential there). I would recommend you just use the Now() function:
DBSetValue Handle, "CreateDate", CStr(Now())
DBSetValue Handle, "ModifyDate", CStr(Now())

- Also, do you know if the code is executing? Any errors?
Use LogixClearError and LogixErrorText to clear the Error before executing and checking the errors after you do the Post.



VENDORID - this is copied directly from Database Manager

CStr(Now()) - I already have fixed this.

do you know if the code is executing? - yest it is - I vave two msgboxes just before and after this code. Both msgboxes are poping up.

LogixClearError and LogixErrorText - I will try it tomorrow.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Apr 09 11:21 PM
Quote:
Originally posted by Andrew


LogixClearError and LogixErrorText - I will try it tomorrow.


These functions will help you get the error information from the DB Engine.

Quote:
Originally posted by Andrew


So far I didn't spot any out of ordeer id, allways were in order and advanced by 1.

This is probably because you aren't creating records in several tables that require IDs from the Other category.
If you have multiple Custom Tables that require Primary ID, and start generating IDs for each table you will see how each ID is sequential, even though you are calling it for different tables.

E.g. If you execute the following code:
msgbox DBCreateIDFor("vendor") Result: Q6UJ9A000001
msgbox DBCreateIDFor("vendor_2") Result: Q6UJ9A000002
msgbox DBCreateIDFor("vendor_3") Result: Q6UJ9A000003
msgbox DBCreateIDFor("vendor_4") Result: Q6UJ9A000004
msgbox DBCreateIDFor("vendor") Result: Q6UJ9A000005

The reason for this is that each ID is generated sequentially from the Other category out of the Sitekeys table.
A good reference article regarding IDs can be found on this site:
http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=87

Now, one thing is for sure, you are really making us dig deep into our past to retreive some of this knowledge. Although I have to admit that I somewhat loved Cypress Enabled VB, dropping it was quite a blessing.



P.S. One last thing to be aware of with Cypress Enabled VB Script (Legacy Scripting): If you have a function that return a boolean, it then makes all the functions return true (or was it false?)
This was a big bug, that even though I knew about, I found myself many times debugging (sometimes it was other dev's code that when integrated would cause this silent failure).
So, for SLX 3.10, do not Implement functions returning booleans, rather return a string "True" or "False" and then compare the value accordingly as a string.
[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 09 9:36 PM
!!! Thank you very much for your help !!!

I would like to let you know so my problem is solved!!! - it was vendorId misspeling!!! I never expected so it will just go on without crashing or any error reporting in such case!

Every such post, like yours, make me to know and understand SLX and programming better and better.

I know, it is old, but I have what I have and... I know few companies still runing on Novel 3.12 and computers without Hard Drives, booting from flopies. They bought them 15 years ago, last virus they had 10 years ago, server was working once non stop, almost 4 years without restarting. They are turning off copmuters just by switching them off, at any time, and next day, they can start from this same point, losing only last sentence. They are printing every business form, labels, barcodes on laser printers and all that on Novel3.12, DOS6.22 and FoxPro2.6. The only think they are missing is internet.

I'm positive, I'm not wasting my time by lerning all of that, I know some day I will use my kowledge one way or another.

So, thank you, all of you for this forum and for help you are providing. I hope some day I will be able to help too.

See you soon!
Andrew
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Apr 09 3:12 AM
He he - you should have seen my original post - I noticed you'd misspelled it and I'd corrected it for you !
[Reply][Quote]
Andrew
Posts: 29
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Apr 09 7:16 PM
Quote:
Originally posted by Mike Spragg

He he - you should have seen my original post - I noticed you'd misspelled it and I'd corrected it for you !


Now I can see it!!!

Thanks,
Andrew
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: new problem - SLX3.10Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Apr 09 9:35 PM
That is why I went as far as pointing it out specifically on one my responses, even quoting the original code with the misspelled field name.

Sometimes, all you need to do is take break, and then look at it from a different angle....
[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/28/2025 5:58:01 PM