Automation Script Object launch point is set to parentMbo. Trigger is upon save, currently happening is when i make changes in childMbo then save() the parentMbo, it will not setValue in 'Description' attribute. I need to change parentMbo first before the changes take effect. Here's my sample code:
triggerInvoke = False
childMbo = mbo.getMboSet("RELATEDTICKET")
if childMbo is not None:
triggerInvoke = True
if triggerInvoke == True:
mbo.setValue("DESCRIPTION", "Invoke")
最佳答案
我对 WO/任务层次结构有类似的要求。这是一个应该适合您的示例:
假设您在保存事件之前的子对象上有一个对象启动点。此代码应将所有者 mbo 标记为已修改,并应调用其 save 方法。
if mbo.getOwner() is not None and mbo.isModified():
mbo.getOwner().modify()
您可以通过子对象上的属性启动点获得相同的结果。
如果您想根据子数据触发父对象的保存过程,这非常有用。
关于python - 有没有办法在自动化脚本(Python)中修改childMbo时设置修改的父mbo?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58834581/