$$Return is null or not an object

Hello Folks,

I am received the following message within the status bar of my browser. “$$Return is Null or not an object” despite the fact that the field exists on the form and has been assigned a default value of itself.

Any help here would be appreciated.

Thanks.

Subject: RE: $$Return is null or not an object.

It sounds like you have some JavaScript code trying to access this field. When you ask a question, please show the relevant code.

Also, look at the HTML source and see whether and how the $$Return field is actually represented.

  • Andre Guirard

IBM/Lotus Development

To get your questions answered, get C R I S P Y

Subject: RE: $$Return is null or not an object.

Andre

This code is called from a button on my form.

function saveAction()

{

var vid = frm.vid.value;

var vname = frm.vname.value;

var startText = frm.start.value;



var currRegExp = new RegExp( " " , "g" );

vname = vname.replace(currRegExp , "_")



pageID = window.document.forms[0].PageID.value;

newLoc = '[' + frm.DbURL.value + '/*****/' + pageID + '?EditDocument&SessionID=' + genRndSeq() + '&vid=' + vid + '&vname=' + vname + '&Start=' + startText + ']';

frm.$$Return.value = newLoc;

frm.submit()



// return _doClick('dc5ef1ca8562b10f85256b1e0066836f/$V5ACTIONS/0.17C', this, null);

}

Thanks.

Subject: RE: $$Return is null or not an object.

Also, look at the HTML source and see whether and how the $$Return field is actually represented.

Subject: $$Return is null or not an object.

Check to see if it is hidden from Web Browsers in the field or text properties. Also - it cannot be pass-thru HTML.

Subject: RE: $$Return is null or not an object.

John,

Thanks for your response. The field is neither hidden nor is pass-thru HTML. In fact, the current settings for the field is Computed, as even I have tried making it the 1st field on the form, as well the last field…regardless, the same error.

Subject: RE: $$Return is null or not an object.

John,

Thanks for your response. The field is neither hidden nor is pass-thru HTML. In fact, the current settings for the field is Computed, as even it I have made it the 1st field on the form, as well the last field…regardless, the same error.

Subject: RE: $$Return is null or not an object.

I wouldn’t be surprised if the JavaScript has problems with a fieldname starting with $$.

But first of all, check your source code (in the browser) and see if the field is there…

If it is, and there is still a problem, you can try to add an id property to the field.

Make the field editable, go to the advanced properties (last tab) of the field, and add an id, for example ReturnField, and add type=“hidden” in the other field. Now, looking at the html source again, the field should look like this:

Then you can just add a value to it by doing this:

document.getElementById(‘ReturnField’).value = ‘somevalue’;

If you don’t want to add an id, you can also try to see if you can set the field like this:

document.getElementsByName(‘$$Return’)[0].value = ‘somevalue’;

Subject: RE: $$Return is null or not an object.

Guys,

Thank all of you for your responses. Unforunately, I have yet to get my issue(s) resolved. I verified and verified again the suggestions listed here, as even a ton not even mentioned. In addition, I have even tried the suggestions listed here…again thanks, but for whatever reasons we are still having issues. What we did notice is that by deleting the collapsable section and unhidden the fields, things work as expected…meaning JavaScript was able to locate the field; however, the moment we set “Open for Reading” or “Open for Editing” the fields are (all those selected) no longer available. Below is a snipet of my JavaScript code that I am using to write to this field.

function saveAndCloseAction()

{

var vid = frm.vid.value;

var vname = frm.vname.value;

var startText = frm.start.value;



var currRegExp = new RegExp( " " , "g" );

vname = vname.replace(currRegExp , "_")



pageID = window.document.forms[0].PageID.value;

newLoc = '[' + frm.DbURL.value + '/*****/' + pageID + '?Open&vid=' + vid + '&vname=' + vname + '&Start=' + startText + ']';

frm.$$Return.value = newLoc;

frm.submit()

}

Subject: RE: $$Return is null or not an object.

I don’t understand why you insist on doing this with JavaScript when it’s so much easier to just write a formula for the $$Return field. Can you explain why it’s necessary? I don’t see that your JavaScript code is using any information that’s not also available to the formula evaluation.

I know at least two people have suggested that you look at the HTML source and see whether and how the $$Return field is represented there. Perhaps you have done this, but you didn’t tell us what you found out. Therefore, we don’t have this information to help us out.

I don’t understand what you mean by, ’ the moment we set “Open for Reading” or “Open for Editing” '. What exactly is the difference between the situation where it works, and the situation where it does not?

Subject: $$Return is null or not an object.

Chech on the Form Properties, second tab if the “Generate HTML for all fields” checkbox is selected. If not, then select the checkbox and try again!

Also, on the Field Properties (of $$Return), last tab (HTML) put in the “Other” field the following code:

type=“hidden”

Subject: RE: $$Return is null or not an object.

Thanks for your response Radu.Within my Form Properties, I have the “Generate HTML For All Fields” selected, as well I have the Type=Hidden for the field.

The other thing is that my $$Return is contained within a subform, which is inserted into the form that I’m using. Does this make a difference? Also, this application works fine in R5. Just testing here now with 7.0.1 and having this issue.

Thanks again.