8/16/2025 7:27:19 PM
|
|
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!
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.
|
|
|
|
Adding a reference to a custom assembly (DLL) - How?
Posted: 28 Nov 08 8:36 AM
|
Hi guys,
I've written a string manipulation function in Visual Studio, to format Contact phone numbers. I've compiled the function into a DLL. My intention is that this function would be called in the OnBeforeUpdate event of the Contact entity. My problem is I have no idea how to reference my DLL inside AppArchitect so that I can call it from within the OnBeforeUpdate event!
The function signature currently looks something like this: public static int FormatNumber(Country country, string numberToFormat, out string countryCode, out string areaCode, out string mainNumber, out string extension)
Note that Country is a custom entity object. The function returns an int, which indicates success/error status. The out parameters are to be used to retrospectively update the Contact's phone number with the formatted version of whatever was entered prior to the Save event.
Can anyone tell me how I can call my function from within a Contact Event? Thanks for reading and for any help you can offer!
- Alec D |
|
|
|
Re: Adding a reference to a custom assembly (DLL) - How?
Posted: 04 Dec 08 10:33 AM
|
First you need to add the DLL to your portal's SupportFiles/bin directory. After that, you can open up the Contact entity in AppArchitect, navigate to the events and open the OnBeforeUpdate. There probably is already a primary step defined that you don't want to modify, so I would probably put it in the Pre-Execute Steps. Select that tab and click on Add. Choose the External Assembly radio button, then click "Choose type and method from assembly." When the Class Browser opens, select File menu and open your DLL. Expand the namespace down to your function, highlight it and click OK.
That should be all you need. Frankly though, I would probably do the formatting in a business rule instead of an event. You might find that you'll have other fields in the future that you wish to validate, and doing so in a business rule or a C# snippet may turn out to be more easily maintainable. |
|
|
|
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!
|
|
|
|
|
|
|
|