Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2018-02-23 04:09 AM
Hi,
I want to create a button by using Custom Object that does the same work as the "Add New" button for a XREF Field.
I tried to do something like this, but I just got the button, and nothing happened when I clicked on it.
<div style="text-align:center;">
<a class="ContentURL" href="javascript:$('#master_DefaultContent_rts_s4182_f20694c_Add_New').click();">
<img src="../BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:+++++AddNew+++++;iconSetStyle:VistaRound;baseColor:%23BFDDF5;disabled:False"/>
</a>
</div>
I don't know how to put the "fieldid" - "refmodid" - "moduleid" in the code.
Could anyone help me With this? Thank you!
/Tuan
GhgcdMq8HwHRCWZuqMwEETnAH3l0sBKt8utOGHAgtsY=
2018-03-08 09:21 AM
Sadly it doesn't work ...
2018-03-08 10:23 AM
Give this one a shot
onclick="$('[id*=f20694c]').find('[id=Lookup]').click();"
Advisory Consultant
2018-03-08 11:35 AM
Still doesn't work ...
2018-03-08 11:57 AM
Odd, this worked fine for me in a custom object.
<a href="#" onclick="$('[id*=f15537c]').find('[id=Lookup]').click();">Lookup</a>
If the field you're referencing isn't visible to the user (hidden by ACL is ok) then the field isn't loaded in the DOM and the script cannot access it.
Advisory Consultant
2018-03-09 07:12 AM
I'll be out of office next week. I'll try when I'm back. Thanks.
2018-03-21 08:52 AM
I have now tested and it works! Thank you
2018-04-06 10:14 AM
David, when I change the XREF field from "Single Column" to "Grid" view, the Custom Object code doesn't work anymore ... What can I do?
2018-04-06 10:18 AM
What I can see is:
- Single Column: s4182_f2694c
- Grid: s4182_ss2694_f2694c
What is "ss" here then?
2018-04-06 10:28 AM
Change it back to grid
Inspect the … (lookup) element and see what changed.
Advisory Consultant
2018-04-12 04:42 AM
Change it back to grid?
What I want is Grid, but the code just works for Single Column