Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 29, 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 - ASP/ASP.NET/Web Services/Other
Forum to discuss building external web applications for SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ASP/ASP.NET/Web Services/Other | New ThreadView:  Search:  
 Author  Thread: ASP.NET Boolean doesn't work with SLX Boolean Fields
Duncan Cook
Posts: 164
 
ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jun 06 10:58 AM

abortion pill

abortion pill online usa

abortion pill over the counter in usa

abortion pill online usa singlvkuchyni.cz
fiogf49gjkf0d
It seem that ASP.NET Boolean fields look for either 1/0 or true/false where SLX Boolean fields are T/F
The best way I've found to handle this is to translate the SQL at source;

For example;

Select SQL = "Case ISEXTERNAL when 'T' then '1' ELSE '0' End as ISEXTERNAL"
Insert SQL = "Case @ISEXTERNAL when '1' then 'T' ELSE 'F' End"
Update SQL = "[ISEXTERNAL] =Case @ISEXTERNAL when '1' then 'T' ELSE 'F' End"

The other benefit of this method is that for UPDATES and INSERTS it eradicates NULL's

If any one knows a better way please let me know

--
Duncan
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jun 06 7:28 PM

how much does the abortion pill cost without insurance

abortion pill cost cvs
fiogf49gjkf0d
I usually do the boolean translation one of two ways. First way is how you mention (in the views/procs/queries). It does work well. However, I also do it in the business objects. I hardly ever work directly with data in my apps. I always wrap the calls for data access in a layer that will dish out business objects. I find that I often will wrap the translation got booleans in the properties for the fields in the objects.
[Reply][Quote]
Duncan Cook
Posts: 164
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Jun 06 6:27 AM

domperidone notice

domperidone sandoz
fiogf49gjkf0d
Interesting, I've not used Business Object for my data do you have any examples or links to good examples?

Thanks
Duncan
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 12:09 PM
fiogf49gjkf0d
Well, I can't think of any sources off top of my head. I have a tool that generates the base of the business objects from an entity in SLX. It is *very* crude, but maybe I could clean that up and put it on this site at some point. Basically you build a layer that will access the data and stuff it into nicely typed objects so you are using those instead of raw data. The objects are bindable to controls and it sure makes for nicer syntax.

I prefer something like this:

Account account = broker.GetAccount(accid);
if (account.Type == AccountType.Customer)
{
account.Status = "Active";

if (account.IsTargetAccount)
{
account.History.Add(new History(HistoryType.PhoneCall, DateTime.Now.AddDays(5)));
}

foreach (Contact contact in account.Contacts)
{
if (contact.Email != string.Empty)
{
Mailer email = new Mailer(contact.Email);
email.Subject = stdemailsubject;
email.Body = stdemailbody;
email.Send();
}
}
account.Save();
}


...over using clunky DataSets and DataReaders any day (and who wouldn't? )
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 4:37 PM
fiogf49gjkf0d
Here's my conversion code for the SLX Boolean to bool:

public static bool ConvertBooleanStringToBool(string stringBoolean)
{
// F = false, T = true
bool booleanReturn = false;

switch(stringBoolean.ToUpper())
{
case "F":
booleanReturn = false;
break;
case "T":
booleanReturn = true;
break;
}
//MessageBox.Show("String: " + stringBoolean + "\nBoolean: " + booleanReturn);
return booleanReturn;
}


Just as there exists Common plugins that handle conversions in SalesLogix, this function would go into a common business object as it covers literally every table.

Regarding the tool, I'd love to contribute to making the code production quality (though I have no doubt it's useable as-is). I could even contribute my knowledge of Delphi to create objects for use there for those of us who value straight Win32 programming (Delphi 7 that is, haven't nor will I use Delphi.NET (version 8 burned me)). I'm currently in a project that relies heavily on DataSets/Readers so it would be nice to think in BOs instead of this hodge-podge of "get something out the door, yesterday". That'll have to be a couple of versions from now anyway but having something to help, plus the applied knowledge of someone like yourself who isn't head-down in Architect would make this so much easier.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 4:40 PM
fiogf49gjkf0d
MessageBox.Show() is indication I spend a little too much time in Architect.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 4:46 PM
fiogf49gjkf0d
My boolean properties are a bit simpler. You can expect that a SLX Boolean will be one of only 3 possible values: "T", "F", or NULL.

My properties look more like this:

private string _someboolfield;

public string SomeBoolField
{
set { _someboolfield = value; }
get { return _someboolfield.Equals("T"); }
}


All you really care about is that the the value is "T", otherwise you assume false. As you can see from that code sample, I usually just store the true value inside the object and just translate it on reads of the property.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 5:29 PM
fiogf49gjkf0d
You are correct about assuming "T". SalesLogix does this as it sometimes leaves a boolean as NULL unless you specifically alter the control's properties. I convert to a bool because I use DataSets and it's much easier to deal with a bool than that one character string, plus I like the compactness of "if (blah)" instead of "if (blah.Equals("T"))". Largely personal preference as the conversion takes up unnecessary cycles in most instances.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 5:32 PM
fiogf49gjkf0d
As I read the last part of your post, does that mean it should be public BOOL SomeString so it returns true/false based on the .Equals() call?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 5:49 PM
fiogf49gjkf0d
Doh. Yeah, see that is what happens when you try to quickly type some code into a post. I usually give my disclaimer that it is mean to be more psuedo code more than something that would actually compile.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: ASP.NET Boolean doesn't work with SLX Boolean FieldsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Jun 06 5:51 PM
fiogf49gjkf0d
But the point of the sample was just to say that all you really need is:

return (someboolfield == "T");


To translate the string T/F to a boolean. The rest could be ignored.
[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/29/2024 5:28:45 PM