-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update activity in CRM https://eaflood.atlassian.net/browse/IWTF-4401 Update activity in CRM
- Loading branch information
1 parent
ba4d1da
commit 29130b3
Showing
2 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,26 @@ export const createActivity = (contactId, season) => { | |
|
||
return dynamicsClient.executeUnboundAction('defra_CreateRCRActivity', request) | ||
} | ||
|
||
/** | ||
* Updates an RCR Activity in Microsoft Dynamics CRM. | ||
* | ||
* @param {string} contactId - The ID of the contact associated with the activity. | ||
* @param {number} season - The season year for which the activity is being created. | ||
* @returns {Promise<Object>} - A promise that resolves to the response from Dynamics CRM. | ||
* @property {string} [email protected] - The OData context URL of the response. | ||
* @property {string} response.RCRActivityId - The unique identifier of the created RCR activity. | ||
* @property {string} response.ReturnStatus - The status of the activity creation operation (e.g., 'success'). | ||
* @property {string} response.SuccessMessage - A message indicating successful creation of the activity. | ||
* @property {string|null} response.ErrorMessage - An error message if the activity creation failed, otherwise null. | ||
* @property {string} response.oDataContext - The OData context URL of the response. | ||
*/ | ||
export const updateActivity = (contactId, season) => { | ||
const request = { | ||
ContactId: contactId, | ||
ActivityStatus: 'SUBMITTED', | ||
Season: season | ||
} | ||
|
||
return dynamicsClient.executeUnboundAction('defra_UpdateRCRActivity', request) | ||
} |