Package com.salesforce.dataloader.client

Examples of com.salesforce.dataloader.client.DescribeRefObject


        ObjectField refField = new ObjectField(refFieldName);
        String relationshipName = refField.getObjectName();
        String fieldName = refField.getFieldName();

        // get object info for the given reference (foreign key) relationship
        DescribeRefObject entityRefInfo = controller.getReferenceDescribes().get(relationshipName);

        // build the reference SObject
        SObject sObjRef = new SObject();
        // set entity type, has to be set before all others
        sObjRef.setType(entityRefInfo.getObjectName());
        // set external id, do type conversion as well
        Class typeClass = SforceDynaBean.getConverterClass(entityRefInfo.getFieldInfoMap().get(fieldName));
        Object extIdValue = ConvertUtils.convert(this.referenceExtIdValue.toString(), typeClass);
        sObjRef.setField(fieldName, extIdValue);
        // Add the sObject reference as a child elemetn, name set to relationshipName
        sObj.addField(relationshipName, sObjRef);
    }
View Full Code Here


            FieldType fieldType = field.getType();
            String relationshipName = field.getRelationshipName();
            if (fieldType == FieldType.reference && field.getReferenceTo().length == 1 &&
                    relationshipName != null && relationshipName.length() > 0) {

                DescribeRefObject refInfo = controller.getReferenceDescribes().get(relationshipName);
                if(refInfo != null) {
                    for(String refFieldName : refInfo.getFieldInfoMap().keySet()) {
                        // property name contains information for mapping
                        dynaProps.add(new DynaProperty(ObjectField.formatAsString(relationshipName, refFieldName),
                                SObjectReference.class));
                    }
                }
View Full Code Here

        extIdData.widthHint = 150;
        extIdCombo.setLayoutData(extIdData);

        // get object's ext id info & set combo box to list of external id fields
        // set the objects reference information
        DescribeRefObject extIdInfo = referenceObjects.get(relationshipName);
        List<String> fieldList = new ArrayList<String>(extIdInfo.getFieldInfoMap().keySet());
        // add default selection "not selected" to the list to allow users to go back to it
        fieldList.add(Labels.getString("ForeignKeyExternalIdPage.defaultComboText"));
        UIUtils.setComboItems(extIdCombo, fieldList, Labels.getString("ForeignKeyExternalIdPage.defaultComboText"));

        extIdSelections.put(relationshipName, extIdCombo);
View Full Code Here

            Combo combo = extIdSelections.get(relationshipName);
            String extIdFieldName = combo.getText();
            // make sure that the item selection has occurred and that the default text is not displayed anymore
            if(extIdFieldName != null && extIdFieldName.length() > 0
                    && ! extIdFieldName.equals(Labels.getString("ForeignKeyExternalIdPage.defaultComboText"))) {
                DescribeRefObject refObjectInfo = referenceObjects.get(relationshipName);
                extIdReferences.put(relationshipName, ObjectField.formatAsString(refObjectInfo.getObjectName(), extIdFieldName));
                relatedFields.put(relationshipName,refObjectInfo.getFieldInfoMap().get(extIdFieldName));
            }
        }

        return relatedFields;
    }
View Full Code Here

TOP

Related Classes of com.salesforce.dataloader.client.DescribeRefObject

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.