How to update the field of a Parent enity (field is not visibe on the Form) from a Child Entity in MSCRM 2013

Hi All,
          I m new to CRM customization. I have requirement like this..
I have 3 entities.. Entity1 , Entity 2 and Entity3.
Entity1 is the parent of Entity2 and Entity3. Entity2 is the parent of Entity3 and child of Entity1 ..
In Entity1 I have a field eg:product1 which acts as lookup for Entity2 field availableproducts.  Now in Entity2 I have a field the quantity of products which acts as lookup for Entity3 as given below.
In Entity3: fields:;; products==Lookup of Products(Entity1)
                              quantity == Lookup of Quantity (Entity2)
Now from Entity3 I need to update the fields of Entity1 like I have field named Price which is not visible on the Entity3 Form  but when I access this field from javascript I m getting null exceptions since the field is not in the context of the Entity
on which it is defined. How can I update the fields of the Parent Entity1 from child Entity3  and also update the quantity field on Entity2 which are not avialable on the Entity3 Form.
Any help is appreciated
Waiting for the reply..
FayazSyed

Hi,
To do it in JS you need to use oData, as wrote above:
to make this requests easer, i use a XrmSvcToolkit library (https://xrmsvctoolkit.codeplex.com/)
Your code will be about this:
/// <reference path="rtb_XrmSvcToolkit.js" />
XrmSvcToolkit.retrieve({
entityName: "Entity1",
id: Xrm.Page.getAttribute("quantity").getValue()[0].id,
select: ["my_FieldNeedToUpdate"], //Here are the name of your fields, which you want to select.
expand: [""],
async: false,
successCallback: function (result) {
FieldNeedToUpdate= result.my_FieldNeedToUpdate;
errorCallback: function (error) {
Error = error;
FieldNeedToUpdate = FieldNeedToUpdate + 1; //Doing some work here
var InputEntity =
my_FieldNeedToUpdate: FieldNeedToUpdate //here are fields, witch you want to update
XrmSvcToolkit.updateRecord({
entityName: "Entity1",
id: Xrm.Page.getAttribute("quantity").getValue()[0].id,
entity: InputEntity ,
async: false
Here are more samples:
https://xrmsvctoolkit.codeplex.com/SourceControl/latest#Samples/XrvSvcToolkit.Samples.updateRecord.js

Similar Messages

  • How to update zero to a column value when record does not exist in table but should display the column value when it exists in table?

    Hello Everyone,
    How to update zero to a column value when record does not exist in table  but should display the column value when it exists in table
    Regards
    Regards Gautam S

    As per my understanding...
    You Would like to see this 
    Code:
    SELECT COALESCE(Salary,0) from Employee;
    Regards
    Shivaprasad S
    Please mark as answer if helpful
    Shiv

  • Field ZZBUDAT is delta-relevant, but does not exist in the field list

    Hi All,
    I have created a Generic DataSource on a View.Now there is a situation ,i need to add a Date field form some other table.
    So i have enhanced the datasource now that date is coming in my datasource.
    But when i tried to make delta on that date field its showing error-
    Field ZZBUDAT is delta-relevant, but does not exist in the field list
    Message no. R8279
    Diagnosis
    The DataSource uses field ZZBUDAT for specifying the delta. In the DataSource field list, however, the field does not occur
    Now how i can make this field dalta relevant?
    Thanks,
    Piyush

    Piyush,
    I think the message in SAP is quite clear....
    If the field ZZBUDAT does not exist in the view ... how do you expect the datasource to know which records have changed...?
    The delta relevant field SHOULD be in the view - else there is no way the extractor can identify the changed records ...
    Please remember that the Generic extractor is a simple select statement with a where clause on the delta relevant field and nothing else ... if you want the changed on field to come from another table - then you need to write a function module extractor to do this...
    The order of processing is that - the view fields are processed first - then the enhanced fields are processed followed by the user exits...

  • Why am I now receiving the error 42404: a required iTunes component is not installed after the 10.5.3 iTunes update? Now, I cannot sync my iphone...

    Why am I now receiving the error 42404: a required iTunes component is not installed after the 10.5.3 iTunes update? Now, I cannot sync my iphone...I have uninstalled and re-installed several times now without any luck.
    Thanks,

    'The installer has insufficient privileges to modify this file C:\Program Files (x86)\Common Files\Apple\Apple Application Support\Web kit.resources\inspector\Images\Spinner Inactive Selected.gif.'
    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • I am concerned about the health of my current computer but have not yet made the commitment to a new one, but: 1) How can I transfer my iTunes account to a new computer when I get one... and 2) What can I do if my current computer suddenly implodes and I

    I am a bit of a computer/Internet/iTunes dummy....
    I am concerned about the health of my current computer but have not yet made the commitment to a new one, but:
    1) How can I transfer my iTunes account to a new computer when I get one...
    and
    2) What can I do if my current computer suddenly implodes and I have not yet 'copied/'saved'/otherwise protected my account, as is? -- I have already had my computer crash once and had one of your people help me restore all of the paid for songs (none of the uploaded from my own collection of CD songs, of course, so I had to spend a long time rebuilding that) -- and I believe I was told you could only help me recover that material one or two times altogether, no?
    WithOUT purchasing a Mach or iCloud (I actually think I have one of the later, but rarely have checked it) account, is there anything I can do to responsibly protect my account?
    Thanks for any time taken on this!!!

    These are two possible approaches that will normally work to move an existing library to a new computer.
    Method 1
    Backup the library with this User Tip.
    Deauthorize the old computer if you no longer want to access protected content on it.
    Restore the backup to your new computer using the same tool used to back it up.
    Keep your backup up-to-date in future.
    Method 2
    Connect the two computers to the same network. Share your <User's Music> folder from the old computer and copy the entire iTunes library folder into the <User's Music> folder on the new one. Again, deauthorize the old computer if no longer required.
    Both methods should give the new computer a working clone of the library that was on the old one. As far as iTunes is concerned this is still the "home" library for your devices so you shouldn't have any issues with iTunes wanting to erase and reload.
    I'd recommend method 1 since it establishes an ongoing backup for your library.
    Note if you have iOS devices and haven't moved your contacts and calendar items across then you should create one dummy entry of each in your new profile and iTunes should  merge the existing data from the device.
    If your media folder has been split out from the main iTunes folder you may need to do some preparatory work to make it easier to move. See make a split library portable.
    Should you be in the unfortunate position where you are no longer able to access your original library or a backup then then see Recover your iTunes library from your iPod or iOS device for advice on how to set up your devices with a new library with the maximum preservation of data.
    tt2

  • I am running Windows 7 (64bit) , and an error message appears following a recent update to iTunes v 11.1.2:  "iTunes could not connect to the iTunes store. An unknown error occured (-3212). Make sure your network connection is active and try again." help!

    I am running Windows 7 (64bit) , and an error message appears following a recent update to iTunes v 11.1.2:  "iTunes could not connect to the iTunes store. An unknown error occured (-3212). Make sure your network connection is active and try again." I have dug a little bit into possible problems but haven't found a solution yet, one note is that the network connection is OK. A response would be highly appreciated!  Thanks in advance.

    Hi c1r1g1,
    If you are having an issue connecting to the iTunes Store, you may find the following article helpful:
    Apple Support: Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Regards,
    - Brenden

  • How do I download Premier Pro in cc? It is not listed in the apps list.

    How do I download Premier Pro in cc? It is not listed in the apps list.

    What Mark said...
    Adobe's MINimums http://www.adobe.com/products/premiere/tech-specs.html
    -Programs won't display if they will not install on your computer
    -http://helpx.adobe.com/creative-cloud/kb/all-apps-displayed-aam.html

  • I have a Cracked Back on my iPhone 4. How much is it to fix? Its Accidental damage therefore not Covered by the 1Year warranty.. :(

    I have a Cracked Back on my iPhone 4. How much is it to fix? Its Accidental damage therefore not Covered by the 1Year warranty..
    I have looked around the site seem to be getting back onto the same page.
    also does anyone know what the bluetooth does on iphones I cant seem to use it to connect to people on iphones, Same with Printing pictures It doesnt Allow bluetooth to send them its searches for an 'AitPrinter' ?! What is an air printer, lady in the Apple Shop didnt seem to know.

    Out-of-Warranty Service
    If you own an iPhone that is ineligible for warranty service but is eligible for Out-of-Warranty (OOW) Service, Apple will service your iPhone for the Out-of-Warranty Service fee listed below.
    iPhone model
    Out-of-Warranty Service
    iPhone 4S
    $199
    iPhone 4, iPhone 3GS,
    iPhone 3G, Original iPhone
    $149
    http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipho ne

  • Hi i haven't updated my iDVD seen 2005 and to get the new one i need 7.0.4 first and i downloaded it from the apple website and when i go into the updating process its says "An eligible iDVD application was not found in the location /Applications." why"

    Hi i haven't updated my iDVD seen 2005 and to get the new one i need 7.0.4 first and i downloaded it from the apple website and when i go into the updating process its says "An eligible iDVD application was not found in the location /Applications." why

    Because you need to buy iLife 08 or newer on DVD first. If you're using iDVD 05, you probably have a PowerPC Mac and can't use iLife 11.
    (69573)

  • How do I force the player to open in the center of my screen every time, and not way on the side?

    How do I force the player to open in the center of my screen every time, and not way on the side?

    Solution is very simple, Just choose firefox as your default browser.
    Follow these steps :
    * Open '''Options'''
    * Click on '''Advanced'''
    * Now open '''General''' tab and click on '''Make FireFox The Default Browser'''. See Image below.

  • I can't update my iPod software because it says I am not connected to the internet. I am clearly connected to the internet though. Any thoughts?

    I can't update my iPod software because it says I am not connected to the internet. I am clearly connected to the internet though. Any thoughts?

    Did you make sure that your security software is not blocking the contact to Apple servers? iTunes for Windows: Troubleshooting security software issues

  • How can I export to a .sfw file? it does not give me the option in FILE EXPORT.

    how can I export to a .sfw file? it does not give me the option in FILE > EXPORT. I have Flash installed and everthing.

    The feature to export SWF files directly from After Effects has been removed. It never worked at all well.
    To create SWF files, use Flash Professional.
    If you want to play a movie that you've created in After Effects in a SWF container, then export your composition using Adobe Media Encoder in H.264 format and then link or embed that movie into a SWF file in Flash Professional.

  • Hi, how to load mac without running windows (bootcamp)? The problem is this: the last time i ran the windows, but he hangs and died (can not run further  the logo). now i can not load not windows, not maс! how to be, what to do???

    The problem is this: the last time i ran the windows, but he hangs and died (can not run further  the logo). now i can not load not windows, not maс! how to be, what to do???

    can any body help me, plz!!

  • How do i finish a download that was already started and not finished because the library closed befo

    how do i finish a download that was already started and not finished because the library closed before it done

    What are you trying to download and how were you downloading it?

  • I'v got the latest macbook pro 13" and it dose not come with the lion os disk so how do i get the boot camp drivers for windows 7 without an os disk

    i'v got the latest macbook pro 13" and it dose not come with the lion os disk so how do i get the boot camp drivers for windows 7 without an os disk

    Page 5, step 2, #2, 2nd bullet.
    http://manuals.info.apple.com/en/Boot_Camp_Install-Setup_10.7.pdf

Maybe you are looking for

  • [JTree]Block event?

    Hello, I've got a problem. In fact, i have a JFrame with on the left a JTree and on the right some JEditorPane and 3 JButton (New, Save, Cancel). When I clic on a JTree's Node, my JEditorPane are updated with desirated info. |-------------------|----

  • Subject: Trouble in Multi-Select LOV. Does not populate records in Base Pag

    Hi Friends, I am trying to use multi-select LOV for the first time. But the base page table does not get populated after the rows are selected in the LOV. I am initializing the Base Page VO like below. And all fields are mapped between both the VO's,

  • Can Not Sign In to FaceTime - states check network connection and try again - but network is fine.

    I repeatedly keep getting notified: Could Not Sign In. Please check network connection and try again. When trying to log into FaceTime. Also note that click FaceTime on bar that Preferences is not highlighted by light gray. I can log into my apple ID

  • Error: A duplicate file name was specifice

    I am getting this message now when synchronizing my iPad to my Win7 x64 computer. I haven't been able to locate a solution. Can anyone assist?

  • Can't see citadel databases on Win7 64-bit

    Hello. I have a local TCP/IP network, and I run a DB on citadel 5 (In a "server" station). I added a new station with win-64 bit. I Installed LV 11 DSC module. The databases are seen in the MAX, but I cannot see the libraries inside the libraries. Th