Package com.sforce.soap.metadata

Examples of com.sforce.soap.metadata.CustomObject


     * right now all we want to set is the name.  I assume there will be more things to set later.
     *
     */
    protected void createCustomObjectStub() {
        String apiName = tableImpl.getTableName().getForceApiName();
        customObject = new CustomObject();
        customObject.setFullName(apiName);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Creating custom object: " + apiName);
        }
View Full Code Here


    public static void cleanSchema(ForceManagedConnection mconn) throws Exception {
        PartnerConnection pc = (PartnerConnection) mconn.getConnection();
        ForceSchemaWriter writer = new ForceSchemaWriter(new SchemaDeleteProperty(true, true));
        DescribeGlobalResult objs = pc.describeGlobal();
        for (DescribeGlobalSObjectResult s : objs.getSobjects()) {
            CustomObject co = new CustomObject();
            co.setFullName(s.getName());
            DescribeSObjectResult sobject = pc.describeSObject(s.getName());
            Field[] fields = sobject.getFields();
            List<CustomField> customFields = new ArrayList<CustomField>();
            for (Field f : fields) {
                if (f.isCustom()) {
                    CustomField cf = new CustomField();
                    cf.setFullName(f.getName());
                    if (!s.isCustom()) {
                        if (!customFieldsToKeep.contains((s.getName() + "." + f.getName()).toLowerCase())) {
                            writer.addCustomField(co, cf);
                        }
                    } else {
                        writer.addCustomField(co, cf);
                        customFields.add(cf);
                    }
                }
            }
            if (customFields.size() > 0) {
                co.setFields(customFields.toArray(new CustomField[customFields.size()]));
            }
            if (s.isCustom()) {
                writer.addCustomObject(co, true);
            }
        }
View Full Code Here

TOP

Related Classes of com.sforce.soap.metadata.CustomObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.