• rfisher000
  • NEWBIE
  • 50 Points
  • Member since 2008

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 18
    Replies

We are moving API web services into SFDC to a more appropriate location on our network.  In the process, we are having to open up the firewall for the endpoint for these services.  Our network admins are configuring this based on IP (and not by URL).  I have seen a number of regex answers for doing this against the URL but none by IP.  My concern is the range of possible endpoints that SFDC will send back in the LoginResult.  I would hate to add these IPs to the pile as they are encountered.

(Currently the firewall is not an issue, which is why it is not an appropriate location.)

 

I have not been able to find anything for this issue in the vast SFDC docs.  Surely we are not the only one to encounter this.  Any ideas?

(asking the network admins to do it different is not an acceptable option)

I'm trying to update parent/child relationships between Account objects and I am getting the following error.

 

Child Accounts cannot be "Parent" Account Record Type (Additional Information Section Below). - FIELD_CUSTOM_VALIDATION_EXCEPTION

 

Not finding a lot on this error message (in whole or in part).

Anyone have any ideas?

 

For what its worth here is a code snipet and a brief explanation.

I'm iterating thru a list of companies on my local system.

I'm querying the child account and then the parent account in SF.

If the value int he child account is wrong, I attempt to set the ParentID and update the object.

 

FileLogger.debug(",SyncParentChild"); AssignmentRuleHeader arh = new AssignmentRuleHeader(); MruHeader mruh = new MruHeader(); AllowFieldTruncationHeader afth = new AllowFieldTruncationHeader(); DebuggingHeader dh = new DebuggingHeader(); EmailHeader eh = new EmailHeader(); DebuggingInfoHolder dih = new DebuggingInfoHolder(); SaveResult[] results = new SaveResult[1]; results[0] = new SaveResult(); QueryResult qr = null; QueryOptions qo = new QueryOptions(); Account parentAccount = new Account(); Account account = new Account(); arh.setUseDefaultRule(false); dh.setDebugLevel(DebugLevel.Db); Collection companyProfiles = (Collection)session.executeQuery("findAllCompanyProfileChildren", CompanyProfile.class, "130#7"); for (Iterator itr = companyProfiles.iterator(); itr.hasNext(); ) { companyProfile = (CompanyProfile)itr.next(); FileLogger.debug(companyProfile.getCustomerEntity() + ",UpdateParentChild = " + companyProfile.getOwnerEntity()); try { checkSforceSession(); qr = sforce_port.query("SELECT Id, ParentId FROM Account WHERE Customer_ID__c = '" + companyProfile.getCustomerEntity() + "'", sh, qo, mruh, pvh); } catch (ApiQueryFault e) { ApiQueryFaultHandler(e); } catch (ApiFault e) { ApiFaultHandler(e); } account = new Account(); if (qr.getSize() == 1) { account = (Account)qr.getRecords()[0]; } else if (qr.getSize() == 0) { FileLogger.warn(companyProfile.getCustomerEntity() + ",[SF] Unable to locate this Account to establish Parent account"); } else if (qr.getSize() > 1) { FileLogger.warn(companyProfile.getCustomerEntity() + ",[SF] Located multiple Accounts with this ID when establishing Parent account"); } try { checkSforceSession(); qr = sforce_port.query("SELECT Id FROM Account WHERE Customer_ID__c = '" + companyProfile.getOwnerEntity() + "'", sh, qo, mruh, pvh); } catch (ApiQueryFault e) { ApiQueryFaultHandler(e); } catch (ApiFault e) { ApiFaultHandler(e); } parentAccount = new Account(); if (qr.getSize() == 1) { parentAccount = (Account)qr.getRecords()[0]; FileLogger.debug(companyProfile.getCustomerEntity() +",Child is " + account.getId() ); FileLogger.debug(companyProfile.getCustomerEntity() +",Child has " + account.getParentId() + " Parent is" + parentAccount.getId()); if ((parentAccount.getId() != null) && ((account.getParentId() == null) || (account.getParentId().compareTo(parentAccount.getId())) != 0)) { account.setParentId(parentAccount.getId()); try { checkSforceSession(); results = sforce_port.update(new SObject[] { account }, sh, arh, mruh, afth, dh, pvh, eh, dih); for (SaveResult result: results) { if (!result.isSuccess()) { for (Error err: result.getErrors()) { FileLogger.warn(companyProfile.getCustomerEntity() + ",[SF] The Parent Account Update failed because: " + err.getMessage() + " - " + err.getStatusCode()); } } } } catch (ApiQueryFault e) { ApiQueryFaultHandler(e); } catch (ApiFault e) { ApiFaultHandler(e); } } } else if (qr.getSize() == 0) { FileLogger.warn(companyProfile.getOwnerEntity() + ",[SF] Unable to locate this Parent Account when establishing Parent account"); } else if (qr.getSize() > 1) { FileLogger.warn(companyProfile.getOwnerEntity() + ",[SF] Located multiple Parent Accounts with this ID when establishing Parent account"); } }

 

