Author: catalinatechnology

3D Modeling Gardens

OK, this isn’t a normal Catalina post about programming and how to integrate things.  This is one of our side projects in gardening.  One of the things that we are very passionate about is local farming and trying to figure out how to create economical farming that produces high nutritional value food, reduce water usage (we are in Southern California), and get food to people who need it.

I used Sketchup to design a simple rain gutter garden (Inspired by Larry Hall and the great folks at the Rain Gutter Grow System Page on Facebook Link to Group Page)

If you want the file I did to create this model, you can download it here: Link for Sketchup file for rain gutter garden

If you don’t know what Sketchup is, you should.  It is a great 3D tool that helps you design and explain ideas and designs to others with a simple to use interface.  You can see more here Sketchup Website.

Here is the actual system in action:

Creating SL Sales Orders and having SL automatically handle pricing for Catalina’s SOAP based API for Dynamics SL

Creating SL Sales Orders and having SL automatically handle pricing for Catalina’s SOAP based API for Dynamics SL

There are many times where you want to be able to import sales orders into Dynamics SL and have SL automatically price the order items for you (instead of you manually setting it).  This is easy to do in REST, because you can omit fields like CurySlsPrice and then the RESTful API will see that as a null and then ask SL to price for you.  But SOAP isn’t as simple since passing nulls isn’t as easy.

We have a simple way of handling this by a secret number.  Yes, I said that right.  We use a secret number (-999876 to be exact).  This is a very unlikely number to ever have a price set as in SL.  So, if you set the sales price of a line item to -999876, the Catalina API will then ask SL to automatically price it for you.  If you pass any other number, the Catalina API will use that number for pricing override.

