Jump to content
DesiLogi

JS getting last not current value from cascading dropdown virtual field

Recommended Posts

Hello,

I have some code running in the footer of an Update datapage that on change of one virtual field (Virtual 4: drop down) gets the value of another virtual field (Virtual 7: cascading text, with Virtual 4 as the ParentID) and copies that value of Virtual 7 into a text64000 field.  The problem is it keeps getting the 'previous' value of Virtual 7 and not the current one, when Virtual 4 is updated.  Meaning the code runs the 'copy' function BEFORE Virtual 7 is updated. I need to get the 'updated' data from Virtual 7 and copy that into the text64000 field. 

The code I'm using is: 

$("[name='cbParamVirtual4']").change(function(){
  
  f_copy_print_address('cbParamVirtual7', 'cke_EditRecordShipToAddress');
   
});
 

So if there's some way to 'refresh' or 'update' Virtual 7 before the f_copy_print_address code runs that'd be great. Many thanks!

Share this post


Link to post
Share on other sites

Have you tried to fire the script when the cascading element changes?

$("[name='cbParamVirtual7']").change(function(){
  
  f_copy_print_address('cbParamVirtual7', 'cke_EditRecordShipToAddress');
   
});

Share this post


Link to post
Share on other sites

Hi Douvega,

Thanks for the tip- I had tried firing the script on the change for the element and still had the same issue. I ended up changing the overall process and datapage for what I was doing and got a solution that way. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...