@Override public void setSObjectField(String field, Object value) { setField(field, value); } }
Map<String, String> relationMap = referenceFieldsMap.get(se.name()); String lookupRelationshipFieldName = relationMap.get("lookupRelationshipFieldName"); so.setField(lookupRelationshipFieldName, null); so.getChild(lookupRelationshipFieldName).setField("type", relationMap.get("lookupFieldModuleName"));
Map<String, String> relationMap = referenceFieldsMap.get(se.name()); String lookupRelationshipFieldName = relationMap.get("lookupRelationshipFieldName"); so.setField(lookupRelationshipFieldName, null); so.getChild(lookupRelationshipFieldName).setField("type", relationMap.get("lookupFieldModuleName"));
@Override public void setId(String Id) { setField("Id", Id); }
Map<String, String> relationMap = referenceFieldsMap.get(se.name()); String lookupRelationshipFieldName = relationMap.get("lookupRelationshipFieldName"); so.setField(lookupRelationshipFieldName, null); so.getChild(lookupRelationshipFieldName).setField("type", relationMap.get("lookupFieldModuleName"));
@Override public void setType(String type) { setField("type", type); }
private SObject buildUpdatedObject(String id) { final SObject obj = new SObject(); obj.setId(id); obj.setType(getTable().getName()); final Object[] values = getValues(); final Column[] columns = getColumns(); final boolean[] explicitNulls = getExplicitNulls(); final List<String> nullFields = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { final Object value = values[i]; final Column column = columns[i]; if (value == null) { if (explicitNulls[i]) { nullFields.add(column.getName()); } } else { obj.setField(column.getName(), value); } } obj.setFieldsToNull(nullFields.toArray(new String[nullFields.size()])); return obj; }
/** * Retrieves the Force.com object (SObject) for this {@code ForceInsertFieldManager}. * * @param appendExternalId flag indicating if an external id should be added to * the Force.com object (SObject) if none exists * @return the Force.com object (SObject) for this {@code ForceInsertFieldManager} */ public SObject getSObject(boolean appendExternalId) { if (appendExternalId) { if (table.getExternalIdColumn() != null) { String name = table.getExternalIdColumn().getFieldName(); if (sobject.getField(name) == null) { sobject.setField(name, "" + System.nanoTime() + PART_B.nextInt()); } } } return sobject; }
private SObject buildUpdatedObject(String id) { final SObject obj = new SObject(); obj.setId(id); obj.setType(getTable().getName()); final Object[] values = getValues(); final Column[] columns = getColumns(); final boolean[] explicitNulls = getExplicitNulls(); final List<String> nullFields = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { final Object value = values[i]; final Column column = columns[i]; if (value == null) { if (explicitNulls[i]) { nullFields.add(column.getName()); } } else { obj.setField(column.getName(), value); } } obj.setFieldsToNull(nullFields.toArray(new String[nullFields.size()])); return obj; }
/** * Retrieves the Force.com object (SObject) for this {@code ForceInsertFieldManager}. * * @param appendExternalId flag indicating if an external id should be added to * the Force.com object (SObject) if none exists * @return the Force.com object (SObject) for this {@code ForceInsertFieldManager} */ public SObject getSObject(boolean appendExternalId) { if (appendExternalId) { if (table.getExternalIdColumn() != null) { String name = table.getExternalIdColumn().getFieldName(); if (sobject.getField(name) == null) { sobject.setField(name, "" + System.nanoTime() + PART_B.nextInt()); } } } return sobject; }
private SObject buildUpdatedObject(String id) { final SObject obj = new SObject(); obj.setId(id); obj.setType(getTable().getName()); final Object[] values = getValues(); final Column[] columns = getColumns(); final boolean[] explicitNulls = getExplicitNulls(); final List<String> nullFields = new ArrayList<String>(); for (int i = 0; i < columns.length; i++) { final Object value = values[i]; final Column column = columns[i]; if (value == null) { if (explicitNulls[i]) { nullFields.add(column.getName()); } } else { obj.setField(column.getName(), value); } } obj.setFieldsToNull(nullFields.toArray(new String[nullFields.size()])); return obj; }
@Override public void execute() throws BuildException { try { PartnerConnection pc = ConnectionFactory.getPartnerConnection(getConfig()); Set<String> propertyDescriptions = new HashSet<String>(); SObject record = new SObject(); record.setType(objectApiName); for (Property p : properties) { record.setField(p.getName(), p.getValue()); String description = String.format(PROPERTY_DESCRIPTION_FORMAT, p.getName(), p.getValue()); propertyDescriptions.add(description); } SaveResult[] results = null; try { results = pc.create(new SObject[] {record}); processResult(results); log(String.format(SUCCESS_LOG_FORMAT, objectApiName, StringUtils.join(propertyDescriptions, ", "))); } catch (InvalidSObjectFault e) { handleException(e); } catch (Exception e) { handleException(e); } } catch (ConnectionException e) { handleException(e); } catch (Exception e) { handleException(e); } }
@Override public void execute() throws MetaModelException { final Object[] values = getValues(); final Column[] columns = getColumns(); final boolean[] explicitNulls = getExplicitNulls(); final List<String> nullFields = new ArrayList<String>(); final SObject obj = new SObject(); obj.setType(getTable().getName()); for (int i = 0; i < values.length; i++) { final Object value = values[i]; final Column column = columns[i]; if (value == null) { if (explicitNulls[i]) { nullFields.add(column.getName()); } } else { obj.setField(column.getName(), value); } } obj.setFieldsToNull(nullFields.toArray(new String[nullFields.size()])); final SalesforceUpdateCallback updateCallback = getUpdateCallback(); updateCallback.insert(obj); }
@Override public void execute() throws MetaModelException { final Object[] values = getValues(); final Column[] columns = getColumns(); final boolean[] explicitNulls = getExplicitNulls(); final List<String> nullFields = new ArrayList<String>(); final SObject obj = new SObject(); obj.setType(getTable().getName()); for (int i = 0; i < values.length; i++) { final Object value = values[i]; final Column column = columns[i]; if (value == null) { if (explicitNulls[i]) { nullFields.add(column.getName()); } } else { obj.setField(column.getName(), value); } } obj.setFieldsToNull(nullFields.toArray(new String[nullFields.size()])); final SalesforceUpdateCallback updateCallback = getUpdateCallback(); updateCallback.insert(obj); }
/** * {@inheritDoc} */ public void send(String message) { SObject user = new SObject(); user.setType("User"); try { user.setId(connection.getUserInfo().getUserId()); user.setField("CurrentStatus", message); SaveResult[] results = connection.update(new SObject[]{user}); if (!results[0].isSuccess()) { l.error("Error updating user status: " + results[0].getErrors()[0].getMessage()); throw new SfdcException("Error updating user status: " + results[0].getErrors()[0].getMessage()); } } catch (ConnectionException e) { l.debug("Error sending the SFDC chatter message.", e); throw new SfdcException("Error sending the SFDC chatter message.", e); } }
@Override public void execute() throws MetaModelException { final Object[] values = getValues(); final Column[] columns = getColumns(); final boolean[] explicitNulls = getExplicitNulls(); final List<String> nullFields = new ArrayList<String>(); final SObject obj = new SObject(); obj.setType(getTable().getName()); for (int i = 0; i < values.length; i++) { final Object value = values[i]; final Column column = columns[i]; if (value == null) { if (explicitNulls[i]) { nullFields.add(column.getName()); } } else { obj.setField(column.getName(), value); } } obj.setFieldsToNull(nullFields.toArray(new String[nullFields.size()])); final SalesforceUpdateCallback updateCallback = getUpdateCallback(); updateCallback.insert(obj); }
obj.setType("ApexTestQueueItem"); obj.setId(sObject.getId()); obj.setField("status", "Aborted"); updateResult[i++] = obj;
parentRef.setField(parent.getExternalIdColumn().getFieldName(), parentSObject.getField(parent.getExternalIdColumn().getFieldName())); actualValue = parentRef;
parentRef.setField(parent.getExternalIdColumn().getFieldName(), parentSObject.getField(parent.getExternalIdColumn().getFieldName())); actualValue = parentRef;