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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

AdxStudio Javascript to create Entities

(0) ShareShare
ReportReport
Posted on by 5

Hi All,

Relatively new to AdxStudio Portals and have a question regarding entity creation. 

I'm looking to populate and create entities from a block of javascript code I have written that makes calls to an external API. The user has the option to take the retrieved data and select 1 or many values. If a user selects many values, how would I go about creating an entity for every selected value? I know if it was only possible to select 1 entity I'd just populate a web form...but is there a way to loop the entity creation somehow?

I apologize if this doesn't make sense. I can elaborate further if needed.

Many thanks,

G

*This post is locked for comments

I have the same question (0)
  • Gizmotep Profile Picture
    5 on at

    Shameless bump for attention!

  • Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    Hi Gizmotep,

    Your requirement is quite confusing. Could you please elaborate it further?

    Few queries regarding your requirement is:

    Do you want to create an Entity in CRM or the Records of that Entity?

    What information, you are pulling through External API?

    How the user is selecting the retrieved data, pulling through External API?

    Sorry for asking so much queries, I can help you out once I will have the clear understanding of your requirement.  It would be great if you can explain your complete scenario.

    Cheers

    Arpit

  • Gizmotep Profile Picture
    5 on at

    Hi Arpit,

    The goal of this page is to create records of that entity.

    The information is pulled from an external search API. Users enter what they want to search using text fields on the page, and the API is queried using the terms entered by the user on button click.

    The data is retrieved from the API and displayed via AJAX in a list of checkboxes. The goal is to create records using what is selected by the user in the list of checkboxes.

    So the user will click say...3 entries within the list, and hit "Submit" and have 3 records be created with the data retrieved from the API.

    Hopefully that makes sense,

    Regards,

    G

  • Syed Ibrahim Profile Picture
    6,257 on at

    Are you trying to create the multiple records in crm upon selection of the options (like multiselect optionset) of data from the external API records displayed on the page?

  • Gizmotep Profile Picture
    5 on at

    Yes! Exactly this!

  • Suggested answer
    Syed Ibrahim Profile Picture
    6,257 on at

    You have to write query to create records in CRM from the portal. You need to add the code to your we template to create the records. You need to do similar like below in your web template.

    msdn.microsoft.com/.../gg334427(v=crm.7).aspx

    Hope this helps

  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    Hello Gizmotep,

    There is no direct way except Entity Form to create a record in CRM from Portal.

    Couple of option I can suggest you are:

    Option 1.

    If you are having your own hosting environment like Azure, then you can write your own custom code to retrieve the data from external API and can create it in CRM through Portal. For this, you need to host your code on Azure and can call it inside the CRM Portal.

    Option 2.

    • Create one Entity and Put one Multiline Text field in it. Expose its Form on Portal as an Entity Form. Now associate this Entity Form with one Portal Web page. Keep this whole Entity Form (Multiline text Field and Submit button) hidden using javascript so that user will not able to see the same.
    • Now write a code (under Custom Javascript or Edit HTML section or using Liquid Template) on the same webpage to call the External API and display its results. 
    • Now based on the selection of records, generate an XML and put it inside the Multiline text field. 
    • Put one custom button on the page, and on click of that button, trigger click on OOB Submit button of Entity Form.
    • Once clicked, the record will get created in CRM with XML in the multiline text field.
    • Now. write a plugin on the creation of that entity, that will read the XML, parse it and will create the records in CRM.


    If found useful, please mark the answer as verified.


    Cheers
    Arpit
    https://arpitmscrmhunt.blogspot.com

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans