Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, November 16, 2024 
 
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!
 Web Forums - SalesLogix Web Client (Pre-7.2)
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Client (Pre-7.2) | New ThreadView:  Search:  
 Author  Thread: Populating a form
Corey
Posts: 42
 
Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 10:03 AM
fiogf49gjkf0d
Okay, how do I populate a form with information from the database when all select queries are returned as datagrids? I noticed that on the accounts page they have a javascript in there (<script language="Javascript" src="<#SYS name=htmlpath>/jscript/accinfo.js"></script>); does this javascript allow you to call any field from the accounts table and put it in a textbox? How? Is it possible for me to make my own javascript that will pull back information from a table so I can populate information on the screen? Also, I noticed their picklists are done like this (<#PL list="Contact Type" field=contype style="width:110px">). Do I need to use (<script language="Javascript" src="<#SYS name=htmlpath>/jscript/coninfo.js"></script>) at the top before I can create a picklist? If so, do all tables have one of these javascripts that allow you this option? How do I look at all built-in javascripts?
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 3:05 PM
fiogf49gjkf0d
Corey,

No, you don't need the <script language="Javascript"...> tag.

The key is to make the template in question a "detail" template as opposed to a "query" template. If you right click on a template in web manager, you'll see that you have the option to set it there.

When you create a "detail" page, it is for a specific record on a specific table. The first thing you need to do is that when that template is loaded from a link, you must pass in a URL parameter called "id" with a value that represents the primary key of the record in question. An example is this URL snippet from the contact detail page URL (right click the contact detail area & select properties):

http://server:3000/scripts/slxweb.dll/view?name=coninfo&id=CXY9EA009LSG&atemplate=accmain&ctemplate=conmain&otemplate=oppmain


the "&id=CXY9EA009LSG" tells the web DLL to look at the contact detail with a primary key of "CXY9EA009LSG". Once it knows what record to pull, it then uses the #FIELD tags to actually fill the various text boxes with data from the database. The #FIELD tags have a parameter "name", which is the name of the alias to use to get a specific field. So, if you want to get the data from the field contact.account, you'd create an alias to point to that field. (FYI, there is already an alias that points to that field, it's called "conaccname" if you want to look at it).

So, to get data from a specific field for a specific record:

1) Make sure that the template in question is a detail template.
2) Create an alias to that field (if one doesn't exist)
3) Put a #FIELD tag on the template for the value of the text box, using the alias like this.
<input type="text" name="contactaccount" value="<#FIELD name=conaccname>">


If you add that to the contact detail template (coninfo), you'll get a field that displays the account field from the contact table. It's already there, but the example should serve it's purpose.

A note on templates: a detail template can have a #QUERY tag on it, but a query template cannot have <#FIELD> tags on it.

As for a picklist, all you have to do is open administrator and create your custom picklist. Then just use the #PICKLIST tag with the name of the list you want as the "list" parameter. If you look in the web dev ref guide, there are other options, but as an example, if you create a picklist called "mylist" and add the following code:
<#PL list=mylist name=mylistcontrol>


You should get your picklist on the template in a generated HTML control called "mylistcontrol". No need for any <script> tags.

Jeff
[Reply][Quote]
Corey
Posts: 42
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 3:40 PM
fiogf49gjkf0d
Wow, you're pretty amazing!! So let me ask you this - this is the only other thing stumping me - I want to be able to do a query based on one of three options. These options come in the form of radio buttons. If the user clicks a different radio button, I want to update the datagrid with different information. I've made a query with 3 different conditions and have figured out that the key to getting the different results is the typeid. How can I change the typeid to match the value of the radio button that was clicked? As of right now, I have it doing a postback so I don't loose information that the user has entered on the screen, so I figured that there should be some way to change the typeid so when the page refreshes, it pulls back different data. In addition, I need to be able to click on a record in the datagrid and update some textboxes on the screen, how can that be done?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 4:04 PM
fiogf49gjkf0d
Jeff,

You are definitely the man when it comes to the SLX web client. I don't know of *anywhere* that has better info on developing for the SLX web client than what you've posted in these forums.

Thanks!
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 7:43 PM
fiogf49gjkf0d
Corey,

Thanks for the compliment - I'm blushing.

I'm not sure how you have it keeping state on the postback....but hopefully this will work with whatever method you're using. All you have to do on the postback is add something like this to the URL that's reloading the page:

