[fx.php_list] Re: Related records

  • From: "Van Buskirk, Trish" <pvanbuskirk@xxxxxxx>
  • To: "fx.php_list@xxxxxxxxxxxxx" <fx.php_list@xxxxxxxxxxxxx>
  • Date: Wed, 21 Dec 2016 15:29:44 +0000

Here's the latest I've tried (utilizing the portal).

<?php
            //define('DEBUG', true);
            require_once('FX/FX.php');       // FX.php file
            include_once('include/server_data.php');

// IP address submitting form
$ip = $_SERVER['REMOTE_ADDR'];
$GL = $_POST['GL'];
$NR_GL = $_POST['NRGL'];
$NRPO = $_POST['NRPO'];
$PO = $_POST['PO'];

echo $GL."<br />";
echo $PO."<br /><br />";

$polineQuery=new FX($dbHost,$port,$dbType,$conType);
$polineQuery->SetDBData('ReferenceTables', 'FSU_AUX_ITS_POS_LIST', 'all');
$polineQuery->setDBPassword($dbPass,$dbUser);
$polineQuery->AddDBParam ('GL_String', $GL);
$polineQuery->AddDBParam ('PO_No', $PO);
$polineQuery->AddDBParam ('CountServices', '0', gt);
$polineQuery->AddDBParam ('Descript', 'Telecom Non-Recurring', neq);
$polineQuery->AddSortParam('Descript', 'ascend');
$polineResults = $polineQuery->DoFXAction('perform_find');

//$arrlength = count($polineResults);
//echo $arrlength."<br /><br />";

foreach ($polineResults as $polines) {
            $poline=$polines['LineCategoryID'];
            $podesc=$polines['Descript'];
            $svcdesc=$polines['ListSvcs'];
            echo $poline." - ".$podesc." - ".$svcdesc."<br />";

            // look up ITS REC services on PO lines
            $svclineQuery=new FX($dbHost,$port,$dbType,$conType);
            $svclineQuery->SetDBData('ReferenceTables', 'FSU_AUX_ITS_POS');
            $svclineQuery->setDBPassword($dbPass,$dbUser);
            $svclineQuery->AddDBParam ('GL_String', $GL);
            $svclineQuery->AddDBParam ('PO_No', $PO);
            $svclineQuery->AddDBParam ('Descript', 'Telecom Non-Recurring', 
neq);
            $svclineQuery->AddDBParam ('ServicesPO::TypeWorkOrder', 'Orders');
            $svclineQuery->AddDBParam ('ServicesPO::Status', 'A');
            $svclineQuery->AddSortParam('ServicesPO::ServiceName', 'ascend');
            $svclineResults = $svclineQuery->DoFXAction('perform_find');

            foreach ($svclineResults as $svclines) {
            $svcline=$svclines['ServiceName'];
            echo $svcline."<br />";
            }

}

?>

Here's the output:

211214000000000000
0001212625

3 - Cellular Services - Pagers Plans & Features





4 - Data Circuits - Off-Campus Internet





6 - Local Service - Phone & Cable - Telephone Line * Telephone 
Instruments/Equipment (Including Maintenance Plans) * Voice Mail 
(Updates/Passcode Resets) Calling Features (ACD, busy indicators, 
multi-appearance, dialing abilities, conference calls) Cable Television 
Services & Equipment (Seminole Cable Vision) * Calling Cards Meet-Me Conference 
(Local, Toll-Free) 800 Number Off-Campus Phone Line





7 - Managed Port Fees - Internet Data Line





10 - Software Licensing - Software Licensing

Haven't done a vardump yet ... will try that now.


From: fx.php_list-bounce@xxxxxxxxxxxxx 
[mailto:fx.php_list-bounce@xxxxxxxxxxxxx] On Behalf Of Chris Hansen
Sent: Wednesday, December 21, 2016 10:25 AM
To: fx.php_list@xxxxxxxxxxxxx
Subject: [fx.php_list] Re: Related records


Hmmm... So what are you seeing? Have you tried doing a vardump() on 
$polineQuery to see what's actually in the FX object after running the query?

Best,

--Chris

On 12/21/16 8:07 AM, Van Buskirk, Trish wrote:

Hi Chris, Thanks for responding!  This is getting so frustrating ... and we 
have a go-live date of 1/3, so getting more aggravating by the minute!



When I run the individual queries separately, they work fine (using hard-coded 
info for the variable on the second part), so I'm pretty sure It's not 
permissions.



