function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alonmalonm 

ant scripts of "The Developer's Guide to the Force.com Platform" dont work

When i try to run the ant scripts that should initialize my org for the hands-on exercises, they always fail (apart from the one for chapter 3). this is the output i get when i try to initialize for chapter 12 (ant Chapter12):

Buildfile: build.xml

Chapter12:
     [echo] This command will add all the entities you will need for the exercises in Chapter 12 into your target organization.  The target organization is identified by the sf.username and sf.password in the build.properties file.             
     [echo]    
    [input] Press any key to continue . . .

BUILD FAILED
C:\Data\Docs\Tutorials\force.com\The Developer's Guide to the Force.com Platform\DevGuide\build.xml:125: Failures:
objects/Candidate__c.object(Candidate__c):The sharing model cannot be updated through the API currently.
objects/Job_Application__c.object(Job_Application__c):The sharing model cannot be updated through the API currently.
objects/Position__c.object(Position__c):The sharing model cannot be updated through the API currently.
objects/Position_Type__c.object(Position_Type__c.Department__c):Cannot change field type of a custom field referenced in Apex class or trigger: <a href="/01p8000000098R3">positionExtension</a>
reports/Chapter_Six/Open_positions.report(Chapter_Six/Open_positions):In field: Position__c.Open_Position_Date__c - no CustomField named Position__c.Open_Position_Date__c found
reports/Chapter_Six/Open_positions_by_days_since_posted.report(Chapter_Six/Open_positions_by_days_since_posted):In field: Position__c.Days_Since_Posting__c - no CustomField named Position__c.Days_Since_Posting__c found
reports/Chapter_Six/Open_positions_by_department.report(Chapter_Six/Open_positions_by_department):In field: Position__c.Days_Since_Posting__c - no CustomField named Position__c.Days_Since_Posting__c found
layouts/Candidate__c-Candidate Layout.layout(Candidate__c-Candidate Layout):In field: field - no CustomField named Candidate__c.Address__c found
layouts/Location__c-Location Layout.layout(Location__c-Location Layout):Invalid related list:Position__c.Location__c
layouts/Position__c-Non-technical Position Layout.layout(Position__c-Non-technical Position Layout):Field:Name must not be Readonly
layouts/Position__c-Position Layout.layout(Position__c-Position Layout):Field:Name must not be Readonly
workflows/Position__c.workflow(Position__c.Close out position):Invalid literal value for picklist:Closed
workflows/Position__c.workflow(Position__c.Open Position):Invalid literal value for picklist:Open
workflows/Position__c.workflow(Position__c.Set Open Position Date):In field: field - no CustomField named Position__c.Open_Position_Date__c found
workflows/Position__c.workflow(Position__c.Set substatus):In field: field - no CustomField named Position__c.Sub_status__c found
workflows/Position__c.workflow(Position__c.14 Days Later):Picklist value does not exist
workflows/Position__c.workflow(Position__c.Application Notification):Field Number_of_Applications__c does not exist. Check spelling.
workflows/Position__c.workflow(Position__c.Close position):In field: field - no CustomField named Position__c.Number_of_Applications__c found
classes/dataLoadController.cls(109,21):No such column 'Legacy_ID__c' on entity 'Position__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
profiles/Admin.profile(Admin):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/ContractManager.profile(ContractManager):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/Custom%3A Marketing Profile.profile(Custom%3A Marketing Profile):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/Custom%3A Sales Profile.profile(Custom%3A Sales Profile):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/Custom%3A Support Profile.profile(Custom%3A Support Profile):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/CustomerManager.profile(CustomerManager):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/MarketingProfile.profile(MarketingProfile):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/Partner.profile(Partner):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/ReadOnly.profile(ReadOnly):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/SolutionManager.profile(SolutionManager):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/Standard.profile(Standard):In field: recordType - no RecordType named Position__c.Non_technical_position found
profiles/StandardAul.profile(StandardAul):In field: recordType - no RecordType named Position__c.Non_technical_position found
objects/Interview__c.object(Interview__c.Interviewer__c):There is already a field named Interviews on User.


Total time: 21 seconds


I believe the problem is because "The sharing model cannot be updated through the API currently.", but i dont know what this error massage mean and what to do to solve the problem..

thanks,
Alon
JonPJonP

I just successfully ran the Ant scripts in order, starting with InitUsers and continuing through Chapter15.  The only error I encountered was that Chapter6 contains an extra file, "Chapter6/tabs/Initialize_Users.tab", which must be removed before the script will succeed.  After I loaded each chapter, I also ran the corresponding data loading activity (where appropriate).

 

Answering these questions will help us diagnose your issue:

 

1. What kind of Salesforce organization are you using?  A Developer Edition account created around October/November or later?  Does your organization have the "Force.com" app installed?

 

2. What are your sharing model settings?  You can find this under Setup | Administration Setup | Security Controls | Sharing Settings.

 

 

The "sharing model cannot be updated through the API" error message reflects a limitation in the Metadata API as of Winter '09 which prevents you from changing the sharing model on a custom object in a Metadata API deploy (the command used by the Ant tool).  You can create a new Custom Object with any sharing model, but you cannot change it later via the Metadata API.

 

Adding a Master-Detail relationship field to an object implicitly sets it sharing rules to be inherited from the Master object.  Depending on the sharing settings on the object before you add the Master-Detail relationship, this may or may not actually be a change the Metadata API can't handle.

 

So changing your sharing settings on Position__c, Candidate__c, and/or Job_Application__c may resolve this issue.  Or it may be best to just delete these objects and let the Chapter12 script recreate them.  (Note that deleting an object will delete any of its records too.)

 

Jon

 

alonmalonm

Hi Jon,

Thanks for answering.

I changed the sharing model of all related objects to "Public Read/Write" and this removed most error massages. But now I have this error massage, when I try to run "ant Chapter3CanJA" ("ant Chapter3" worked, as before):

BUILD FAILED

C:\Data\Docs\TUTORI~1\force.com\THEDEV~1.COM\DevGuide\build.xml:24: Failures:
objects/Candidate__c.object(Candidate__c.Legacy_ID__c):reached maximum number of indexes allowed for custom fields
classes/dataLoadController.cls(122,24):Invalid field Legacy_ID__c for SObject Position__c
pages/addData.page(addData):Unknown method 'dataLoadController.loadCandidateData()'
 

What does this error massage mean?..

 

jesperfjjesperfj
You can have a maximum of 3 external ID fields on an object. You would get this error message if you're trying to exceed the number of external ID fields.