on 2023 Feb 08 3:15 PM
Hello Community,
at this link SAP simple script can be found in order to activate import from excel feature on a specific product:
https://help.sap.com/docs/SAP_CPQ/7fc27540a0f14bd1a10b639117a9d4d7/be93644b52b44bb897ba36ea4c77b70b....
Whit this file you can set value on attributes product configuration.
We've just changed the code in order to import an excel file containing only the attributes that we want to import, to make the script more flexible.#adds message that will be shown to user in the responder part of the configurator<br>Product.Messages.Add("start")<br>#Gets the uploaded Excel spreadsheet "Sheet1" and loads<br># all cells between B2 and 'end' into an array<br>rows = Workbook.GetSheet("Sheet1").Cells.GetRowCount<br>end = Workbook.GetSheet("Sheet1").Cells.GetLastColumnPosition + str(rows)<br>arr = Workbook.GetSheet("Sheet1").Cells.GetRange("A2", end)<br>for x in range(0, rows-1):<br> <strong>Product.Attributes.GetBySystemId(arr[x,0]).SelectValue(arr[x,1])</strong><br>Product.Messages.Add("end")<br>
SelectedValue() method works only for 'user selection' attributes, so it does not work for free text attributes.
Does anybody knows if there is a method that we can use to set a string on a free text attribute?
Is it a known limitation?
Please let me know if there's a way to obtain that.
Thank you.
Request clarification before answering.
Hi Davide,
Try to use the AssignValue() for these.
Cheers,
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Davide,
Patrick is correct, .AssignValue() can be used to set the value of free input attributes.
For future reference, the various methods to interact with the CPQ scripting objects, such as product attributes, can be found in the Script Workbench under API snippets. Which method to use isn't always obvious at first, but with some trial and error you should be able to find what you need.
Hope this helps!
Corey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
3 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.