I've seen some examples of x=0; x++ type thing, but have no idea how to do 
that.  I've tried putting a portal on the original layout, but I still get 
wiggy results.



Again (and as always), I really appreciate your support!



Trish



From: fx.php_list-bounce@xxxxxxxxxxxxx<mailto:fx.php_list-bounce@xxxxxxxxxxxxx
[mailto:fx.php_list-bounce@xxxxxxxxxxxxx] On Behalf Of Chris Hansen

Sent: Wednesday, December 21, 2016 9:51 AM

To: fx.php_list@xxxxxxxxxxxxx<mailto:fx.php_list@xxxxxxxxxxxxx>

Subject: [fx.php_list] Re: Related records





Hey Trish,



Have you looked at the permissions that you're using for FX.php (xml) access on 
the related table? I've seen frustrating things happen in the past if those 
aren't set up properly. I may have some other thoughts too, if that doesn't 
help.



Best,



--Chris



On 12/20/16 1:02 PM, Van Buskirk, Trish wrote:

I have two tables I am querying, related by LineCategoryID.  One is a PO table, 
the other contains services available per line item on the PO.



I have tried two separate searches; the first finding the Lines available on 
the entered PO #, then next querying the Services with the returned 
LineCategoryIDs.  I also tried putting a portal on the PO layout which displays 
the services.  I can't get either to work properly.  The only thing I've been 
able to get to work is adding a ListSvcs calculated field which is 
List(ServicesPO::ServiceName).  However, that won't work, as I need to create 
checkboxes for the user to select services.



Here's the bare-bones query I have done using 2 searches, which only returns 
the first service.



<?php

//            define('DEBUG', true);

                require_once('FX/FX.php');         // FX.php file

                include_once('include/server_data.php');



// IP address submitting form

$ip = $_SERVER['REMOTE_ADDR'];

$GL = $_POST['GL'];

$NR_GL = $_POST['NRGL'];

$NRPO = $_POST['NRPO'];

$PO = $_POST['PO'];



echo $GL."<br />";

echo $PO."<br /><br />";



// look up lines on PO

$polineQuery=new FX($dbHost,$port,$dbType,$conType);

$polineQuery->SetDBData('ReferenceTables', 'FSU_AUX_ITS_POS', 'all');

$polineQuery->setDBPassword($dbPass,$dbUser);

$polineQuery->AddDBParam ('GL_String', $GL);

$polineQuery->AddDBParam ('PO_No', $PO);

$polineQuery->AddDBParam ('CountServices', '0', gt);

$polineQuery->AddDBParam ('Descript', 'Telecom Non-Recurring', neq);

$polineQuery->AddSortParam('Descript', 'ascend');

$polineResults = $polineQuery->DoFXAction('perform_find');



foreach ($polineResults as $polines) {

                $poline=$polines['LineCategoryID'];

                $podesc=$polines['Descript'];

                echo $poline." - ".$podesc."<br />";



                // look up ITS services on PO lines

                $svclineQuery=new FX($dbHost,$port,$dbType,$conType);

                $svclineQuery->SetDBData('ReferenceTables', 'SvcListForWeb', 
'all');

                $svclineQuery->setDBPassword($dbPass,$dbUser);

                $svclineQuery->AddDBParam (POitemID', $poline);

                $svclineQuery->AddDBParam ('POCatID', '12', neq);

                $svclineQuery->AddDBParam ('TypeWorkOrder', 'Orders');

                $svclineQuery->AddDBParam ('Status', 'A');

                $svclineQuery->AddSortParam(ServiceName', 'ascend');

                $svclineResults = $svclineQuery->DoFXAction('perform_find');

                foreach($svclineResults as $svc) {

                                $svcline=$svc[ServiceName'];

                                echo $svcline."<br />";

                               }

}



Any assistance or direction would be GREATLY appreciated!



Thanks,

Trish V.





_____________________________________________________________________

     FX.php Official Web Site -- http://fx.iviking.org/

FX.php Official Mailing List -- //www.freelists.org/list/fx.php_list

     (Subscribe, unsubscribe, and more at the mailing list site!)



                  
FX.php_List@xxxxxxxxxxxxxxxx<mailto:FX.php_List@xxxxxxxxxxxxxxxx>


_____________________________________________________________________
     FX.php Official Web Site -- http://fx.iviking.org/
FX.php Official Mailing List -- //www.freelists.org/list/fx.php_list
     (Subscribe, unsubscribe, and more at the mailing list site!)

                  FX.php_List@xxxxxxxxxxxxxxxx

Other related posts: