Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Duplicate subscription events are getting fired automatically

(1) ShareShare
ReportReport
Posted on by 26
HI All,
 
We are doing BC to salesforce integration. So whenever an item is created in BC through subscription API we are trying to push to SF , so subscripted to items table.
 
The problem is in the otems card when ever I add anythng in the field BC automatically saving the record and firing the event.
 
Suppose say if am entering the Product name as /Test/
 
then one event is firing for /T/ and one for /E/ and so on. But I dont want this kind of behaviour as it will increase the complexity. Once all the fields are entered then only I need the subscription event to be fired. And below is one request
 
/value/: [
{
/subscriptionId/: /1758e0fe5c66448c823480ae5a86da1a/,
/clientState/: /RegisterCustomers/,
/expirationDateTime/: /2024-02-26T21:47:18Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/customers(acb3aed2-e34f-ed11-bfc3-001dd8b71ebf)/,
/changeType/: /updated/,
/lastModifiedDateTime/: /2024-02-26T11:17:17.373Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(dd48b68e-93d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /created/,
/lastModifiedDateTime/: /2024-02-26T10:41:12.507Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(dd48b68e-93d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /updated/,
/lastModifiedDateTime/: /2024-02-26T10:42:00.747Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(dd48b68e-93d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /deleted/,
/lastModifiedDateTime/: /2024-02-26T10:42:28.97Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(b808aeca-93d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /created/,
/lastModifiedDateTime/: /2024-02-26T10:42:59.63Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(b808aeca-93d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /updated/,
/lastModifiedDateTime/: /2024-02-26T10:43:03.213Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(b808aeca-93d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /deleted/,
/lastModifiedDateTime/: /2024-02-26T10:44:32Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(05313410-95d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /created/,
/lastModifiedDateTime/: /2024-02-26T10:52:05.5Z/
},
{
/subscriptionId/: /f3abab4af53c4210a170dfe234a7a37b/,
/clientState/: /CreateProductsInSF/,
/expirationDateTime/: /2024-02-27T18:00:31Z/,
/resource/: /api/v2.0/companies(1909e69c-24f3-ec11-bfb0-001dd8b71ebf)/items(05313410-95d4-ee11-bfdf-001dd8b71ebf)/,
/changeType/: /deleted/,
/lastModifiedDateTime/: /2024-02-26T11:26:18.597Z/
}
]
}
 
 
Is there any way to resolve this ?
  • Community member Profile Picture
    Community member 17 on at
    Duplicate subscription events are getting fired automatically
    Hi,
     
    I just subscribed through
     
     
    I am not sure how to acheive with the below answer you gave. Can you guide me how to put that code into BC?
     
    Thanks
    V S
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,115 Super User 2024 Season 2 on at
    Duplicate subscription events are getting fired automatically
    Which event did you subscribe to? For example, if the OnAfterModifyEvent of the table is used, this problem should not occur.
     
    Hope this helps.
    Thanks.
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans