Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object - Close Button

syedtahir16
Advocate

I'm trying to create a custom object to close the record

 

<a class="tb-btn-link-left" id="CloseRecord" onclick="javascript:__doPostBack('', 'recordClose');" data-check-dirty="true"><div class="tb-btn" data-icon="&#xe366;" data-icon-pos="left">Close</div></a> 

 

Issue:

Click on Add new record: key in a few of the fields then click on Close record. The record closes fine. Now when I navigate to another workspace, it shows a popup warning that I have unsaved changes.

 

Same happens when i make a change to an existing record.

24 REPLIES 24

Is this way ok?  Is the syntax acceptable?  I tried your suggestion, and it worked very well.  I am only trying to make it look a little more refined in the UI.  This allows me to center the button and comes out nicely:

<script>
function closeRecord() {
var mEvent = document.createEvent("MouseEvents");
mEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
var closeBtn = document.getElementsByClassName("frame-icon-close")[0];
closeBtn.dispatchEvent(mEvent);
}
</script>

<div style="text-align:center;"><img src="../BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Close and Go Back;iconSetStyle:VistaRound;baseColor:%23DDDDDD;disabled:False" onclick="javascript:closeRecord();"></div>

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

And then to that, I also added this to hide all of the standard buttons (because I have this notice on its own tab that is not set as default and is hidden in a default layout; it is only when the rule applies that all other content and tabs are hidden and this notice section is the only thing that appears):

<script type="text/javascript"> 
Sys.Application.add_load(function() {
$('#master_btnAdd').css('display', 'none');
$('#master_btnCopy').css('display', 'none');
$('#master_btnApply').css('display', 'none');
$('#master_btnDelete').css('display', 'none');
$('#master_btnSave').css('display', 'none');
$('#master_btnView').css('display', 'none');
});
</script>

 

The "fancy" result :

 

pastedImage_2.png

PremRajani
Collaborator II

Hi David/Ilya,

Apologies for bringing this up, but the close click function doesn't work in 6.13 version. When we click on x button, it reloads the record again.

Thanks,

Prem

DavidPetty
Archer Employee
Archer Employee

@PremRajani if you don't have any custom objects in the application you'll need to open a suppor ticket.

If there are custom objects in the application remove them from layout and see if the issue is still there.

 Advisory Consultant

Hi David,

No other custom object is available in application. Tried all the solutions provided and it reloads the record again.

Thanks,

Prem

Best to open a support ticket on this issue.

 Advisory Consultant