We would like to customize the pagelayout to allow for a graphic or character on a set of fields (standard & customer).

 

SF is not our system of record and we sync data up to SF from our native appliaciton.  We would like to denote to our users which fields in SF are populated form our in house application. 

 

Any idea how we could facilitate?

Currently we have a custom field on the Account object, called Client ID, that is has External ID checked in its definition.

During a resent upload, thru the API and via an UPSERT that refernces this field, one of the Accounts did and INSERT when it should have UPDATEd. (resulting in two records with the same value in Client ID)

 

1) Any idea what would cause this?

 

I've requested to my SF Admin to make that a "Unique" field as well, but he replied:

"The client ID field on the Account object is an “external ID” field and doesn’t allow duplicate values"

That field is a bit confusing because of the comments on the screen: 

 

Unique - Do not allow duplicate values
 

 

External ID - Set this field as the unique record identifier from an external system
 

 

2) Does the "Unique" checkbox do anything extra when a field is already and External ID. 

 

We've added a checkbox to the Contact object and we are trying to set the checkbox through an existing call thru the API.  It seems no matter what value is set (true or false) the checkbox always saves as checked.  Whats the trick to getting this to work in Java?

 

Any issues in Java I'm not seeing?  (I ask this beuase I have seen posts for .NET with an extra step)

 

We are moving API web services into SFDC to a more appropriate location on our network.  In the process, we are having to open up the firewall for the endpoint for these services.  Our network admins are configuring this based on IP (and not by URL).  I have seen a number of regex answers for doing this against the URL but none by IP.  My concern is the range of possible endpoints that SFDC will send back in the LoginResult.  I would hate to add these IPs to the pile as they are encountered.

(Currently the firewall is not an issue, which is why it is not an appropriate location.)

 

I have not been able to find anything for this issue in the vast SFDC docs.  Surely we are not the only one to encounter this.  Any ideas?

(asking the network admins to do it different is not an acceptable option)

I'm trying to update parent/child relationships between Account objects and I am getting the following error.

 

Child Accounts cannot be "Parent" Account Record Type (Additional Information Section Below). - FIELD_CUSTOM_VALIDATION_EXCEPTION

 

Not finding a lot on this error message (in whole or in part).

Anyone have any ideas?

 

For what its worth here is a code snipet and a brief explanation.

I'm iterating thru a list of companies on my local system.

I'm querying the child account and then the parent account in SF.

If the value int he child account is wrong, I attempt to set the ParentID and update the object.

 

FileLogger.debug(",SyncParentChild"); AssignmentRuleHeader arh = new AssignmentRuleHeader(); MruHeader mruh = new MruHeader(); AllowFieldTruncationHeader afth = new AllowFieldTruncationHeader(); DebuggingHeader dh = new DebuggingHeader(); EmailHeader eh = new EmailHeader(); DebuggingInfoHolder dih = new DebuggingInfoHolder(); SaveResult[] results = new SaveResult[1]; results[0] = new SaveResult(); QueryResult qr = null; QueryOptions qo = new QueryOptions(); Account parentAccount = new Account(); Account account = new Account(); arh.setUseDefaultRule(false); dh.setDebugLevel(DebugLevel.Db); Collection companyProfiles = (Collection)session.executeQuery("findAllCompanyProfileChildren", CompanyProfile.class, "130#7"); for (Iterator itr = companyProfiles.iterator(); itr.hasNext(); ) { companyProfile = (CompanyProfile)itr.next(); FileLogger.debug(companyProfile.getCustomerEntity() + ",UpdateParentChild = " + companyProfile.getOwnerEntity()); try { checkSforceSession(); qr = sforce_port.query("SELECT Id, ParentId FROM Account WHERE Customer_ID__c = '" + companyProfile.getCustomerEntity() + "'", sh, qo, mruh, pvh); } catch (ApiQueryFault e) { ApiQueryFaultHandler(e); } catch (ApiFault e) { ApiFaultHandler(e); } account = new Account(); if (qr.getSize() == 1) { account = (Account)qr.getRecords()[0]; } else if (qr.getSize() == 0) { FileLogger.warn(companyProfile.getCustomerEntity() + ",[SF] Unable to locate this Account to establish Parent account"); } else if (qr.getSize() > 1) { FileLogger.warn(companyProfile.getCustomerEntity() + ",[SF] Located multiple Accounts with this ID when establishing Parent account"); } try { checkSforceSession(); qr = sforce_port.query("SELECT Id FROM Account WHERE Customer_ID__c = '" + companyProfile.getOwnerEntity() + "'", sh, qo, mruh, pvh); } catch (ApiQueryFault e) { ApiQueryFaultHandler(e); } catch (ApiFault e) { ApiFaultHandler(e); } parentAccount = new Account(); if (qr.getSize() == 1) { parentAccount = (Account)qr.getRecords()[0]; FileLogger.debug(companyProfile.getCustomerEntity() +",Child is " + account.getId() ); FileLogger.debug(companyProfile.getCustomerEntity() +",Child has " + account.getParentId() + " Parent is" + parentAccount.getId()); if ((parentAccount.getId() != null) && ((account.getParentId() == null) || (account.getParentId().compareTo(parentAccount.getId())) != 0)) { account.setParentId(parentAccount.getId()); try { checkSforceSession(); results = sforce_port.update(new SObject[] { account }, sh, arh, mruh, afth, dh, pvh, eh, dih); for (SaveResult result: results) { if (!result.isSuccess()) { for (Error err: result.getErrors()) { FileLogger.warn(companyProfile.getCustomerEntity() + ",[SF] The Parent Account Update failed because: " + err.getMessage() + " - " + err.getStatusCode()); } } } } catch (ApiQueryFault e) { ApiQueryFaultHandler(e); } catch (ApiFault e) { ApiFaultHandler(e); } } } else if (qr.getSize() == 0) { FileLogger.warn(companyProfile.getOwnerEntity() + ",[SF] Unable to locate this Parent Account when establishing Parent account"); } else if (qr.getSize() > 1) { FileLogger.warn(companyProfile.getOwnerEntity() + ",[SF] Located multiple Parent Accounts with this ID when establishing Parent account"); } }

 

