Announcements
Hi,I have found many sample to create data in dynamics crm from a custom aspx page, but i need to update entity data.any sample will be helpful.
Thanks
*This post is locked for comments
in the aspx page you will create an iorganizationservice and using this you can CRUD - Create, Retrieve, Update, Delete
I would look at the CRM SDK, there are examples in there and it will teach and was as give you sample code
www.microsoft.com/.../details.aspx
this blog is useful
blogs.msdn.com/.../how-to-create-a-simple-webpage-leveraging-the-crm-2011-iorganizationservice-web-service.aspx
this forum post will help
social.microsoft.com/.../how-to-update-recordcrm-2011-through-aspnet
Thanks for the replay, but my problem is how to get the GUID of the record in the email, let me explain my scenario :
I have a custom entity with field named Approval, when data created a workflow is fired to send email to the approve to approve this data, the customer want from the email approve the Data without accessing to the CRM but he is a CRM user, that's why i want to insert in the email a link to web page (pop-up) that show him only too option (Accept or Reject) and then Update the entity attribute.
if you are creating the link, why don't you put the guid in the link and pass it to your apsx page as an url parameter.
I tried but the problem is in "create Email" in the Workflow Dynamic Value, we have just the full Record URL, how to get just the guid to put it in the link as parameter
I can get the guid as parameters from the url, and i tried the code below but i get error :
string smsguidurl = Request.QueryString["id"].ToString(); Guid smsguid = new Guid(smsguidurl);ColumnSet attributes = new ColumnSet(new string[] { "new_testapp" }); Entity retrievedsms = service.Retrieve("new_smsmessage", smsguid, attributes); retrievedsms["new_testapp"] = "Approved"; service.Update(retrievedsms);
what is the error you are getting?
I think you need code like this
retrievedsms .Attributes["Approved"] = "Approved";
is the new_testapp field a string? if it's an optionset the code won't work and you need to set an optionset
you would need something like this
OptionListValue = new OptionSetValue((int)parsedValue)
new_testapp is a string just for testing the update after that i'll work with option set, the error is below :
[FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14543410
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
Microsoft.Xrm.Sdk.IOrganizationService.Retrieve(String entityName, Guid id, ColumnSet columnSet) +0
Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveCore(String entityName, Guid id, ColumnSet columnSet) +989
Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Retrieve(String entityName, Guid id, ColumnSet columnSet) +37
Approval.btnClick_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\SMSApprove\Approval.aspx.cs:41
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
however using
i get the same error
have you been to run any service.update from your apsx page.
does this line
Entity retrievedsms = service.Retrieve("new_smsmessage", smsguid, attributes);
bring back a valid entity with the variable assigned values.
no i didn't execute any service.update from my aspx
actually i'm not really developer, i'm crm functional but i get to achieve this with aspx page and trying to resolve it.
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.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
ScottDurow 2
GJones 1