Capture what the state is (ie, page up/down)

 7 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Roger L.
Basic Member Send Private Message
Posts: 8
Basic Member
I need to capture if the function is page up or page down in Design studio but can't seem to be able to figure out how. I have never had training in design Studio and have only been working with it a short time. Any Help is welcome.
Terry P
Veteran Member Send Private Message
Posts: 234
Veteran Member
Look in the Objects Reference under tools. It's Under FORMS/Magic/Properties/FC


Property Description
Property: FC [String]


Remarks
Hold the last function code passed to the transact method.

Example:
if (tranMagic.FC == "C" // then do something
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
if (tranMagic.FC=="+") for page up, "-" for page down
David Williams
Terry P
Veteran Member Send Private Message
Posts: 234
Veteran Member
*blush* - I should have said that David.
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
I didn't see your post when I put my comment out. I wasn't trying to correct you.
David Williams
Terry P
Veteran Member Send Private Message
Posts: 234
Veteran Member
Oh I knew that David. I just felt bad I didn't catch that and include in my example. I just remember when I first started, I would have taken it literally and then wondered why it didn't work! I'm sure Roger is more on the ball than I am and would have noticed it.

I'm curious to hear from you Roger what the "business reason" is for knowing whether they are doing a page up or page down. That's a new one on me.

PS - and please DO correct me when I'm wrong.  
Roger L.
Basic Member Send Private Message
Posts: 8
Basic Member
Thanks guys. I am capturing the page up and page down now. I have some other issues but they are just database stuff. You guys were great. Thank you.
Roger L.
Basic Member Send Private Message
Posts: 8
Basic Member
I am in IC50. They had me add the cost center and to_location from the ICtrans table. I need the page up and page down so that when there are more records to be seen they can page down and see the cost center and to_location for the next set of records. Thanks to you guys the code works perfectly to identify page down. I haven't tried page up yet. But my DME call must be wrong. When I page down I either get the same exact records or nothing depending on which string I use for the key. The code for the to_location is as follows: What do you think?

function getToLocation(company, location, item)
{
 var to_location="";
 var s = "";
 var a = 0;
 var sReturn = "";
 var objhttp = null;
 var date_field = "";
 var time_field = 999999;
 var tran_counter = 999999;
 if (tranMagic.FC=="+")
 {
 // capture the date field(out9) and the time_field(out10) for the last detail line populated.
  for (a=0;a<12;a++){
  date_field = lawForm.getFormValue("out9", a);
  if (date_field == ""){
      date_field = lawForm.getFormValue("out9", a-1);
      time_field = lawForm.getFormValue("out10", a-1);
  }else{
      date_field = lawForm.getFormValue("out9", a);
      time_field = lawForm.getFormValue("out10", a);
   
    }
          alert("Loc date = " + date_field);
          alert("Time date = " + time_field);
  }      
      }else{
                 date_field = lawForm.getFormValue("out9", 0);
  time_field = lawForm.getFormValue("out10", 0);
        }

 if (company !== "")
 {
  if (location !== "")
  {
   if (item !== "")
   {
    s = portalWnd.DMEPath;
    s += "?PROD="+strPDL;
    s += "&FILE=ICTRANS";
    s += "&FIELD=FROM-TO-LOC";
    if (tranMagic.FC=="+"||tranMagic.FC=="-")
         {
         if (date_field !== "")
           {
            s += "&INDEX=ICTSET2&KEY=" + company + "=" + location + "=" + item + "=" + date_field + "=" + time_field + "=" + tran_counter;
           }else{
            s += "&INDEX=ICTSET2&KEY=" + company + "=" + location + "=" + item;
           }
        }else{
     s += "&INDEX=ICTSET2&KEY=" + company + "=" + location + "=" + item;
      }
    s += "&OUT=CSV&MAX=12&DELIM=~&NOHEADER";
 
    alert("Loc S1 = " + s);
    objhttp = portalWnd.objFactory.createInstance("http");
    objhttp.Open("GET",s,false);
    objhttp.Send("UserInfo");
    sReturn=objhttp.responseTEXT;
          
    // DME Error Checking
    if(!sReturn||sReturn.status)
    {
    var msg="Error calling DME, ";
    msg += (sReturn? "(status code): "+sReturn.status: "bad server response.");
    alert(msg);
    return true;
    }
    var aData = new Array();
    var aRecs = new Array();
    var i=0;

    if (sReturn !== "")
    {
        alert("Location = " + sReturn);
        while(sReturn.search("\r")>-1){
     sReturn = sReturn.replace(/\r/g,"");
        }
        aRecs = sReturn.split("\n");
        aRecs.pop();
        for (i=1;i      aFields = aRecs.split("~");
     aData[aData.length] = new Array(aFields[0]);
     }
        for (x=0;x      //alert(aData[x]);
     lawForm.setFormValue("text7", aData[x], x);
     }
    }    
   }

  }
 }
}