cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a column value in a Table from Script

Former Member
0 Kudos

Hi,

I created an Extension Definition having default value as "NO" and its a Read Only field. How can I change the field value to "YES" when the tool bar script is executed and also it saved the value.

My code is :

doc.getExtensionField("MyAttribute").set("YES");

but its not working. Please help.

Thanks in advance.

Regards,

Swastik

Edited by: swastikk padhy on Aug 13, 2010 4:19 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I guess you are executing the script in the View mode.

Use this script to update the value in the edit mode as well as the view mode. The example given here is for a master agreement, change it accordingly for the type of document you are using.

import com.frictionless.api.contracts.ContractIBeanHomeIfc;

contractHome=IBeanHomeLocator.lookup(session,ContractIBeanHomeIfc.sHOME_NAME);

if(doc.isObjectAccessModeView())

{

contractHome.upgradeToEdit(doc);

doc.getExtensionField("myAttribute").set("YES");

doc.getIBeanHomeIfc().save(doc);

contractHome.downgradeToView(doc);

}

else{

doc.getExtensionField("myAttribute").set("YES");

doc.getIBeanHomeIfc().save(doc);

}

Hope this helps,

Regards

Immanuel

Former Member
0 Kudos

Thanks a ton

Answers (0)