cancel
Showing results for 
Search instead for 
Did you mean: 

How to make quote table cell editable based on condition on SAP CPQ?

sbslmhmt
Participant
880

Hello,

I would like to make one of the table cell editable based on a condition. I defined a custom event and wrote the code below;

from System import DateTime
from Scripting.QuoteTables import AccessLevel
control = False
quoteTable = Quote.QuoteTables['Delivery_Dates']
for row in quoteTable.Rows:
	control = False
	for cell in row.Cells:
		if cell.ColumnName == 'Delivery_Date':
			if cell.Value < DateTime.Now:
				control = True
		if cell.ColumnName == 'Revised_Delivery_Date' and control == True:
			cell.AccessLevel =  AccessLevel.Editable

But cell is still not editable even though I changed it's Access Level.

Any ideas what I am doing wrong?

Best regards.

Accepted Solutions (0)

Answers (1)

Answers (1)

techie1996
Member
0 Kudos

Hello,
In the quote table, I wouldn't be able to set the cell as read-only. Here is the snippet

data= context.Quote.QuoteTables['BASE_TABLE']

for rows in data.Rows:

for cell in row.Cells:

if(cell.ColumnName == 'status' 😞

cell.AccessLevel = AccessLevel.ReadOnly