Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Nickel Elite Contributor
Posts: 86
Registered: ‎10-21-2009

Picture Uploader In SalesLogix7.5.4 Web

Hi All,

 

Currently we are migrating SaleLogix Lan Customization to WEB.

 

As per requirement, we need to have a tab under some entity. This tab will contain an Image control and a file uploader control.

 

We need to select an image and onclicking Upload button, the image will be saved into the Database and visible in the Image Viewer.

 

We have created an custom page in dot net. Though its working in Dot Net env. but unfortunately we could not able to make it worked in SalesLogix. (Onclicking Upload button nothing happens)

 

One more thing how to add our custom  .ashx file in SalesLogix as we need to have one in this case to display the image.

 

Any help will be highly appreciated.

 

Greetings

Malay

Bronze Super Contributor
Posts: 129
Registered: ‎06-09-2009

Re: Picture Uploader In SalesLogix7.5.4 Web

Been there, done that.

 

I use ashx files all the time, not an issue with using them, but remember to keep them at the root of the Portal, otherwise you would need to setup whcihever folder you store them in as an Application.

 

That said, I used an Input item for the Upload:

<input type='file' runat='server'...>

 

And a separate button (ASP button) to upload the file.  (I used javascript to automate the clicking of the button after the selection of a new Image).

 

That said, I do recall having some issues with IE that I didn't encouter with Chrome and had to change my design a couple of times.

 

 

Raul A. Chavez
http://raul.chavez.com
http://www.crmbi.com
Nickel Elite Contributor
Posts: 86
Registered: ‎10-21-2009

Re: Picture Uploader In SalesLogix7.5.4 Web

Hello Raul,

 

Thank you very much for your response.

 

Can you plese guide me with some code snippets. As I am doing this for the first time SalesLogix, I am finding it difficult to get things going. Though things are working fine in Regular Visual Studio, but not in SalesLogix.

 

Thanks

Malay

Bronze Super Contributor
Posts: 152
Registered: ‎02-01-2011

Re: Picture Uploader In SalesLogix7.5.4 Web

I second this request. 

Andy Freeman
TrellisPoint, LLC
Nickel Contributor
Posts: 51
Registered: ‎07-31-2008

Re: Picture Uploader In SalesLogix7.5.4 Web

I've had to deal with this problem a few times, and I can tell you that this is very dificule to get working 100% from completely within SLX Web.  What I mean by that is from within a SmartPart in SLX.  The SLX implimentation of AJAX makes working with Viewstate a bit tricky for many controls.   If you spend some time with the Attachments tab, and how the get the upload to work, you'll the they had to jump thorugh a few hoops to get it working.  I've managed to mirror the code they've done in their JS code and on the attachments tab to get my own uploading working, but it still tends to be unpredictable with the attachments tab visible.

 

A little trick I've come to love is when I need to do something that's very easy to do in .Net but a pain in SLX is to use a pop-up.  You'll note that this is what SLX ended up doing with the Groups builder for the exact same reason.  You can build your page in .Net (adding any references to the SLX libraries that you may need to use), and reap all of the benefits of complete control, while still having access to nearly all of the SLX objects.  The only thing you need to do is open the pop-up with javascript, and pass in anything you need as a URL parameter to the pop-up (i.e. entityId). 

 

When you're done with whatever uploading or other otherise tricky tasks, just call this javascript to close the pop-up and refresh page in SLX (to show your image, for example)...  window.opener.location.href = window.opener.location.href; window.close();

 

One last note, you have complete control over the size o fthe pop-up, but any other parameters that window.open allows have unpredicatble results.  Specificaly, don't supply a title for the pop-up (IE really doesn't like this).

 

This works perfectly, and will save you many late nights.  The only real drawback is that window is non-modal, so nothing is stopping the user from moving to another record (although by passing in the Id to the pop-up, this should not be a big deal).

 

Chears!   -jeremy

Bronze Super Contributor
Posts: 152
Registered: ‎02-01-2011

Re: Picture Uploader In SalesLogix7.5.4 Web

Here's a quick and dirty solution. I used a tab workspace and a custom smart part to add a contact image. I created a BLOB field (Photo) in the contact table. The contact properties are updated in AA and the entity interfaces rebuilt.

 

Some notes: yes, AJAX is wonky. The server-side onClick event fires but the upload is no longer accessible. I tried using the Telerik uploader but it didn't play nice with other uploader on the attachments tab. Instead, I handled the upload in OnLoad and fired a __doPostBack() in onClientClick (trial and error). I used a Data URI to push the image data to the client, rather than creating a URL. There's a generic 200x200 image resource that is used if the Photo field is null. The uploader respects the ENTITIES/CONTACT/EDIT secured action.

 

You can add the attached to your AA project in Portal/SlxClient/Smart Parts/Contact, then add the smartpart to the tab workspace in the portal config.

Andy Freeman
TrellisPoint, LLC
New Member
Posts: 2
Registered: ‎06-30-2011

Re: Picture Uploader In SalesLogix7.5.4 Web

This almost works in 8 too, but I can't figure out how to get the __doPostback to finish properly. SLX WEB gets stuck with a loading icon, if anyone has figured this out, tips would be very helpful. Thanks.

Bronze Super Contributor
Posts: 152
Registered: ‎02-01-2011

Re: Picture Uploader In SalesLogix7.5.4 Web

Have you looked at Fiddler to see if the request is dying partway through? Any javascript errors?
Andy Freeman
TrellisPoint, LLC
Nickel Super Contributor
Posts: 80
Registered: ‎07-11-2009

Re: Picture Uploader In SalesLogix7.5.4 Web

Gary,

Were you able to work out the problem using this in v8? Could you post the details, please?

Thanks!

Jerry Norman