Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Entity Events in SlxMobile/SDATA

Thanks Mike. I can now see an exception logged to the event viewer from that event, so it looks as if the assembly is being called. I appreciate you sticking with me on it.

Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Entity Events in SlxMobile/SDATA

I don't know quite what I'm doing wrong, but this still isn't working.

 

It worked twice, but now I've since done something and it isn't firing at all, again. Theres nothing in the event viewer except a lot of complaints about memcache.

 

What is the most effective way to step through the app to ensure that the external assembly is being called? 

Bronze Super Contributor
Posts: 236
Registered: ‎03-30-2009

Re: Entity Events in SlxMobile/SDATA

To debug:

  • Open the website in Visual Studio
  • Make sure debug is set to 'true' in web.config
  • Add an existing project to the solution
  • Browse to the Build folder specified in AA - you should ce a csproj file there - add that one
  • In studio, choose 'class view' in the solution explorer on the right
  • Navigate to the entity you are looking for and you will see a list of functions
  • You can then open a function and add a breakpoint
  • Attach to the W3WP process
  • Run the test - you should be able to step thru the code of the busniess rule

Note that you will probably NOT be able to step thru your external assembly unless you also add it to the solution and delete the dll from the bin folder of the website.

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Entity Events in SlxMobile/SDATA

[ Edited ]

Here's what I have found so far.

 

For the Account entity I defined the Primary Step in OnAfterInsert to be the method from Sage.SalesLogix.BusinessRules.

 

For the Post Flush step of OnAfterInsert, I define the OnAfterInsert method from my external assembly. I chose Post Flush because I need to access data stored in the Contact for the Account, and when I attempted to query it in other events I was not getting a valid reference to it. Built, then deployed.

 

I see many csproj files across several folders in the build diretory, so I grabbed two: Sage.Entity.Interfaces and Sage.SalesLogix.Entities. 

 

I deleted the external assembly from the web BIN directory and instead added a Project reference to the web - the project that contains the external assembly.  I then set 3 breakpoints - one in Account.cs at the base OnAfterInsert, one in a method on the Insert Account web control (for sanity purposes), and the other on the OnAfterInsert method defined in my exernal assembly.

 

I did get 25 thousand (really, 25k) build errors between the two Sage Entity projects but I ignored them and ran the web project anyway. I get a message from VS complaining about a temp file that isnt set to debug mode, but I skip it.

 

The one in the external assembly is never hit. 

 

So let me back up and restate my assumption - that OnAfterInsert will fire after saving a new Account. If this is true, which it appears to be based on the first breakpoint, then my second one still is not being hit. 

 

EDIT - Changed the Primary step to my external assembly, and removed the Post Flush step, and it still didn't hit the breakpoint. 

 

2nd EDIT - Added it to Post Execute, no breakpoint. I'm pretty much throwing stuff at the wall now to see if anything sticks.

 

3rd EDIT - Using a code snippet didn't even work. Totally at a loss as to why this isn't working on any level.