Passing Values Between Entities, Opening in New Window

There are a variety of reasons to pass values between entities.  It is PREFERABLE that you pass values using this method as opposed to entering global variables. Global variables should be avoided when possible.

Hyperlinks and Xephr functions should always use single quotes ( ' ) instead of double quotes ( " ).

See Also

Passing Values between Entities

Passing Values between Entities, remaining within the same window

 

  1. When creating this link, the Hyperlink To field will contain the function call, and the Hyperlink Scripted pop-list needs to be set to true.

  2. Enter the Xephr function call to set the parameters that you are passing.

  1. Add an open parenthesis (

  2. Enter the block and field to which the values will be passed in quotes, followed by a comma. 'BLOCK.FIELD',

  1. Enter the code to obtain the field value to set this parameter, followed by a comma $$BLOCK.FIELD$$, or $$BLOCK.FIELD.first$$,

  2. If you wish to set a temporary global on the entity that you are opening, enter the name of the global in quotes preceded by an asterisk, followed by a comma '*GLOBAL',  If you wish to set a session global when the entity is opened, use 2 asterisks '**GLOBAL',

  3. To define the value for the global, enter the code to obtain the field value that will be passed from the current entity, followed by a comma $$BLOCK.FIELD$$, or $$BLOCK.FIELD.first$$;

  4. Repeat 4 thorough 7 for any additional values that you are passing.  The final value will NOT be followed by a comma.

  5. When all values have been entered, add a close parenthesis )

  6. Always close with a semi-colon ;

  7. Enter the Xephr function call to define that the entity to be opened will be opened in a new window.

  1. Add an open parenthesis (

  2. Enter the entity that will be opened in quotes, followed by a comma. 'entity',

  3. Enter the mode in which the entity will be opened, in quotes followed by a comma. 'mode',

  1. Enter the height in pixels for the new entity in quotes, followed by a comma. 'height',

  2. Enter the width in pixels for the new entity in quotes, followed by a comma. 'width',

  3. Enter the pixel location on the screen for the top of the new entity in quotes, followed by a comma. 'top',

  4. Enter the pixel location on the screen for the left side of the new entity in quotes, followed by a comma. 'left',

  5. Add a close parenthesis )

  6. Always close with a semi-colon ;

As an example, suppose that you are viewing a sales order on entity OQEM and you are going to add a link to the order line comments entity, which is an editable list.

SetParameters

SetParameters(

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO',

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$,

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX',

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', $$OEDETL.ORDER_SUFFIX$$,

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$', 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', '$$OEDETL.ORDER_SUFFIX$$', 'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO',

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', $$OEDETL.ORDER_SUFFIX$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO', $$OEDETL.LINE_NO$$,

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', $$OEDETL.ORDER_SUFFIX$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO', $$OEDETL.LINE_NO$$, '*ORG_UNIT_ID',

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', $$OEDETL.ORDER_SUFFIX$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO', $$OEDETL.LINE_NO$$, '*ORG_UNIT_ID', $$OEDETL.ORG_UNIT_ID$$

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', $$OEDETL.ORDER_SUFFIX$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO', $$OEDETL.LINE_NO$$, '*ORG_UNIT_ID', $$OEDETL.ORG_UNIT_ID$$)

SetParameters('OE_LINE_COMMENTS_DETAIL.ORDER_NO', $$OEDETL.ORDER_NO$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX', $$OEDETL.ORDER_SUFFIX$$, 'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO', $$OEDETL.LINE_NO$$, '*ORG_UNIT_ID', $$OEDETL.ORG_UNIT_ID$$);

Xephr function

Block and field on to which the value is being passed

Value being passed in $$BLOCK.FIELD$$ format, or hard coded in quotes

Block and field on to which the value is being passed.

Value on from block being passed in $$BLOCK.FIELD$$ format or hard coded in quotes

Block and field on to which the value is being passed.

Value on from block being passed in BLOCK.FIELD$$ format or hard coded in quotes

Global being created temporarily, in quotes, preceded by an asterisk

Value on from block being set as the value of the new global in $$BLOCK.FIELD$$ format or hard coded in quotes

SetParameters

'OE_LINE_COMMENTS_DETAIL.ORDER_NO',

$$OEDETL.ORDER_NO$$,

'OE_LINE_COMMENTS_DETAIL.ORDER_SUFFIX',

$$OEDETL.ORDER_SUFFIX$$,

'OE_LINE_COMMENTS_DETAIL.ORDER_LINE_NO'

$$OEDETL.LINE_NO$$,

'*ORG_UNIT_ID',

$$OEDETL.ORG_UNIT_ID$$);

ShowInWindow

ShowInWindow(

ShowInWindow('OE_LINE_COMMENTS_UVW',

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list',

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list', '400',

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list', '400', '800',

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list', '400', '800','0',

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list', '400', '800','0','0'

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list', '400', '800','0','0')

ShowInWindow('OE_LINE_COMMENTS_UVW', 'list', '400', '800','0','0');

Xephr function

Entity being opened in new window

Mode in which entity will be opened.

Height of new window in pixels.

Width of new window in pixels

Pixel location for the top of the new window

Pixel location of the left of the new window

ShowInWindow

('OE_LINE_COMMENTS_UVW',

'list',

'400',

'800',

'0',

'0');

There will be times when a Xephr function will be set up to perform some action before opening a new entity, such as when you are inserting a new record.  When this occurs, certain checks are done against the entity, such as checking to make sure that required fields are entered.  For this reason, you should enter the javascript to be performed first.  Then, you will put the code that is dependent upon the javascript executing successfully within a wrapper that checks to make sure that the javascript was successful before moving on.  

Inserts, saves, and deletes set a property called lastResult.  If this value is "true", the insert was successful.  If the values is "false". it was unsuccessful.

The code looks like this

if ( lastResult)

   {

   //protected actions go here

   }

For example:

Insert();

if ( lastResult)

   {

   SetParameters('CONTACT_MASTER.CONTACT_ID', $$CONTACT_MASTER.CONTACT_ID$$);

   ShowInWindow('SPWM','edit', '400', '800','0','0');

   }

Xephr is a registered trademark of NDS Systems, LC.

Copyright © 2007 NDS Systems LC.