web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Create autopost with hyperlink through plugin

(0) ShareShare
ReportReport
Posted on by 570

Hi,

I have a requirement to create auto post with username hyperlink. I need to do it through plugin not OOB workflow.

I could create a post as below

Entity objPost=new Entity("post");

objPost["text"]="some text";

objPost["regardingobjectid"]=new EntityReference("contact",id);

objPost["source"]=new OptionSetValue(1);

service.Create(objPost);

But in text field I should need to show Loggedin username with hyperlink to user record. When I click on the username it should open the user record.

Is it possible to do the hyperlinks in text field from plugin?

Thanks

Bala

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PS Profile Picture
    23,577 on at

    See if it helps: unleashingcrm.wordpress.com/.../hyperlink-in-plugins

  • Suggested answer
    tw0sh3ds Profile Picture
    5,600 on at

    Hi,

    Why don't you just create a post in context of the user that you want (you have something like:

    IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));            

    var service = factory.CreateOrganizationService(this.PluginExecutionContext.UserId);)

    but for that "UserId" you can put whatever userId you want (if the plugin is running on System Admin user).

    After you do that, the post would be created in context of the user, so the user will be displayed as creator of the post and you would be able to click on this username and go to the user record.

    I did not test this myself, but I think it should work

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans