One of the most common requirements from customers is to provide functionality to search and view orders within Salesforce.com. This step-by-step overview of building order view integrations should help de-mystify the process.
Step1: Building a wireframeLike any other UI development, UX is very important. Depending on the order processing system there may be a ton of fields which represent order and order line items. There are some to key items to focus on when building a wireframe:
This is the critical component which takes the criteria provided and make the backend call. Here are a few considerations:
- How does the user traverse to the order view page? If the user looks up from Account, then in addition to account identifier, filters like open orders, orders for the last 30 days or top 10 orders helps in query performance.
- Use required fields for the search screen. Generic searches with no boundaries can potentially return thousands of rows. Based on the user profile enforcing mandatory fields is key.
- Persisting in the order header elements and callout to backend service if we want to know more about the order.
Focus on the field elements to display.
The following questions will help in clarifying the user requirements:
- How are the Order headers to be displayed? Layout of the Order Header?
- Do we want to display Account level info along with Order Header?
- Associations/Relationships with other objects Accounts, Products etc. - Do we need to display them as read only or as look ups?
- Field formatting - Should there be standardization and localization of the field display?
- How does the user drill down from Order header to Order details? Should links be provided from header view to navigate more detailed views?
Something to ask is whether the customer wants to list the records and paginate between result sets.
Step 2: Service definitionHaving a middleware helps a lot as this can reduce the complexity of mapping and service invocation from Salesforce. Instead of being just a passthrough i.e simply acting as a broker, middleware could abstract the backend API signatures and expose only field elements required for Salesforce. This makes implementation and maintenance relatively easier.
Performance is king
The service performance makes big difference in user experience. Ideally keeping the performance in 5-10 secs improves the usability. Enforcing strict transaction timeout helps in throwing meaningful error messages back to user before Salesforce times out the request.
Implementing a pagination at the service level helps to put a limit on the number of records returned. The input signature could include page number and page size (number of records per page). Also, in addition to the page result, the output could return query count (total number of records for the search criteria).
Simplifying the data results helps in UI rendering. Standard applications like SAP and Manhattan have complex nested schemas. Parsing the response in Salesforce makes for complex apex development. Middleware could provide the solution with a simplified canonical model.
Step 3: BackendThis is the most important step of all, engaging a Subject Matter Expert (SME) who has in-depth understanding of the system helps in building the proper backend service. e.g SAP ABAP developer to develop custom RFC to fetch order details.
A few important factors to consider:
- Explaining the requirements clearly to the backend developer.
- Review the mapping fields, search criterias and result sets.
- Performance and Service Level Agreement (SLA) for the backend call
- Security, data encryption and other compliance requirements.
Step 4:Depending on the level UI requirements, we could implement using the following ways:
- VF custom development and render the data returned from the webservice call. In this model out of the box VF features are used.
- Use of JQuery or other JS frameworks. In this model, the data response is returned directly to JS framework and allowing to render the data. This method helps if the service provide supports JSON formats to return the data.
Step 5: Testing and TuningThree areas have to be unit tested thoroughly:
- The backend services
- Service exposed from middleware
- Apex classes which invokes the middleware service
Use of Canvas API:
Caution: This is a brand new feature and still in pilot program but provides promising features to avoid any custom development.