cancel
Showing results for 
Search instead for 
Did you mean: 

Field Data Edit script

Former Member
0 Kudos

Dear Experts,

in the Agreement object I am trying to implement a script at Field Data Edit event in which I want to change the value of newFieldValue.

The set up is the following - when agreement is created ( I am checking for TRUE in doc.isObjectAccessModeNew()) I want the field STORAGE_LOCATION to be empty. I use the variables fieldValue and newFieldValue to check if I have any value. Normally I have null for fieldValue and for example "ID 123" for newFieldValue. Now I want to change the value of newFieldValue also to null (or empty string). I tried using doc.setStorageLocation() however this does not change the value in the end.

Please advice how can I modify the value of newFieldValue so that the modification persist also after the script finishes.

Thanks,

Venelin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos


Hi Venelin,

In your case, instead of going for 'field data edit' context, I think an easier approach would be using the 'Document Lifecycle event' context for the target- Created. And as you always need the storage location field value as 'null', just try using doc.setStorageLocation("");

Hope this helps. Please let me know.

Best Regards,

Lopita

Former Member
0 Kudos

Hi Lopita,

Thanks for the answer.

I have tried using what you suggest, however it doesn't seem to affect the initial value of StorageLocation. I have created subAgreement from MasterAgreement and still the StorageLocation was inherited from the MasterAgreement and was not reset to "". I assume (and also have not found) that there isn't a separate class for SubAgreements?

Thanks

Venelin

kushagra_agrawal
Active Participant
0 Kudos

Hi Venelin,

As far as I got your requirement you have to set a storage location value of sub agreement to null.

You can write a create script on class Agreement(1003) and set the value depending upon your requirement: doc.setStorageLocation(" ");

Hope it helps.

Best,

kushagra A

Former Member
0 Kudos

Dear Kushagra,


my requirement is the following: I start creating Sub Agreement (click ADD in the Agreement tab of Master Agr.), then when the initial screen for the subagreement shows (before saving or anything), to have the storage location set to "" or null.


If I use the Create event, I believe that the script will trigger only after SAVE. I would like to have it set to null when the create screen is displayed - before SAVE.  


Thanks in advance for any tips / suggestions.


Regards,

Venelin

kushagra_agrawal
Active Participant
0 Kudos

Hi Venelin,

Please try the piece of code on create as I have mentioned in my last answer. It should solve your problem.

Let me know if you have any concerns.

Best,

kushagra A