Breaking news from around the world
Get the Bing + MSN extension
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2019 release wave 2 Discover the latest updates and new features to Dynamics 365 planned through March 2020
Release overview guides and videos Release Plan | View virtual launch event
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