Skip to Content
avatar image
Former Member

change extension collection rows with a script

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 28, 2011 at 06:44 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 01, 2011 at 07:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 04, 2011 at 08:25 AM

    Great feedback Vikram!

    Using validate solved the problem.

    Thanks a ton!

    Add comment
    10|10000 characters needed characters exceeded