Code to add a new BO Role in BO_ROLE table

import RB_BORM:BO:*;
import RB_CDM:ObjectCollection;

&oObjectCollection = create RB_CDM:ObjectCollection();
&oBO = &oObjectCollection.getBO(&inBOID);

/*Check to see if ROLE already exists*/
SQLExec("SELECT count(*) FROM PS_BO_ROLE R WHERE R.ROLE_END_DT > GETDATE() AND R.BO_ID = :1 AND R.ROLE_TYPE_ID =:2", &inBOID, &nRoleTypeId, &RoleExists);

If &RoleExists < 1 Then &oBO.addBORole(&nRoleTypeId);
End-If;

No comments:

Post a Comment