Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, September 27, 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: Need help accessing data in javascript
Corey
Posts: 42
 
Need help accessing data in javascriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 06 2:46 PM
fiogf49gjkf0d
Okay...so I'm new at this and still trying to figure some stuff out. I need to access a field in the database inside my javascript code, is there a way to do this? Here's what I'm trying to do. In the HTML, if I want to access a database field and assign that field to a textbox I do it like this: <td><input type="text" name="blah" value="<#F name=blah>" /></td>. So, want I am trying to do is only add a label if a field has a certain value. How do I drop access that database field inside the javascript? Any help would be most appreciated.
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Need help accessing data in javascriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 06 11:46 PM
fiogf49gjkf0d
Corey,

It's actually pretty easy. If you look at the template "accinfo" on line 13, you'll see they've referenced a #SYS tag in JavaScript. You can do the exact same thing with a #FIELD tag.

For example, make a copy of the accinfo template and make the copy active. Then modify the line that reads (should be line 23)



to read



Then just after line 18 that reads:
var accid = '<#AF name=id>';

add this function:

function test()
{
if ("<#FIELD name=accname>" == "Abbott Ltd.")
{
document.all.ACCOUNT[1].innerText = "Abbott Label";
}
else
{
document.all.ACCOUNT[1].innerText = "";
}
}

That function [test();] gets called when the HTML page is finished loading. It should change the label next to the Account name to a blank if the account is not Abbott Ltd. If it is Abbott Ltd., it should read "Abbott Label". Unless I've left something out (it is getting late), that should do it.

If you run into issues, post again and I'll do my best!

Jeff
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Need help accessing data in javascriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Nov 06 11:48 PM
fiogf49gjkf0d
Agh! The forum stripped out my tag (rightfully so...). My references to line 23 should look like this - and I've intentionally left out the opening and closing tags.

Change line 23 from this:

body onload="init();" style="border:0px solid;"

to this:

body onload="init();test();" style="border:0px solid;"

I think the rest came through OK.

Jeff
[Reply][Quote]
Corey
Posts: 42
 
Re: Need help accessing data in javascriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Nov 06 2:15 PM
fiogf49gjkf0d
That did exactly what I needed. Thanks.
[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): 9/27/2024 9:16:25 AM