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

change extension collection rows with a script

tom_seminckx
Associate
Associate
0 Kudos
183

Dear all,

On the scorecard, i have created an extension collection.

By using a script on the moment of saving this document, I would like to change some rows in this extension.

When I actually save, i can see that the records have been saved, but afterwards, when leaving the scorecard, it seems that the old values are displayed again. When I use the same logic to Add a new row instead of changing one, it works, but i absolutely need to be able to change an existing one. Any idea how this could be caused?

Thanks in advance,

Tom

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In what context have you put the script? We had a similar request on the Contract Document page earlier this month. We initially wrote the script in the "Save" context and that was giving us issues on exercising control over the extension collection. As in, we were not able to lock the collection and get rid of the old values.

What we did was to write the script on the "Validate" context instead of the Save and that resolved our issue.

I'd request other scripting experts on the forum to also pitch in with their recommendations.

Thank you,

Vikram Shukla

Answers (2)

Answers (2)

tom_seminckx
Associate
Associate
0 Kudos

Great feedback Vikram!

Using validate solved the problem.

Thanks a ton!

Former Member
0 Kudos

Hi Tom,

In addition, I would recomed to post the script code that you used for this collection mofication. Here are some thoughts:

1. just to be sure, Is the parent object in edit mode, while this action is performerd?

2. do you see any errors in the logs or do you have a sorrounding catch block that may potentially catch some interesting exceptions?

3. Try issuing a force save e.g. doc.getHome().save()

Thanks, Baski