Here is an example: (NOTE:  see the setting of the orderItems array, both the CurySlsPrice and CuryCost is getting set to -999876.  This tells the Catalina API that it is to use the SL sales price for the customer and follow all pricing rules setup against the customer, price class, quantity ordered, etc.

// Test placing an order with the bare minimum
ctDynamicsSL.orders.order oOrder = new ctDynamicsSL.orders.order
{
 SOTypeID = "SO", // set your order type (must be a valid soTypeID)
 CustID = "C300", // which customer are you creating an order for (must be a valid CustID)
 ShipViaID = "BEST", // how are you shipping it (ust be a valid shipViaID)
 ShiptoID = "DEFAULT", // Which ShipToID for the customer are you shipping to (must be a valid shipto address for the customer)
 AdminHold = true, // for kicks, we are going to put it on admin hold
};

// create an array of orderItems with the bare minimum (this allows SL to price)
List<ctDynamicsSL.orders.orderItem> orderItems = new List<ctDynamicsSL.orders.orderItem>();
orderItems.Add(new ctDynamicsSL.orders.orderItem
{
 InvtID = "0RCRANK", // which invtID are you sending this to? (must be a valid InvtID)
 CurySlsPrice = -999876, // -999876 is a secret number that will tell the web services to allow SL to price the item
 CuryCost = -999876, // if you want to price this yourself, just put in the amount you want to price
 Taxable = 1
});
oOrder.orderItems = orderItems.ToArray();

// lets place the order using placeOrder()
var placedOrder = OrderService.placeOrder(oOrder);

// if there is a value in the errorString property of the returned object, then there was an error
if(placedOrder.errorString.Trim() != "")
{
 Console.WriteLine("An Error Occurred: " + placedOrder.errorString.Trim());
}
else
{
 Console.WriteLine("Order Created: " + placedOrder.OrdNbr);
}

You can see the full example on GitHub here: https://github.com/CatalinaTechnology/ctAPIClientExamples/tree/master/TestSLConsole

Dynamics SL Quick Query through Catalina’s RESTful API

Dynamics SL Quick Query through Catalina’s RESTful API

Catalina Technology has an API that allows you to integrate with Dynamics SL’s Quick Query through both SOAP and REST interfaces.  This example shows you how to make a call to Quick Query using RESTful API.

If you want to learn about the SOAP methods, you can see an earlier blog post here:

Example of building a Form Client to use the Catalina Quick Query SOAP Web Service

First, thing you can do is look at your swagger documentation by directing your browser to the swagger docs on your ctDynamicsSL web application. Continue reading “Dynamics SL Quick Query through Catalina’s RESTful API”

Auto Numbering new PO’s using Catalina’s API for Dynamics SL

Many times, we want to be able to create Purchase Orders, using the Catalina API for Dynamics SL, and don’t want to worry about having to create the PO Number ourselves so that we don’t reuse a PO number, etc.  This is a function of Dynamics SL and is configured in the POSetup table.  If you look at the POSetup table, at the AutoRef column, it can be either a 0 or a 1:

autopocheck

If it is a 1, it means that SL will auto-number for you and if you leave the PoNbr blank when you call the ctDynamicsSL.purchaseOrders.saveNewPurchaseOrder function it will auto generate it for you, just like sales orders.

If PO Auto numbering is not enabled, POSetup.AutoRef=0  then you have to specify the PONbr yourself.  But dont worry, we have a work-around for this that will generate a custom incremented number for you by calling this Catalina API call:

ctDynamicsSL.common.getNextCounterAsString(counterName);

This function uses the xct_tblDSLCounter table to determine the next number value.  This table is a Catalina table that is used for anything you want to have a counter for and is keyed off of the column: counterName.  If you create a new record with the counterName = “PONBR”, you can then do an API call like this to get the next number:

string nextPONbr = ctDynamicsSL.common.getNextCounterAsString("PONBR");

Looking further in the xct_tblDSLCounter table, you can see the following fields:

  • counterName: This is the key to determine which counter you want to increment
  • counterPrefix: If you want to have some type of custom prefix on your counter, you can enter something here
  • counterAmt: this is the last counter used
  • minWidth: this will make sure that you have a certain width of number come out (not including the prefix)

Lets create a record in the table for PONBR.  I just choose PONBR because it makes sense to me.  But you could use any counterName.  Or for that matter, you could have several records for PO Numbers so that you can have separate prefixed counters for different applications that might be feeding your PO’s.

insert into xct_tblDSLCounter
values('PONBR', 'PO', 0, 5)

So, if I make this call:

string nextPONbr = ctDynamicsSL.common.getNextCounterAsString("PONBR");

The first time I call it, it will give me a value for nextPONbr

PO00001

The second time I call it, it will give me a value for nextPONbr

PO00002

The one hundredth time I call it, it will give me a value for nextPONbr

PO00100

Catalina Integrator – Catalina’s API Mapping Tool

Catalina Integrator – Catalina’s API Mapping Tool

The Catalina Integrator is a simple ETL tool that allows you to call API’s, transform the data, and send that data to other API’s.

In this demo, we are going to show how you can make a call to one of Catalina’s API’s and totally customize the API output so that you can then send it to another API or have it work for your specific client needs (mobile, web, etc).

This article is summarized in a video demo.  You can view the demo or read the details below. (NOTE:  the video is from a webinar and the capture is pretty poor.  That’s why I did a write-up to follow since most of the screens are barely visible in the video) Continue reading “Catalina Integrator – Catalina’s API Mapping Tool”

Catalina’s Queue Engine

Catalina’s Queue Engine

Catalina has a simple queuing engine that allows you to track changes on any table in SQL server. There is then an API that allows you to retrieve items that have been queued so that you can take action on them.  This is mostly done when you need to send Dynamics SL data, that has changed, to an outside system.

Example: A customer in Dynamics SL is modified in the SL Customer Maintenance Screen. You want to make sure that the customer terms, class, and other information makes it out to Salesforce.com (or other CRM system). Continue reading “Catalina’s Queue Engine”

How to call a custom SQL call using the Catalina API for Dynamics SL

How to call a custom SQL call using the Catalina API for Dynamics SL

How many times have you wanted to just make a SQL call from an app, website, or other system, but you don’t have direct access to a SQL connection or other easy method to call SQL?

Well the Catalina API for Dynamics SL has a secure way for you to make SQL calls over to your SL database using the Catalina common.asmx web service call.

Below is a quick tutorial on how to do this using .NET and the Catalina API for Dynamics SL (SOAP calls) Continue reading “How to call a custom SQL call using the Catalina API for Dynamics SL”