PreviousNext
Help > API Functions > Native database access > i5_nolink
i5_nolink

 

Deactivates active master / detail link activated with i5_link

 

bool i5_nolink (resource result_detail)

 

 

Parameters

 

result

File ID

connection

Connection ID (optional)

 

 

Return

 

True if OK, false if failed. 

 

I5_ERR_PHP_HDLDFT

256

No default connection found.

I5_ERR_PHP_OPTIONSTYPE

259

The type of " I5_OPTIONS_ALIAS" option must be x and not x

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_TYPEPARAM

262

Type of element x in parameter -1 must be y. Type z was provided.

 

 Details

 

i5_nolink function is used to cancel an activated link with i5_link function.

It applies to detail file, which will not be then, automatically filtered with a master file reading.

To reactivate a link, call i5_link function again.

 

Example

 

 

$invoices = i5_open('easycom/s_order');

if (is_bool($invoices))

  trigger_error('i5_open master error : '.i5_errormsg(), E_USER_ERROR);

 

$lines = i5_open('easycom/s_detail');

if (is_bool($lines))

  trigger_error('i5_open detail error : '.i5_errormsg(), E_USER_ERROR);

  

/* Two fields linkage */

 $keys_invoice = array('ORDER_ID');

 $keys_lines = array('ORDER_ID');

 

 $lien = i5_link($lines, $keys_lines, $invoices, $keys_invoice);

 if (!$lien)

  trigger_error('i5_link detail error : '.i5_errormsg(), E_USER_ERROR);

 

 $fac = i5_fetch_row($invoices, I5_READ_FIRST);

 if (is_bool($fac))

  trigger_error('i5_fetch_row Master error : '.i5_errormsg(), E_USER_ERROR);

 

 echo 'Invoice lines are:<BR>';

 $lig = i5_fetch_assoc($lines, I5_READ_FIRST);

 if (is_bool($lig))

  trigger_error('i5_fetch_row detail error : '.i5_errormsg(), E_USER_ERROR);

 while (!is_bool($lig)) {

echo $lig['PARTNO']. ' ' . $lig['QUANTITY'] . '<BR>';

$lig = i5_fetch_assoc($lines, I5_READ_NEXT);

 }

 

 $ret = i5_nolink($lines);

 if (!$ret)

  trigger_error('i5_nolink Master error : '.i5_errormsg(), E_USER_ERROR);

 

 

See also

 

i5_link