Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming 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.
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