Showing posts with label cast iron. Show all posts
Showing posts with label cast iron. Show all posts

Friday, November 11, 2011

CastIron and your org's schema

I recently built a orchestration to go through our salesforce org and write to a salesforce object all of the object names and labels, field names and label, and field lengths and data types.  The orchestration was pretty easy to build and has been incredibly useful to provide a data dictionary to our business partners.  Its a different way to use castiron and something to consider if you need to do any data mapping or data migration activities.

Here's the recipe:
1 enterprise salesforce wsdl - this is your org's wsdl w/ all of its customizations
1 castiron dev studio
1 custom salesforce object to hold your object name, field names, length, data type, etc

Use the built in CastIron connector to salesforce to log in and use the session id in your subsequent webservice calls (where the enterprise wsdl was used to define the endpoint).  Once you've logged in you should be able to describe all objects, iterate through each object, and grab the details you want.  The last step is a the insert to your custom salesforce object where you map the object and its details.

Wednesday, July 27, 2011

CastIron and Scientific Notation

There is very little public help available online for CastIron orchestration development.  I was asked about this today and wanted to share the resolution.

A colleague observed that when using the Salesforce connector to retrieve an Account record, that the value returned in the AnnualRevenue field was presented in scientific notation.  When I read the email, I couldn't believe it but here is what he saw:


<?xml version="1.0" encoding="UTF-8"?>
- <Accounts>
   - <Account>
        <CrmAccountId>AC240012</CrmAccountId>
        <AccountName>Test 007</AccountName>
        <AccountRecordType>Legal Entity</AccountRecordType>
        <AnnualRevenue>1.0E7</AnnualRevenue>
        <NumberOfEmployees>5000</NumberOfEmployees>
        <Industry/>

Interestingly, he observed that the same SOQL run in Apex explorer yields: 10000000.
 
I setup a simple orchestration to verify this and determine a fix:
1. A polling activity set to 30 seconds
2. A Salesforce query activity to fetch the same Account record

In this screenshot you can see the simple orchestration.  In the verify pane on the right, you can see what is returned from salesforce via the connector.  Scientific notation!

I found that CastIron has some out-of-box formatting that can be applied.  In this case, I used the Number function, which takes any datatype and casts it as a number.  I think passed the output of the function to the Number format function to specify how I wanted to present the number.  In the verify pane, you can see the results: