You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Groovy support explicit save?

edited May 22, 2020 3:45PM in Sales 3 comments

Summary

Groovy support explicit save?

Content

Hi,

Do we support explicit save with groovy? Here is the detail,

In the mashup subtab, we call groovy which will update an object attribute. We noticed that attribute won't be saved unless we save the parent record. 

For example, for the following code snippet, if I add it to a Mashup in Account, ABCSource_c won't be updated unless I save Account record.

Thanks,

Adam

 

 

Code Snippet

def ABCVO = newView('ABC');
def criteria = ABCVO?.createViewCriteria();
def criteriaRow = criteria?.createRow();
criteria?.insertRow(criteriaRow);
def criteriaItem = criteriaRow?.ensureCriteriaItem('ABCNumber');
criteriaItem?.setValue(123)
ABCVO?.appendViewCriteria(criteria)
ABCVO?.executeQuery();
if(ABCVO?.hasNext()) {
def ABCRow = ABCVO?.next();
def ABCSource_c = ABCRow?.getAttribute('ABCSource_c');
if(ABCSource_c != null){
setAttribute('ABCSource_c', 10000);
}
}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!