&typeid=your_condition_set_name&QueryParam1=value1&QueryParam2=value2


Basically, the web DLL will always look for a condition set in the query builder that has a name that you specify as the typeid. "typeid" is a special name you can use on the URL that the web DLL will look for to determine what condition set to use. If you don't specify one, it looks for one named "default". That's why you'll see all slx queries have a condition set called "default".

So, for example, the query con_con has a condition set named "country". If you call the page that has the query con_con on it and append "&typeid=country" to the URL, the web client will use that condition set. For the parameters (if your query takes parameters), you can pass them in on the URL. The key is to make sure that if you have a parameter that the name/value pair on the URL matches the name in the query object for the parameter. For example, in the query con_con and the condition set "country", the the condition is where the Contact.Address.Country is starting with ":value". To pass in the country on the URL and have that value used in the query, do something like this:

http://<#SYS name=swcpath>/view?name=ViewWithQuery_con_con_OnIt&typeid=country&value=USA


That will run the query with the specified condition set and only look for the records that have a country of "USA". The key is to make sure that the name of the parameter in the query object (con_con) and the name/value passed in on the query string match. I could put ":jeff" for the parameter in the con_con query country condition and if I used the following URL:

http://<#SYS name=swcpath>/view?name=view_with_query_con_con_on_it&typeid=country&jeff=USA


it'll substitute USA. I saw the post earlier where someone suggested using a session and #SF to maintain state. Be aware that the DLL will look in the session for a matching parameter name and use that. So if you have a session variable named "jeff" and a query object with a parameter (basically a bind variable) named ":jeff", it will use the one from the session. If you have the value in both the query string and the session, the value in the query string/URL wins out over the session - or so says the web dev ref guide. I've never had to worry about having the parameter value in both the query string and the session.

Now, all that said, when the user clicks one of your radio buttons, you'll have to dynamically build the URL to include the specific typeid that you want to call as well as any parameters that typeid/condition set uses. Build the URL, save your session variables and reload the page. Once you do that, it should work. My only concern would be that the session state doesn't get lost. I don't think it will, but just wanted to throw it out there.

Hope this helps,

Jeff
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 7:50 PM
fiogf49gjkf0d
Thanks, Ryan. I'm blushing again.

After seven years of working with the web client, I'd hope I'd have learned something. Of course, it's the web client, so it's the school of hard knocks, work-arounds, head-banging, yelling at the monitor and lots of praying, but it's kept me employed, busy and relatively out of trouble. Now, I've got the .NET (mostly ASP.NET) skills growing and hopefully that will continue.

Thank you for a great site - I'm just glad I can share knowledge - I've often felt I can't "give back", so it's nice to be able to help out.

Jeff

P.S. - Woo-hoo! Post #100!
[Reply][Quote]
Corey
Posts: 42
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jan 07 9:27 AM
fiogf49gjkf0d
Jeff,

Thanks for the reply, that helped tremendously. People on the form who are just getting started with SLX (like myself) are most gracious to have people like yourself around to help share the knowledge.

Corey
[Reply][Quote]
Corey
Posts: 42
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jan 07 3:29 PM
fiogf49gjkf0d
I was wondering if you could tell me how to create and install a bundle of my web customizations?
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jan 07 4:40 PM
fiogf49gjkf0d
Very similar to what the others recommended but there are some additional recommendations that you may benefit from (my post is near the bottom).

http://www.slxdeveloper.com/forum.aspx?forumid=4000&postid=581

Timmus
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Populating a formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jan 07 5:32 PM
fiogf49gjkf0d
I follow the same approach as Timmus. I'll add to make sure that if you've modified any files in the "...web components\slxweb\jscript" folder, added or modified any images, or any CSS files, be sure to include them. I've forgotten those before and I've finally got it on my "don't forget" list.

Another thing to watch for - if you have any help icons on new templates, you'll need to add the help file in the "...\slxweb\help" folder. You'll need a folder with your package name and an HTML file in the package folder with the same name as the template. If you modified any templates and want to include updated help, you'll want to copy the one out of the original package folder, put it in your custom folder and modify it. That said, I've rarely made changes or added help files. Customers aren't usually willing to pay for that stuff.

Jeff
[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 © 2024 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): 11/16/2024 11:24:07 AM