Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Objects And You

DavidPetty
Archer Employee
Archer Employee

Welcome to my little space in the corner on Link dedicated to custom objects in Archer,  Archer Custom Objects Forum - Archer Community

With this little community I plan on writing documents on various aspects to custom objects along with sample code and how they work within Archer to add a little bit of flair to your applications.

I'll start this off with a little background on what custom objects are.

What are Custom Objects

Custom objects is a layout object that allows you add HTML and JavaScript to an application.  With custom objects you can use them to manipulate an application to perform actions that cannot be done with calculate fields or Rules/Actions (DDEs).  Custom object can implemented based on the state of the record; meaning that it could only run if the record is in View mode, Edit mode or both View and Edit mode and it executes with the same permissions as the user has that's viewing/editing the record.

With custom objects you could perform the following:

  • Placing a button that could save the record, aside from the Save or Save and Close buttons located in the toolbar or set a values list, text, record permissions, date, numeric field.
  • Hide the various buttons in the toolbar by default or based on conditions in the record.
  • Populate fields with data by default or based on conditions in the record.
  • Hide the Add New/Lookup links for cross-references and sub-form fields.
  • For more advanced custom objects you can:
    • Use the REST or Web Services APIs to create or update records, initiate data feeds.
    • Call external APIs to pull data in.  Just be careful in that custom objects are stored in the browser as clear text and if you provide any credentials in the custom object the user could if savvy enough can find it. 

There are some concerns with custom objects to be aware of especially when it comes reading or updating fields in an application or questionnaire.  Archer uses the "field id" when it comes referencing fields in an application or questionnaire and these id's are specific to the environment.  So when you move an application or questionnaire to another environment the field id's will most likely be different and you would have to update those field id's each time you install a package.

 

if_warning_48_10375.png
  • Custom objects are limited just to the application/questionnaire meaning that they cannot be displayed in reports or notifications.
  • All field interactions (reading/update) must be on the layout but can be hidden with Apply Conditional Layout action.  With private fields the custom objects has the same access as the user.
  • Fields that are in a tab set that's not set as default are not accessible by custom objects.

 Advisory Consultant

78 REPLIES 78

DavidPetty
Archer Employee
Archer Employee

Hi, @ArianLivolsi

The button ids were changes in 6.9 master_btnSave is renamed to master_btnApply1.

 Advisory Consultant

ArianLivolsi
Contributor III

@DavidPetty Thank you so much for your help, it's solved now.

Thanks for replying so fast!

ArunBabuKunnat1
Contributor III

Hi @DavidPetty 

We have a custom object which works fine in 6.5. It is working fine in 6.9 also but the color of the custom object button is not displaying in 6.9. 

'%238BC197' is the part in the below code which provides a light green color to the custom object button. In 6.9 it is displayed without any color. I tried changing it to some other colors which is available under color codes in archer. But it is not showing any color. Could you please suggest how to fix it?

<div style="text-align:center;"><img src="../BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Copy/ Refresh;iconSetStyle:VistaRound;baseColor:%238BC197;disabled:false" onclick="SaveandTrigger3();"></div>

 

Thanks

Arun

 

DavidPetty
Archer Employee
Archer Employee

@ArunBabuKunnat1, not sure what's causing the problem and/or can be a defect in the BackgroundImageGenerator.axd.

You could use this which matches Archer's current UI design:

 

<div class="toolbar-app-buttons-left"> 
    <a title="Copy/Refresh" class="tb-btn-link-left" id="btnCopyRefresh" href="javascript&colon;void(0);" data-check-dirty="false"> 
        <div class="tb-btn">Copy/Refresh</div> 
    </a> 
</div> 


<script type="text/javascript"> 
     $('#btnCopyRefresh').click(function(){ 
          //Your code here 
     }); 
</script> 

 

 Advisory Consultant

ArunBabuKunnat1
Contributor III

Thank you David for sharing the above code.

Even though it is not exact fix to the issue it is an excellent alternative solution.

 

Regards

Arun

 

 

ArunBabuKunnat1
Contributor III

Hi @DavidPetty 

We have below custom object to hide question scored message (eg. '2 of 28 completed') which shows on the top of any questionnaire records in 6.5. It is not working in 6.9.

 

<script type="text/javascript">
Sys.Application.add_load(function() {
$("#master_toolbar > div.CompletedDiv").hide(); // Hide Questions Completed

});
</script>

 

When I cross checked html elements on the page 'div.CompletedDiv' (which is showing questions scored) is same in 6.5 and 6.9. But for some reason custom object is not working. Could you please help on this?

 

Thanks

Arun

DavidPetty
Archer Employee
Archer Employee

@ArunBabuKunnat1, use 

<script type="text/javascript">
     Sys.Application.add_load(function() {
          $(".CompletedDiv").hide(); // Hide Questions Completed
     });
</script>

 Advisory Consultant

ArunBabuKunnat1
Contributor III

Thank you @DavidPetty . It worked.

RSAlover
Contributor

Hello,

I am using a custom object to hide the 'Add New' button in an application and it works until an ACL triggers.

I would like to keep the 'Add New' button hidden after the ACL triggers, do you know how I can accomplish this?

DavidPetty
Archer Employee
Archer Employee

@RSAlover, this one should take care of your issue, Hiding the 'Add New' Link for Cross-Reference Fields - RSA Link - 632035 

 Advisory Consultant