mrc Documentation
michaels, ross & cole, ltd.
http://www.mrc-productivity.com/


Using the Return Data Feature in a Report

By default, the return data feature can only be used in maintenance applications. Click here to find out more about this feature. However, there may be a time where you wish to use the Return Data feature within the prompt page of a Report.

Here is what you will need to do:

1.      Create the Multi-Record Retrieval that will function as your Return Data Lookup Screen.

2.      Use m-Painter to specify a link as “Return Data.” You can do this by clicking the field, clicking the Insert/Edit Link icon, choosing Return Data from the Link Type dropdown box. Click OK, and click “Save and Deploy.”

Now that your retrieval is complete, we will proceed into creating the Report.

3.      Create your report as you normally would, then open m-Painter, switch to the “Prompt” page and click the “View Source” mode.

4.      Paste in the following text:

In between the <head> and </head> tags:

<script LANGUAGE="JavaScript" src="/mrcjava/mrcclasses/servletmnt.js"></script>
<script LANGUAGE="JavaScript">
<!--
  //for return data when smartlink to a retrieval
      function getReturnData(data){
      //data is an array and stored values - name,value,...
      var inputObject = document.FORM_RYYYYY.elements;
      for(var i=0; i<data.length;i++){
     for(var j=0; j
<inputObject.length;j++)
if(inputObject[j].name==data[i] && inputObject[j].type !="hidden")
inputObject[j].value = data[++i];
}
}
//-->
</script>

Replace ‘YYYYY’ with your Report Number.

5. Lastly, scroll down to where you wish to see your Link and paste this text:

<a linkedtype="I" href="javascript:void(window.open('DATADICTIONARY.IYYYYYs?slnk=1&rtn_FIELDNAME=R001&rtndta=1','','resizable=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=no,width=400,height=400'))">Lookup </a>

Replace DATADICTIONARY with the name of your data dictionary.
Replace YYYYY with the number of your lookup application.
Replace the FIELDNAME with the name of your field within the retrieval.
Replace R001 with the correct selection criteria (R001 is the first prompted record selection, R002 is the second prompted record selection, etc…).

Please note: It is important to create a selection criteria for prompting; otherwise, your return data does not have a place to go. Here you can see that in my report, I have specified a Record Selection within my Report on the Product Number field.

After the compile, and following Steps 1 through 4.

 

 

Clicking on the “Lookup” link, results in this screen:

 

When I click on a product, I am returned here: