Notifications
Announcements
No record found.
Is it possible to add new record in custom entity based on Contact create in MSCRM.
Don't want to use Plugin/Workflow.
Please suggest me.
*This post is locked for comments
Hi Ashish,
You can use sdk.rest library to create a record from java script.
var objectValues= new Object();
objectValues.<fieldName>=value;
SDK.REST.createRecord(objectValues, "<EntityName>", callBackFuction, function (error) { alert(error.message); });
Hi Ashish Manatkar,
please get information of following links;
https://migsbeja.wordpress.com/2015/05/14/change-lookup-text-originating-lead-field/
http://snipplr.com/view/70031/
These links tells that how to get and set value. I would like to create new record from the javascript in the custom entity based on create operation of contact record
You can write script on contact save and call your script to create custom entity record. you can look for OData designer to write your query, Or Can use SDK library for the same as suggested.
Thanks
please take following information to create a new record over lookup field.
https://blogs.msdn.microsoft.com/crm/2013/12/03/whats-new-in-the-lookup-control-with-microsoft-dynamics-crm-2013/
Necdet, I would like to create a new record using javascript only on the creation of new contact records
You can create new record of custom entity using OData & Jquery.
As per your requirement, you can set the script "onsave" of contact entity.
Check the following link:
lakshmanindian.wordpress.com/.../create-record-using-jscript-in-microsoft-dynamics-crm-2011
andreaswijayablog.blogspot.in/.../crm-2011-jquery-odata-rest-endpoints.html
Odata query designer download link:
dynamicsxrmtools.codeplex.com
Hope this help out.
Maybe you can do it like this:
OnSave of the Contact you have to do this code (you need to change the entity name and field to match what you desire).
This uses the XrmServiceToolkit.js to help with the create/update (and more) functions.
//Create Entity var entity = new XrmServiceToolkit.Soap.BusinessEntity("EntityName"); //String entity.attributes["fieldName"] = Xrm.Page.getAttribute("fieldName").getValue(); //Lookup entity.attributes['fieldName'] = { id : Xrm.Page.getAttribute('fieldName').getValue()[0].id, logicalName : Xrm.Page.getAttribute('fieldName').getValue()[0].entityType, type : 'EntityReference' }; //Bool entity.attributes["fieldName"] = Xrm.Page.getAttribute("fieldName").getValue(); //OptionSetValue entity.attributes["fieldName"] = { value: Xrm.Page.getAttribute("fieldName").getValue(), type: "OptionSetValue" }; //Currency entity.attributes["fieldName"] = { Value: Xrm.Page.data.entity.attributes.get("fieldName").getValue() }; //Decimal entity.attributes["fieldName"] = { Value: parseFloat(eval(Xrm.Page.data.entity.attributes.get("fieldName").getValue())) }; var quoteId; quoteId = XrmServiceToolkit.Soap.Create(entity);
You can find this and how to update entity in: https://migsbeja.wordpress.com/2015/02/07/createupdate-entity-using-xrmservicetoolkit-soap/
Best Regards,
Miguel
I have client name
A , B , C , D
A - installed my solution
B - Installed my solution
c - installed my solution
D - Installed my solution
then i have given webresource page . (just contact info page )
All client are filled the form .
When A (client ) login into their CRM and open my solution which they installed .whatever contact info A filled which i need to pre populate .
When B (client ) login into their CRM and open my solution which they installed .whatever contact info B filled which i need to pre populate .
When A=C (client ) login into their CRM and open my solution which they installed .whatever contact info C filled which i need to pre populate .
Question : -
if i know any unique id of client only i can query my db and per populate the field . How can i find the unique id of the client ?
since my solution is third party to them . they will install the solution only . what logic should i implement to get unique id of that client ?
Same logic i should apply into getting data also to entity which question i asked previously .
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2