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!
|
|
Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 03 Mar 08 7:04 PM
|
I've totally copied the Ticket Comments and written a new business rule as follows:
namespace Sage.BusinessRules.CodeSnippets { public static partial class TicketBusinessRules { public static void AddTicketRecreateTimeStampStep1(ITicket ticket) { ticket.TicketAddon.StepsToRecreate = TicketHelperClass.AddUserDateTimeStamp() + ticket.TicketAddon.StepsToRecreate; } } }
However, when I hit the button I get the following error (pardon my .NET virginity)
Unable to locate type information 'Sage.BusinessRules.CodeSnippets.TicketBusinessRules, Sage.SnippetLibrary.CSharp' for business rule 'Ticket.AddTicketRecreateTimeStamp'
Can someone clue me in?? Thanks in Advance.
|
|
|
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 9:57 AM
|
Your business rules get added to a DLL named Sage.SnippetLibrary.CSharp.dll and the class "TicketHelperClass" that contains the AddUserDateTimeStamp method exists in the DLL named Sage.SalesLogix.BusinessRules.dll.
So, you're trying to use a method/class that you've not referenced. Does that make sense?
You have two choices:
1) Copy the needed code from the TicketHelperClass to your business rule, duplicating the logic there.
2) Add a reference to the Sage.SalesLogix.BusinessRules.dll so you can use that code. In order to do this you need to modify your codesnippets.xml file so that it references the Sage.SalesLogix.BusinessRules.dll for builds of the Sage.SnippetLibrary.CSharp.dll file and then add a using directive to the rule to reference the namespace that TicketHelperClass is in.
Does that make sense?
-Ryan |
|
|
| |
| |
| |
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 11:07 AM
|
Originally posted by Mike Boysen
Makes sense Ryan. Thanks for your help. I guess they're telling us to get with the program because the program is changing!
Seems harder, but I can see where some things are much easier. This should be an adventure |
|
Some of it will take some playing with before it clicks - but once it does, you'll love it. I completely hate getting back into LAN client development now. I try to fill my development queue with as many web projects as possible - they're way more fun  |
|
|
| |
| |
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 11:38 AM
|
So just to point out, the DLL you'd add to your codesnippets.xml file is: Sage.SalesLogix.BusinessRules.dll
And the namespace is for your using directive: Sage.SalesLogix.Ticket (TicketHelperClass is the class name)
-Ryan |
|
|
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 12:11 PM
|
Originally posted by Mike Boysen
Uh....where's the codesnippets.xml file? Hehe
Answer: Searched and didn't find it. Read the FAQ and found it at
C:\Documents and Settings\All Users\Application Data\Sage\Platform\Configuration\Global |
|
BTW, in 7.2.2 you no longer have to edit that XML file, instead you can do the following:
When viewing the code for your Code Snippet in the tabbed MDI workspace in Application Architect, use the combo box at the top of the docked Properties window to select “Sage.Platform.Orm.Entities.CodeSnippetHeader. This will show the editable properties for the code snippet. Edit the AssemblyReference collection and add your reference. The comments at the top of your code snippet will be updated to reflect the new assembly reference as well.
Notes about HintPath: The HintPath property is not necessary for any assemblies located in the GAC. The %BASEBUILDPATH% environment variable is used to point to the build output location for the Application Architect code generation. Out of the box, this points to C:\Documents and Setting\\Application Data\Sage\Platform\Output. |
|
-Ryan
|
|
|
| |
| |
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 1:16 PM
|
Just to check. Is this the correct reference in codesnippets?
%BASEBUILDPATH%\assemblies\Sage.SalesLogix.BusinessRules.dll
(The reference tags are being stripped and I forget the way to include them)
I'm uncertain about the path. This is what my business rule looks like. Anything obviously wrong? It's frustrating not knowing what to look for
#region Usings using System; using Sage.Entity.Interface; using Sage.SalesLogix.Ticket; #endregion Usings
namespace Sage.BusinessRules.CodeSnippets { public static partial class TicketBusinessRules { public static void AddTicketRecreateTimeStampStep1(ITicket ticket) { ticket.TicketAddon.StepsToRecreate = TicketHelperClass.AddUserDateTimeStamp() + ticket.TicketAddon.StepsToRecreate; } } }
|
|
|
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 1:24 PM
|
Originally posted by Mike Boysen
Just to check. Is this the correct reference in codesnippets?
%BASEBUILDPATH%\assemblies\Sage.SalesLogix.BusinessRules.dll
|
|
%BASEBUILDPATH% translates to the path where the AA builds the assemblies. Take a look at that location. You can see where that location is by checking the Tools | Build Settings menu. Look at that path and you'll see the Sage.SalesLogix.BusinessRules.dll is not located there. That DLL won't be located in the build path at all since it is not built by the AA. You can just add the full physical path to the DLL and it should work.
-Ryan |
|
|
| |
| |
| |
| |
| |
| |
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 04 Mar 08 2:24 PM
|
Glad it is working now.
Originally posted by Mike Boysen
BTW, I never expected you to respond so quickly and frequently. But, I appreciate it. |
|
I love this new stuff, so don't mind taking a few minutes to respond to these kinds of questions. |
|
|
|
Re: Trying to rip off "TicketAddBlahTimeStamp" Business Rules
Posted: 24 Mar 08 10:18 AM
|
Originally posted by Ryan Farley
BTW, in 7.2.2 you no longer have to edit that XML file, instead you can do the following:
-Ryan
|
|
Ryan.
I'm on 7.2.2 and I do not see this in the drop down box. Thus, I cannot edit the default references within Application Architect. Maybe I'm not looking in the right place. I've checked in business rules and code snippet and the drop downs do not contain the reference you pointed out. Any ideas?
NEVERMIND: I found it |
|
|
|