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)

get webResource in plugin

(0) ShareShare
ReportReport
Posted on by 395

Hi,

I what to get one of my webResource in the plugin.

There any way to do it?

If not maybe someone has any idea to solve my problem:

I am in one entity. and on save I want to create a record of another entity.

But in the another entity I have a look up to my first entity.

My problem is: that when I want to put the one entity's guide in the look up -

his value is null. ( because that it happened on save ).

I will be happy to hear answers to this problem.

thanks!!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    Create your entity record in post plugin (you won't get id in pre create) , so that you will have ID of your first entity and you can set it to the child entity.

    Thanks

  • NAOMI314 Profile Picture
    395 on at

    thanks!

    But how can I get the webResource in the plugin?

    And the second part in my question refers to java Script not to plugin.

    ( I'm sorry I did not mention it )

    thanks!

  • Suggested answer
    JayeshAC Profile Picture
    1,157 on at

    Hi,

    Why do you need to add webresource in plugin??

    Instead of that create a plugin which will get trigged on saving of your 1st entity (use Message as 'CREATE' while creating the plugin step).

    Write a code in plugin which will create new record in another entity.

    check out this link for creation of plugin and its step.

    crmbusiness.wordpress.com/.../crm-2013-step-by-step-update-plugin-tutorial-using-the-crm-2013-development-toolkit

    Hope this helps to u....

  • Suggested answer
    ShahXu Profile Picture
    1,515 on at

    For me u dont have to write any plugin just use javascript and do it.

    while saving the record just get all the values and save them on that entity you want to do. and u can easily get the current guid on form.

  • NAOMI314 Profile Picture
    395 on at

    thanks!

    I don't need to add webresource. I need to get my webresource from the form.

    And I need to get it because that I have fields in html webresource,

    and depending them  I create records ( onSave ).

    thanks!

  • NAOMI314 Profile Picture
    395 on at

    Shahzeb Dogar thanks!

    How can I get the guid on save in javaScript? -

    The guid get value only after the record created (and it happens only after save) ?

    thanks!

  • Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    In Java script you won't get ID in case of save, And to access any field which is under your html web resource you can use java script. You may need to redesign your approach based on the requirement.

  • Suggested answer
    ShahXu Profile Picture
    1,515 on at

    make a global variable with the name of Check set it false initially in javascript and onsave event update it from true to false.

    then write a code onLoad event the if that variable is true and form type is != 1 then get the guid

    sample code

    var formType = Xrm.Page.ui.getFormType();

       if (formType != 1 & Check == True) {

           var Id = Xrm.Page.data.entity.getId();

    }

  • Verified answer
    ShahXu Profile Picture
    1,515 on at

    i hope you will get the logic which i'm trying to explain.

    please let me know if u gets any other problem

  • Shirsagr Profile Picture
    502 on at

    Below link show how to load xml webresource in a plugin,

    ankit.inkeysolutions.com/.../read-configuration-file-web-resource.html

    Hope this helps

    for other issue,

    lets take example of Account & Contact

    Account is parent of Contact i.e Contact entity has lookup field of Account

    Now in this case,

    first create account entity gets its guid then create contact entity with parent account

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