It is possible in a view eliminate default salesforce.com functionalities like edit ,new,delete button and page layout also (ie this thing are related to custom object).

  • June 29, 2009
  • Like
  • 0

We would like to customize the pagelayout to allow for a graphic or character on a set of fields (standard & customer).

 

SF is not our system of record and we sync data up to SF from our native appliaciton.  We would like to denote to our users which fields in SF are populated form our in house application. 

 

Any idea how we could facilitate?

Currently we have a custom field on the Account object, called Client ID, that is has External ID checked in its definition.

During a resent upload, thru the API and via an UPSERT that refernces this field, one of the Accounts did and INSERT when it should have UPDATEd. (resulting in two records with the same value in Client ID)

 

1) Any idea what would cause this?

 

I've requested to my SF Admin to make that a "Unique" field as well, but he replied:

"The client ID field on the Account object is an “external ID” field and doesn’t allow duplicate values"

That field is a bit confusing because of the comments on the screen: 

 

Unique - Do not allow duplicate values
 

 

External ID - Set this field as the unique record identifier from an external system
 

 

2) Does the "Unique" checkbox do anything extra when a field is already and External ID. 

 

I'm a newbie taking my very first steps, so please bear with me :)

 

Note: (I'm using the enterprise WSDL file)

 

We've created some custom fields for Leads, for example:

 

Field Label: Customer ID
Object Name: Lead
Field Name: Customer_ID
Data Type: Text
API Name: Customer_ID__c

 

 

I need to periodically update these values using the API (in Java).

 

How do I update custom fields?

 

I was looking for something like:

 

SObject[] leads = new Lead[1];
Lead lead = new Lead();
Lead oldLead = _leads[oldLeadId];
lead.setId(oldLead.getId());

// and here's where I got stuck since I was expecting something like

lead.setCustomField("Customer_ID__c",newValue);

// or something like:

lead.setCustomer_ID__c(newValue);

 


 

I spent the last couple of hours searching the documentation and the web and couldn't figure this out.

 

I'm sure it's so simple that I'll feel a little stupid once I get it... :)

 

Thanks for the help! 

Message Edited by pidrus on 06-26-2009 10:25 AM

Hi!

 

I have a Java application that logd in fine to the production account, but I'd like to have it connect to the sandbox account for testing purposes.

 

I have:

 

1. changed the username by appending the sandbox name at the end

2. made sure the password is correct

3. re-generated the security token and appended it at the end of the password

4. re-generated the WSDL file and replaced the production WSDL with the sandbox one

 

However, I'm still getting this error.

 

Searching this forum, I found:

 

http://community.salesforce.com/sforce/board/message?board.id=JAVA_development&message.id=4885&query.id=64302#M4885

 

But that didn't help either.

 

My gut feeling tells me the production WSDL was somehow cached.

 

So:

 

1. Does anyone know how to force re-cache or alternatively disable caching all together? (I found some PHP code for that but not for Java)?

 

2. Does anyone have another idea on how to approach this problem.

 

I'm a senior developer but a newbie to both Java and SalesForce, so please explain slowly using simple words... :)

 

Thank!

 

Ilan.

We've added a checkbox to the Contact object and we are trying to set the checkbox through an existing call thru the API.  It seems no matter what value is set (true or false) the checkbox always saves as checked.  Whats the trick to getting this to work in Java?

 

Any issues in Java I'm not seeing?  (I ask this beuase I have seen posts for .NET with an extra step)