cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Performance issue on CPQ global script

sbslmhmt
Participant
0 Kudos
311

Hello,

We wrote a global script for if an attributes has only one selectable option system automatically selects this attribute value and makes the attribute read-only. Script works fine but it takes 12-15 seconds to execute even though when we execute same script on Script Workbench it only takes 0.016 seconds. Does anyone have an idea why this might happening?

	count = 0
	for x in Product.Attributes:
		if x.Name <> 'Vehicle Code':
			count = 0
			for y in x.Values:
				if y.Allowed == True:
					count = count + 1
			if count == 1:
				for y in x.Values:
					if y.Allowed == True and y.IsSelected == False:
						y.IsSelected = True
				x.Access = AttributeAccess.ReadOnly
			else:
				x.Access = AttributeAccess.Editable

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Please do check any events attached to script & execution and other rules affecting at Product Level.