Login / Register  search  syndication  about

          Jason Buss' Blog

Jason Buss on SalesLogix development & customization, SQL, and more.

Setting required fields in SalesLogix 7.5 Web Client insert views

For this post, I'll outline how to use a business rule to enforce field requirements on a Insert view in SalesLogix web.  For this example, I'll be adding a requirement to fill the Description field when inserting a new opportunity.

Step 1:  Create Business Rule

In the Application Architect, open the project explorer and open nodes: "Entity Module->Packages->SalesLogix Application Entities->Opportunity->Rules", right-click "Business Rule Methods" and select "New Business Rule"

On the New Method view that opens, name the method (ValidateDescription), and change the return type to "Boolean".

On the Primary Steps tab below, click "Add".  For this example, we will create this as a C# code snippit, so select the appropreate Step Type on the "New Business Rule Step" view, and click OK.

The code snippet will be added to the business rule, but we'll need to add code to the snippet.  Click "Edit Code Snippet" on the Primary tab to see the code window.

Add code in the ValidateDescriptionStep1 to check for blank or null values in the description field:

namespace Sage.BusinessRules.CodeSnippets
{
    public static partial class OpportunityBusinessRules
    {
        public static void ValidateDescriptionStep1( IOpportunity opportunity, out Boolean result)
        {
            result = (opportunity.Description != null && opportunity.Description.Trim() != string.Empty);

        }
    }
}

(The bolded section of code is what you are adding, and will return "True" if description is not Empty or Null.)

Click "Save All" on the toolbar, and Build Interfaces to make the new business rule available to the form.

Step 2:  Modifying the Insert Opportunity View

Double-click "Insert Opportunity" under "Entity Module->Packages->SalesLogix Application Entities->Opportunity->Forms" to open the view.  We will be adding the new business rule to the Save button for the form, so click the Elipsis button in the "Toolbar" property of the form to open the Toolbar editor.  Select the "Save (QFButton)" item on the left side of the screen.

The standard functionality will have the "Business Rule (Save)" rule on the "complete action item" property. Take note of the Business Rule and Entity Type properties, and all the properties under the "OnClickAction" property.  We will need to reproduce those values elsewhere in a moment...

Expand the node for the "OnClickAction" property, and click the elipsis on the "ActionItem" property.  This will open the Action Item designer.  Select "Validate Business Rule" on the left, and select the new business rule we created for the "Validation Method" property.

The "OnFail" properties should be set to display a message stating that Description is required.  The "OnSuccess" properties should be set will the values we previously found in the "OnClickAction" property for the button (See screenshot).

 

Click OK, and Save the Insert Opportunity form.

Follow these same steps to include the business rule on the SaveNew button on the forms toolbar as well.  Make sure to take note of the "OnCompleteActionItem" settings in the SaveNew button, so they can be added to the OnSuccess property for the Validation Business Rule on that button as well.

Rebuild the web platform, and Deploy the portal to make the changes available.

That's all there is to it!  If a user tries to create a new opportunity that does not contain a description value, they will be prompted to include that value, and the save process will fail.

 

I hope you find this walkthrough helpful.  Thanks for reading!   Smile

What's This?
  
Bookmark and Share

About Jason Buss

   Jason is a senior application developer with Customer FX.



Related Content
   Saleslogix (now Infor CRM) Web Client- Build Error Based on Quick Form Name
 I recently discovered a problem that will occur if you happen to name a quick form the same name as
Posted on Oct 31, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Unicode Character Sets for SalesLogix Web 8.1
If you have the need to use unicode character sets so international users can view the web client in thei
Posted on Oct 29, 2014 by Mark Duthoy to SalesLogix Support
 
   Change the Appearance of a Saleslogix (Now Infor CRM) Read Only TextBox Web Control
In the Salelogix web client, a read only control has a css style applied to it to make the background app
Posted on Oct 24, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix (now Infor CRM) Web Client- Changing Label Appearances on Quick Forms
 I wrote previously about setting a label's appearance on a quick form using server side code.&n
Posted on Oct 02, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Error Attempting to Save an Entity: "E_FAIL(0x80004005)" in the Infor CRM (Saleslogix) Web Client
We recently had a client that was running into an issue when attempting to create one particular entity i
Posted on Sep 30, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register