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

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with custom code after upgarde to 6.6 from 6.3

RohitShrivastav
Contributor III

Hi,

We recently upgraded our Archer environment from 6.3 to 6.6 p6 and after upgrade one of our custom code is not working as expected. Basically when we are clicking the code, its taking to the home page of Archer instead of selecting relevant controls which the code is supposed to do.

 

I know RSA had changed the way certain protocols work after 6.3 like you can no longer find record id in the URL.

 

Any advise on this would be greatly appreciated.

 

Thanks

23 REPLIES 23

GauravPathak1
Contributor II

David Petty Can you please have a look and suggest here. Thank you in advance.

DavidPetty
Archer Employee
Archer Employee

Hi Gaurav

 

Can you post the custom object?  Without seeing it there's very little I can do to help.

 Advisory Consultant

Hi David Thank you so much for the response. Here you go with the custom code:

 

<script type="text/javascript">
var RiskProfileId=XXXXX;
var SuggestedOwnerId=XXXXX;
var IRMBusinessId=XXXXX;
function getTrackingID5() {

var TrackingID =document.getElementById("master_DefaultContent_rts_s3336_fXXXXXc").innerHTML;
var RiskProfile=ArcherTech.UI.GenericContent.GetInstance().getFieldValue(RiskProfileId, false);
var SuggestedOwner=ArcherTech.UI.GenericContent.GetInstance().getFieldValue(SuggestedOwnerId, false);
var IRMBusiness=ArcherTech.UI.GenericContent.GetInstance().getFieldValue(IRMBusinessId, false);

var Empties = new Array();

if(RiskProfile==null || RiskProfile=='') {Empties.push("-Risk Profile");}
if(SuggestedOwner==null || SuggestedOwner=='') {Empties.push("-Suggested Control Owner");}
if(IRMBusiness==null || IRMBusiness=='') {Empties.push("-IRM Business Unit");}

if(Empties.length) {
var manfields = new String("The following field(s) are required:\n");
for(var i=0; i<Empties.length; i++) { manfields += '\n' + Empties; }
alert(manfields);
}else{
if (TrackingID !=null && TrackingID !='' && TrackingID !=' ' && TrackingID !=' ') {
var animationOptions1 = ArcherTech.UI.GenericContent.GetInstance().get_loadingAnimationOptions();
$('body').loadingAnimation({ title: '', text: ' Please wait, processing... ', image: animationOptions1.image });
setTimeout(function() {
var str_sub = TrackingID.substring(TrackingID.lastIndexOf("-")+1,TrackingID.length);

window.location.href = 'https://<URL>/custom_app/wfrmLogon.aspx?UserType=R&OptionID=4&TrackingID=' + str_sub;
if (debugging1) console.log("Control Auto Selection Completed");
$.fn.loadingAnimation.remove();

},0);
}
else{
if (TrackingID==null || TrackingID=='' || TrackingID==' ' || TrackingID==' ')
alert ("Please save\\apply the record");
}
}
}
</script>
<div id="bsubmit" style="float: center;padding: 10px;">
<input id=”btnsubmit3” class=control style="font-weight: bold; font-size: 12px; width: 200px;height: 30px;background-color=#DAA520" onclick=getTrackingID5() type=button value="Start Auto Control Selection" name=generatecntrls >
</div>
</div>

Thanks.

 

I only see one line for the redirect to a different site and nothing about taking Archer back to the home page.

 

Some advice, take a look at my doc, The Horror's of Moving Custom Objects from One Environment to Another.  This should help with removing the hard coding of the field ids.

 

To get the tracking id of the record, just use getRecordId() function instead.

 

Also the getFieldValues() function only works for date and values list fields.

 Advisory Consultant

Thanks David,

Field Ids should not be an issue as we did not do packaging or any activity that will change field Ids and this was the upgrade to 6.6 from 6.3.

Yes, put field ids do potentially change from one environment to the next.

 

The other suggest changes fix the issue?

 Advisory Consultant

Hello David -

 

The issue is with redirection of https://<URL>/custom_app/wfrmLogon.aspx URL that we are trying to navigate thru the web browser or via Custom Object. It is been redirected to the home page of Archer in the new version of Archer 6.6 P6

 

As started above, ideally the redirection should happen by putting the URL in web browser and should route to external asp.net application/page wfrmLogon.aspx which is using the same IIS and web server, but this is not happening currently.

 

Your help is much appreciated. 

Try replacing this line,

window.location.href = 'https://sww-collective-dev-project.shell.com/custom_app/wfrmLogon.aspx?UserType=R&OptionID=4&TrackingID=' + str_sub;

With,

window.location.replace = 'https://sww-collective-dev-project.shell.com/custom_app/wfrmLogon.aspx?UserType=R&OptionID=4&TrackingID=' + str_sub;

 Advisory Consultant

Hi David,

 

Both the links look similar.

 

Did you miss something?

 

Thanks

Rohit