Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, July 6, 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!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: a big problem with code (it works the first time then it does not)
Derek
Posts: 115
 
a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 May 09 7:15 AM
Hello All.

In Saleslogix 7.5 Application Architect, you have the abilitity to add C# code in the C# code snippet. When we add code to do certain functions, then save, then deploy. The function works the first time. When the website is opened again an error message is displayed which relates to the code entered. Then when you check the code (in the snippet) we find that the code we have entered is no longer there.

Has anyone here had a problem like this, and if so what was done to fix it.

For us this is a major problem and our project has stopped because of this problem.

Thank you very much in advance
[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 May 09 4:53 PM
Derek,
I've seen what you describe when using block comments. Avoid the use of block comments ( /*.... */ ) in snippets. There is an issue with the parser that will delete code below any block comments as App Architect inserts a rather large comment block in the beginning of the snippet that contains assembly and other information. It is best to use single line comments in snippets ( // ) to avoid confusing the parser and potentially deleting wanted code.
[Reply][Quote]
Derek
Posts: 115
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 2:12 AM
Hi Mike,

First thank you for your suggestion. We did notice that in the beginning and therefore did the same as your suggestion. However, believe it or not, the code entered into the snippet still disappears which is very strange.
Our development enviroment is totally isolated, ruling out virus threats,etc. The worst part is that due to this problem the project is halted.

again thank you for your advice
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 3:59 AM
Very strange...does it happen to all snippets? If not would it be possible to post the code in the affected snippet.

The symptoms are very odd - if it works the first time you use the website then the snippets must have been there and deployed!
[Reply][Quote]
Derek
Posts: 115
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 7:17 AM
Hello Nick, thanks for your input. I will try and explain in better detail:

(1) What happens is that the developer works in App Architect , builds and deploys and when trying to run the site an error is displayed saying that the OnLoad snippet (for example) does not exist. So you redo the code for the snippet or in the snippet.
(2) Then do a save, build and deploy. The website opens and no error message.
(3) A couple of builds later and the link from the same event, or another event, to the code snippet goes missing yet again. "This is what the error message will reference to", the code snippet cannot be found.

But when we do a search you will find the snippet.

the code is there but its like the (link) between the code to an (event), a very basic event no longer works.

more specifically, the link between the event and the code snippet is missing/is changed/is corrupted some how.
[Reply][Quote]
slxguy
Posts: 71
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 9:21 AM
This has happened to be before in 7.2 (not yet in 7.5). I ended up having to hard code the aspx page after i deployed...unfortunately we were never able to pinpoint the cause but we reported this to Sage as a bug.
[Reply][Quote]
Derek
Posts: 115
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 9:52 AM
Hi slxguy,

(1) we working with SalesLogix 7.5 and and installed Service Pack 1 and updated with the hotfixes from Sage.

I would be keen to know how you fixed the problem with the 7.2 version as it might work? Prepared to try anything!

Thank you
[Reply][Quote]
Derek
Posts: 115
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 9:53 AM
Hi slxguy,

(1) we working with SalesLogix 7.5 and installed Service Pack 1 and updated with the hotfixes from Sage.

I would be keen to know how you fixed the problem with the 7.2 version as it might work? Prepared to try anything!

Thank you
[Reply][Quote]
Nicolas Galler
Posts: 93
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 10:17 AM
If those are code snippets (as opposed to "C# Snippet Action Items"... the ones marked as "Obsolete" in the App Architect) you can replace them with external assemblies. I had the problem you described the first time I tried to use code snippets and resolved to only use external assemblies from then on.

If it is a C# snippet action item (those were the only snippet type in 7.2) you can take the generated ASCX and add it as a custom smart part (copy it to another location on the web root and select it under the smart part list for the page - remove the original quick form smart part mapping first, this way you can use the same idea and the existing code won't break). Then you can edit the ascx directly. You can then delete the original quick form, or keep it for reference (but maybe make a note on it that it is not used anymore so it is not confusing 3 months from now).
[Reply][Quote]
Derek
Posts: 115
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 10:53 AM
Hi Nicolas:
firstly Thank You for the tip and idea.

Is there any chance, if you have the time, to give me an example of how I would access the a "control" on form externally?
and if it possible, how to access an entity which is related to the form?

I could be asking the wrong questions above? Or if you have time can you give some detail of you did go about your suggestion. We have thought about this but not sure of a "how to"

again thank you
[Reply][Quote]
Nicolas Galler
Posts: 93
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 09 11:18 AM
Yes - if you are doing a code snippet the code in the external assembly is exactly the same (the only "trick" is to get the correct referencing assemblies when you build it in Visual Studio). For example:
public static void OnFormLoad(ISEOppUtilityForm form, EventArgs e)
{
ISEOppUtility entity = (ISEOppUtility)form.CurrentEntity;
// when we use the work item from the page level, the entity context service will get us a reference to the page's entity - i.e., the parent
IOpportunity parentEntity = (IOpportunity)form.WorkItem.Services.Get().GetEntity();
form.lueUtility.LookupResultValue = EntityFactory.GetById(parentEntity.SEOpportunityExt.DefaultUtility);
}

So you will be given a "form" object from which you can reference the controls. The form is an adapter to the actual form. There is one corresponding property for each control and a few convenience properties (for example form.CurrentEntity gets you the bound entity). This is the same as the code snippet code though so App Architect will give it to you as a preview when you create the snippet. You still create the snippet as usual but instead of tying it to a snippet you tie it to an external assembly method.

When you create the assembly in Visual Studio you will need to add references to the following assemblies: Sage.Entity.Interfaces, Sage.Form.Interfaces. If your project is stored on the hard drive (not on the database VFS) you can find them there under the deployment folder, otherwise you can add references to the ones that were deployed under your web site.


The other option is if you are using a "regular" code snippet, you can change it to a C# snippet action. They are marked as Obsolete but their implementation is a lot more simple so they tend to be more reliable.

Hope this helps - I share your frustrations concerning the handling of code snippets.
[Reply][Quote]
Derek
Posts: 115
 
Re: a big problem with code (it works the first time then it does not)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 May 09 7:33 AM
Hi Nicolas

Thank you for your input. We do appreciate your help and the other people that have also shared their ideas on this point.

We try what you suggest & let you guys know how it goes.

Hopefully Sage will bring out a BIG fix for this problem?

[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): 7/6/2025 11:33:55 AM