TimeCardPostService Class
Overview
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.
postTimeCards(List<Time_Card__c>)
Post one or many TimeCard records
Signature
global static List<PostResult> postTimeCards(List<Time_Card__c> timeCards)
Parameters
Type: [List<Time_Card__c>
]
Return Value
Type: List<PostResult>
unpostTimeCards(List<Time_Card__c>)
Unpost one or many TimeCard records
Signature
global static List<PostResult> unpostTimeCards(List<Time_Card__c> amortizationEntries)
Parameters
Type: [List<Time_Card__c>
]
Return Value
Type: List<PostResult>
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.