Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features: Dynamics 365 Sales in 2023 release wave 1
Stay informed with the latest D365 Sales features in our latest blog posts: Manage opportunities more effectively with the new sales pipeline view
2023 Release Wave 1Check out the latest updates and new features of Dynamics 365 released from April 2023 through September 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | All TechTalks
I have an ID which I get from the opportunity field. This is ID: (19-20-Opp5-00036), now I want to remove the highlighted part from this Opportunity ID. How to achieve it using C#
Try this one:
string opportunityId = opportunityId.Replace("-Opp5", "");
As Pravin mentioned you can use Replace() method to achieve this.
delete substring in string giving that substring?forum=csharpgeneral
Please mark as verified if this was helpful.
You can use the substring function to get part of the string in c# e.g oppfield.substring(5,5)
syntax - public string Substring(int startIndex, int length)
if it is always going to be formatted as shown and split by - u should write a generic code using split() and then choose the remove the value in the 2nd index. this will work irrespective of the data in the third section and irrespective of the length of the data in other sections.
Business Applications communities