The following provides information regarding posting API calls for Time Card Posting:
Time Card Post Considerations
You cannot call post method with more than 1,000 Time Cards. If you need to post or un-post more than 1,000 Time Cards you will need to call the class static method from a class which implements the Apex batchable interface.
TimeCardPostService Post Methods
The following are the global methods for the TimeCardPostService class. All methods are instance methods.
Post one or many TimeCard records
global static List<PostResult> postTimeCards(List<Time_Card__c> timeCards)
Unpost one or many TimeCard records
global static List<PostResult> unpostTimeCards(List<Time_Card__c> amortizationEntries)
Time Card Post Error Codes
The following error codes are supported for TimeCardPostService:
- LINE_COUNT_LIMIT_EXCEEDED - You cannot post more than 1000 time card days in a post request. You must post a smaller number of time card records..
- CLOSED_ACCOUNTING_PERIOD - accounting period associated with the Time Card is closed.
- ALREADY_POSTED - record is already posted you are attempting to post.
- STATUS_NOT_APPROVED - record attempting to post has a status not equal to approved.
- ALREADY_UNPOSTED - record you are attempting to unpost is not posted.
- NO_LABOR_CONTROL_ACCOUNT_DEFINED_HELP_TEXT - Labor Clearing GL Account has not been defined in Accounting Settings.
- NO_TASK_EXPENSE_GL_ACCOUNT_DEFINED_HELP_TEXT - Expense GL Account has not been defined on the Project Task.
- ONLY_ACTUAL_TIME_CARD_ALLOW_HEADER - Only Actual Time Card Allowed.