Showing posts with label OSC. Show all posts
Showing posts with label OSC. Show all posts

Wednesday, May 18, 2016

Date difference - Goovy

Directly subtract date fields. Bookingdate_c - today() > 0

Oracle Sales Cloud - Groovy

1. Use getPrimaryRowState().isNew() instead of getPrimaryRowState().isNew()==true

2. Don’t use variable to do get and then set , Instead use setAttribute('AccountName_c',nvl(var_record.getAttribute('AccountName_c'),''))

3. Use PartyId or RecordId instead of other fields for search when searching across objects

4. Set Dynamic Choice list field using Id instead of directly setting field

5. Where there is direct Read only not based on any condition we should use Page Composer instead of 1==2

6. Always make sure that code in BeforeUpdate is conditional. It should not get trigger everytime update is happening

Monday, May 16, 2016

Oracle Sale Cloud - Goovy Syntax

Following are some syntax of groovy used in OSC- Oracle Sales Cloud while doing scripting.

1. setAttribute('FieldName_c',var) - Set a Field value of Object

2. getOriginalAttributeValue("Priority_c") - This syntax is to get Original value of Field commonly useful for Audit requirements.

3. def var=getAttribute('Field1_c') - To get value of a field.

4. PreferredDistributor_Obj_c?.Country - To get value of Country of a object

5. getEstimatedRowCount() - To get number of records.

6. def user = adf.context.getSecurityContext()?.getUserProfile()?.getUserID(); - To get Login user detail.

7. def sNewOpty = adf.userSession.userData.NewOpty - To get Session Attribute

8. def Role = getSelectedListDisplayValue('Role_c'); - Returns Display value of LOV

9. def PartnerId = adf.util.getUserPartnerCompanyId(); - Partner detail

10. throw new oracle.jbo.ValidationException('Budget field is required.') - throws error message

Oracle Sales Cloud

Started working on Oracle Sales Cloud, A cloud based application for Sales. It is very light application with less features. May be in next versions Oracle will come up with more features.