cancel
Showing results for 
Search instead for 
Did you mean: 

dependency rule

Former Member
0 Kudos

Hi,

there are 2 Characteristics

Screen size - 14 inch
                    15 inch

Model No.   - A100
                    A200
                    A300
       
So based on what characteristic values user selects for BOTH Screen Size & Model no. i need to defualt char. value for Characteristic
Hard Disk: 100Gb
                 1 TB
                  2 TB.

Say
if Screen size = 14 inch & Model No. = A100 then HArd disk = 100gb
if Screen size = 14 inch & Model No. = A200 then HArd disk = 1 TB
if Screen size = 14 inch & Model No. = A300 then HArd disk = 2 TB

if Screen size = 15 inch & Model No. = A100 then HArd disk = 1 TB
if Screen size = 15 inch & Model No. = A200 then HArd disk = 2 TB

Can you Pls. let me know what dependency Rule & code i need to use
Pls. suggest.

Accepted Solutions (1)

Accepted Solutions (1)

Flavio
Active Contributor
0 Kudos

Hi,

Assuming that you have the following characteristics, as per your example, allocated to your variant class:

SCREEN_SIZE

MODEL_NO

HARD_DISK

simply create a Procedure with the following code:

$self.HARD_DISK ?= '100 GB'

  IF   $parent.SCREEN_SIZE = '14 INCH'

  AND  $parent.MODEL_NO = 'A100',

$self.HARD_DISK ?= '1 TB'

  IF   $parent.SCREEN_SIZE = '14 INCH'

  AND  $parent.MODEL_NO = 'A200',

$self.HARD_DISK ?= '2 TB'

  IF   $parent.SCREEN_SIZE = '14 INCH'

  AND  $parent.MODEL_NO = 'A300',

$self.HARD_DISK ?= '1 TB'

  IF   $parent.SCREEN_SIZE = '15 INCH'

  AND  $parent.MODEL_NO = 'A100',

$self.HARD_DISK ?= '2 TB'

  IF   $parent.SCREEN_SIZE = '15 INCH'

  AND  $parent.MODEL_NO = 'A200'.

And allocate it to your configuration profile.

It will default a value for Hard Disk, based on the other two characteristics value.

Just tested in my Dev system, and proved to successfully work:

Hope this will help.

Bye,

Flavio

Former Member
0 Kudos

HI,

can you pls. let me know what the use of  "?= "

Flavio
Active Contributor
0 Kudos

Hi Sapper Sap,

     Well, "?=" is just a short form for $SET_DEFAULT($SELF, char_name, char_value), that becomes:

char_name ?= char_value.

In fact, the above screen-shot for Display Procedure shows the formal $SET_DEFAULT syntax, while the code in the dependency is written using the "?=".

Bye,

Flavio

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

You can use procedure dependency for defaulting the value , when customer pickups the combination.

or else if you have lots of such combination , you can use Variant table and call the variant table combination in the procedure.

Regards

Praveen Sasidharan