-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Microsoft Dynamics - new sources #18882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
55 changes: 55 additions & 0 deletions
55
...rosoft_dynamics_365_sales/sources/account-ownership-changed/account-ownership-changed.mjs
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import common from "../common/common.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "microsoft_dynamics_365_sales-account-ownership-changed", | ||
| name: "Account Ownership Changed", | ||
|
Check warning on line 6 in components/microsoft_dynamics_365_sales/sources/account-ownership-changed/account-ownership-changed.mjs
|
||
| description: "Emit new event when the ownership of an account changes.", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| methods: { | ||
| ...common.methods, | ||
| _getOwnershipIds() { | ||
| return this.db.get("ownershipIds") || {}; | ||
| }, | ||
| _setOwnershipIds(ownershipIds) { | ||
| this.db.set("ownershipIds", ownershipIds); | ||
| }, | ||
| getResourceFn() { | ||
| return this.microsoftDynamics365Sales.listAccounts; | ||
| }, | ||
| getArgs() { | ||
| return { | ||
| params: { | ||
| "$orderby": "modifiedon desc", | ||
| }, | ||
| }; | ||
| }, | ||
| getTsField() { | ||
| return "modifiedon"; | ||
| }, | ||
| getRelevantResults(results) { | ||
| const ownershipIds = this._getOwnershipIds(); | ||
| const relevantResults = []; | ||
| for (const result of results) { | ||
| if (ownershipIds[result.accountid] !== result._ownerid_value) { | ||
| if (ownershipIds[result.accountid]) { | ||
| relevantResults.push(result); | ||
| } | ||
| ownershipIds[result.accountid] = result._ownerid_value; | ||
| } | ||
| } | ||
| this._setOwnershipIds(ownershipIds); | ||
| return relevantResults; | ||
| }, | ||
| generateMeta(account) { | ||
| const ts = Date.parse(account.modifiedon); | ||
| return { | ||
| id: `${account.accountid}${ts}`, | ||
| summary: `Account Ownership Changed: ${account.name}`, | ||
| ts, | ||
| }; | ||
| }, | ||
| }, | ||
| }; | ||
55 changes: 55 additions & 0 deletions
55
...ts/microsoft_dynamics_365_sales/sources/account-status-changed/account-status-changed.mjs
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import common from "../common/common.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "microsoft_dynamics_365_sales-account-status-changed", | ||
| name: "Account Status Changed", | ||
| description: "Emit new event when an account is activated or deactivated.", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| methods: { | ||
| ...common.methods, | ||
| _getStatuses() { | ||
| return this.db.get("statuses") || {}; | ||
| }, | ||
| _setStatuses(statuses) { | ||
| this.db.set("statuses", statuses); | ||
| }, | ||
| getResourceFn() { | ||
| return this.microsoftDynamics365Sales.listAccounts; | ||
| }, | ||
| getArgs() { | ||
| return { | ||
| params: { | ||
| "$orderby": "modifiedon desc", | ||
| }, | ||
| }; | ||
| }, | ||
| getTsField() { | ||
| return "modifiedon"; | ||
| }, | ||
| getRelevantResults(results) { | ||
| const statuses = this._getStatuses(); | ||
| const relevantResults = []; | ||
| for (const result of results) { | ||
| if (statuses[result.accountid] !== result.statuscode) { | ||
| if (statuses[result.accountid]) { | ||
| relevantResults.push(result); | ||
| } | ||
| statuses[result.accountid] = result.statuscode; | ||
| } | ||
| } | ||
| this._setStatuses(statuses); | ||
| return relevantResults; | ||
| }, | ||
| generateMeta(account) { | ||
| const ts = Date.parse(account.modifiedon); | ||
| return { | ||
| id: `${account.accountid}${ts}`, | ||
| summary: `Account Status Changed: ${account.name}`, | ||
| ts, | ||
| }; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
56 changes: 56 additions & 0 deletions
56
...icrosoft_dynamics_365_sales/sources/contact-added-to-account/contact-added-to-account.mjs
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import common from "../common/common.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "microsoft_dynamics_365_sales-contact-added-to-account", | ||
| name: "Contact Added to Account", | ||
|
Check warning on line 6 in components/microsoft_dynamics_365_sales/sources/contact-added-to-account/contact-added-to-account.mjs
|
||
| description: "Emit new event when a contact is added to an account.", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| props: { | ||
| ...common.props, | ||
| accountId: { | ||
| propDefinition: [ | ||
| common.props.microsoftDynamics365Sales, | ||
| "accountId", | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| ...common.methods, | ||
| getResourceFn() { | ||
| return this.microsoftDynamics365Sales.listAccounts; | ||
| }, | ||
| getArgs() { | ||
| return { | ||
| params: { | ||
| "$filter": `accountid eq ${this.accountId}`, | ||
| "$expand": "contact_customer_accounts", | ||
| }, | ||
| }; | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| getTsField() { | ||
| return "modifiedon"; | ||
| }, | ||
| getRelevantResults(results) { | ||
| const relevantResults = []; | ||
| const account = results[0]; | ||
| account.contact_customer_accounts.forEach((contact) => { | ||
| relevantResults.push({ | ||
| ...contact, | ||
| addedToAccountOn: account.modifiedon, | ||
| }); | ||
| }); | ||
| return relevantResults; | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| generateMeta(contact) { | ||
| const ts = Date.parse(contact.addedToAccountOn); | ||
| return { | ||
| id: `${contact.contactid}${ts}`, | ||
| summary: `Contact Added to Account: ${contact.fullname}`, | ||
| ts, | ||
| }; | ||
| }, | ||
| }, | ||
| }; | ||
45 changes: 45 additions & 0 deletions
45
...onents/microsoft_dynamics_365_sales/sources/new-account-activity/new-account-activity.mjs
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import common from "../common/common.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "microsoft_dynamics_365_sales-new-account-activity", | ||
| name: "New Account Activity", | ||
| description: "Emit new event when a new task or activity is created for an account.", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| props: { | ||
| ...common.props, | ||
| accountId: { | ||
| propDefinition: [ | ||
| common.props.microsoftDynamics365Sales, | ||
| "accountId", | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| ...common.methods, | ||
| getResourceFn() { | ||
| return this.microsoftDynamics365Sales.listActivityPointers; | ||
| }, | ||
| getArgs() { | ||
| return { | ||
| params: { | ||
| "$orderby": "createdon desc", | ||
| "$filter": `_regardingobjectid_value eq ${this.accountId}`, | ||
| }, | ||
| }; | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| getTsField() { | ||
| return "createdon"; | ||
| }, | ||
| generateMeta(activity) { | ||
| const ts = Date.parse(activity.createdon); | ||
| return { | ||
| id: `${activity.accountid}${ts}`, | ||
| summary: `New Account Activity: ${activity.subject}`, | ||
| ts, | ||
| }; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
34 changes: 34 additions & 0 deletions
34
components/microsoft_dynamics_365_sales/sources/new-account-created/new-account-created.mjs
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import common from "../common/common.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "microsoft_dynamics_365_sales-new-account-created", | ||
| name: "New Account Created", | ||
| description: "Emit new event when a new account is created.", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| methods: { | ||
| ...common.methods, | ||
| getResourceFn() { | ||
| return this.microsoftDynamics365Sales.listAccounts; | ||
| }, | ||
| getArgs() { | ||
| return { | ||
| params: { | ||
| "$orderby": "createdon desc", | ||
| }, | ||
| }; | ||
| }, | ||
| getTsField() { | ||
| return "createdon"; | ||
| }, | ||
| generateMeta(account) { | ||
| return { | ||
| id: account.accountid, | ||
| summary: `New Account: ${account.name}`, | ||
| ts: Date.parse(account.createdon), | ||
| }; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.