2 Replies Latest reply on Jul 6, 2015 7:12 AM by Kaorin

    Script using Case and GetNthRecord from 2 different related tables based on criteria

    Kaorin

      Title

      Script using Case and GetNthRecord from 2 different related tables based on criteria

      Post

      I'm trying to set a script so that it looks up the related record from 2 different files (tables) based on a criteria / condition and transfer the result into a field without having " ? " mark being entered.

      What I have so far is the script which will transfer “colourway” of the 3rd record from related tables called FABRIC INFO EU :: ColourwayBody and FABRIC INFO JP:: ColurwayBody, and depending on selection of MARKET in SPEC file: either “Japan” or “Europe”.

      Case (

      SPEC::MARKET = "EUROPE" ; GetNthRecord ( FABRIC INFO_EU_colours::Colourway Body; 3);

      SPEC::MARKET = "JAPAN" ;

      GetNthRecord ( FABRIC INFO_JP_colourways::Colourway Body; 3))

      I’ve duplicated above 6 times in 1 script so that it looks up and transfer up to 6 colourways to SPEC file.

      (::Colourway Body; 4,  ::Colourway Body; 5 ..and so on)

       

      However, sometimes, there are only 1 or 2 related records from Colourway Body.

      What do I need to add / modify in order to eliminate “?” being transferred in my field(s)?

      I did basically modify the below script, which I had it set up in the past:

       

      If(IsValid(GetNthRecord ( FABRIC INFO_EU_colours::Colourway Body; 3));

      GetNthRecord ( FABRIC INFO_EU_colours::Colourway Body; 3); "")

       

      This script clears “?” being entered into field(s) and make the field blank, but this only looks up and transfer information from FABRIC INFO_EU and not from  FABRIC INFO_JP.

      Any suggestion welcome. Thank you.

      Screen_Shot_2015-06-17_at_20.30.23.png