The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Call slx web Action from javascript function
Posted: 29 Jan 07 3:19 PM
|
fiogf49gjkf0d Is it possible to call an slx action from a javascript function? I have appended the add contact to assign to popup a window to assign a role. The code is at the bottom of post. I have modified the template 'oppaddconsrchret'. This page is never visible to the end user. I added the popup window to allow the user to chose a contact role. I added the contact role alias to the hidden fields and it works great. Now I have a custom table I must create a record in at the same time. I tried adding aliases to the hidden fields, but the insert doesn't happen.
I am thinking I may need to code the insert which I am ok with. Also wondering if I could just put the action in the body of the html, or maybe call it from javascript. I am setting my oppid in the init() function, copying what slx did. Better yet perhaps I am doing something wrong with the hidden fields to cause the update to fail. Any advice appreciated. thanks
<script language="Javascript">
</script>
<form name="mainform" action="<#SYSTEMFIELD name=swcpath>/action?name=oppaddcon" method="POST"> <input type="hidden" name="oppconconid" value="<#F name=conid>" /> <input type="hidden" name="oppcontitle" value="<#F name=contitle>" /> <input type="hidden" name="oppconpri" value="<#F name=conprimary>" /> <input type="hidden" name="nextpage" value="closedlg" /> <input type="hidden" name="oppconoppid" value="" /> <input type="hidden" name="conaccid" value="<#F name=conaccid>" /> <input type="hidden" name="conrole" value="" /> <input type="hidden" name="c_acct_ass_accountid" value="<#F name=conaccid>" /> <input type="hidden" name="c_acct_ass_contactid" value="<#F name=conid>" /> <input type="hidden" name="c_acct_ass_oppid" value="" /> </form>
|
|
|
|
Re: Call slx web Action from javascript function
Posted: 31 Jan 07 3:00 AM
|
fiogf49gjkf0d Yes:
<#INCLUDE type=action name=actionname>
within the action you can use RequestGetValue("postedvariablename") to pick up values posted to the screen....
You can put the action anywhere on your page - just be aware that the action will run before the page has even loaded (ie the rest of the page will wait until the action has finished processing.) |
|
|
|
Re: Call slx web Action from javascript function
Posted: 31 Jan 07 8:54 AM
|
fiogf49gjkf0d Thanks Nick. I had ended up trying it in the body of the page and worked great. Thanks for the further info - I wasn't sure when if fired - inline or before/during page load as you indicate. |
|
|
| |
|