Fx.object:和對(duì)象操作有關(guān)的API
1、創(chuàng)建業(yè)務(wù)對(duì)象-create
普通新建:Fx.object.create(<String apiName>,<Map objectData>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectData | 對(duì)象數(shù)據(jù)即字段值 |
data返回值類型:Map
舉例:
def(Boolean error,Map data,String errorMessage) = Fx.object.create("CustomObject__c",["name":"測(cè)試"])
注意:
預(yù)設(shè)對(duì)象禁止使用本API創(chuàng)建,請(qǐng)使用<對(duì)象創(chuàng)建同時(shí)新建從對(duì)象>API創(chuàng)建預(yù)設(shè)對(duì)象。
此函數(shù)不會(huì)觸發(fā)新建對(duì)象業(yè)務(wù)邏輯(判斷權(quán)限、觸發(fā)審批流工作流等)。
對(duì)象創(chuàng)建同時(shí)新建從對(duì)象:Fx.object.create(<String apiName>,<Map<String,Map> objectData>,<Map details>,<boolean withBizLogic>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectData | 主對(duì)象數(shù)據(jù)即字段值 |
details | 從對(duì)象數(shù)據(jù) |
withBizLogic | 是否執(zhí)行業(yè)務(wù)邏輯,默認(rèn)為true(該屬性已經(jīng)廢除,無(wú)法生效。如果需要執(zhí)行業(yè)務(wù)邏輯,請(qǐng)使用ActionAttribute參數(shù)) |
data返回值類型:Map
舉例:
def(Boolean error,Map data,String errorMessage) = Fx.object.create("object_2fJ1o__c",["name":"主從同時(shí)新建主1"],["object_Ssm46__c":[["name":"張三1"]]],true)
注意:
主對(duì)象創(chuàng)建同時(shí)新建從對(duì)象,從對(duì)象可以傳空值。
此函數(shù)不會(huì)觸發(fā)新建對(duì)象業(yè)務(wù)邏輯(withBizLogic參數(shù)已廢棄無(wú)效)。
對(duì)象創(chuàng)建同時(shí)新建從對(duì)象(ActionAttribute):Fx.object.create(<String apiName>,<Map<String,Map> objectData>,<Map details>,<ActionAttribute attribute>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectData | 主對(duì)象數(shù)據(jù)即字段值 |
details | 從對(duì)象數(shù)據(jù) |
attribute | triggerApprovalFlow:是否觸發(fā)審批流 triggerWorkflow:是否觸發(fā)工作流 skipFunctionAction:是否跳過(guò)前后動(dòng)作函數(shù),這個(gè)參數(shù)設(shè)置為true,前后動(dòng)作的函數(shù)都會(huì)跳過(guò) specifyCreatedBy:默認(rèn)的創(chuàng)建人是系統(tǒng),通過(guò)參數(shù)指定在objectData中設(shè)置指定的key:<created_by:List<String>>傳入人員的id可以設(shè)置創(chuàng)建人 specifyTime:指定創(chuàng)建時(shí)間,默認(rèn)的創(chuàng)建時(shí)間是當(dāng)前時(shí)間,通過(guò)指定參數(shù)可以在objectData中設(shè)置指定的key:create_time,可以設(shè)置創(chuàng)建時(shí)間,時(shí)間的格式是毫秒時(shí)間戳 使用方法詳見下方示例 |
data返回值類型:Map
舉例:
ActionAttribute attribute = ActionAttribute.build { triggerApprovalFlow = false triggerWorkflow = false skipFunctionAction = true specifyCreatedBy = true specifyTime = true } def ret = Fx.object.create("AccountObj",["name":"1234",created_by:["1000"],create_time:1600414877000],null,attribute) Fx.log.info(ret)
注意:
主對(duì)象創(chuàng)建同時(shí)新建從對(duì)象,從對(duì)象可以傳空值。
2、批量新建-batchCreate
批量新建:
Fx.object.batchCreate(<String apiName>,<List<Map> objectData>)
Fx.object.batchCreate(<String apiName>,<List<Map> objectData>,<boolean triggerWorkflow>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectData | 對(duì)象數(shù)據(jù)即字段值 |
triggerWorkflow | 是否觸發(fā)工作流,默認(rèn)為false |
data返回值類型:List
舉例:
def(Boolean error,List data,String errorMessage) = Fx.object.batchCreate("AccountObj",[["name":"客戶1"],["name":"客戶2"]],true)
注意:
預(yù)設(shè)對(duì)象不推薦使用這個(gè)API批量創(chuàng)建。
batch類函數(shù)不會(huì)不會(huì)觸發(fā)某些對(duì)象業(yè)務(wù)邏輯(判斷權(quán)限、觸發(fā)審批流等),是否觸發(fā)工作流由參數(shù)控制。
3、更新業(yè)務(wù)對(duì)象-update
定義:
Fx.object.update(<String apiName>,<String objectDataId>,<Map objectData>)
Fx.object.update(<String apiName>,<String objectDataId>,<Map objectData>, <boolean triggerWorkflow>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectDataId | 對(duì)象實(shí)例的ID |
objectData | 對(duì)象數(shù)據(jù)即字段值 |
triggerWorkflow | 是否觸發(fā)工作流,默認(rèn)為true |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.update("AccountObj","id123456",["name":"紛享銷客"],false)
注意:此函數(shù)不會(huì)觸發(fā)部分更新對(duì)象業(yè)務(wù)邏輯(判斷權(quán)限、觸發(fā)審批流等),是否觸發(fā)工作流由參數(shù)控制。
4、批量更新業(yè)務(wù)對(duì)象-batchUpdate
定義:Fx.object.batchUpdate(<String apiName>,<Map<String,Map> objectData>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectData | 對(duì)象數(shù)據(jù)即字段值(key值為對(duì)象ID) |
data返回值類型:List
舉例:
def (Boolean error,List data,String errorMessage) = object.batchUpdate("AccountObj",["e6a338ae8a944cdfb2bae737db1aa12f":["name":"客戶1"],"4cd5a9f902af4f66a34df35a53630237":["name":"客戶2"]])
注:batch類函數(shù)不會(huì)不會(huì)觸發(fā)對(duì)象業(yè)務(wù)邏輯(判斷權(quán)限、觸發(fā)審批流工作流等)。
5、按業(yè)務(wù)對(duì)象Id查詢業(yè)務(wù)對(duì)象數(shù)據(jù)象-findById
定義:Fx.object.findById(<String apiName>,<String objectDataId>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectDataId | 對(duì)象實(shí)例的ID |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.findById("AccountObj","e6a338ae8a944cdfb2bae737db1aa12f")
6、批量按業(yè)務(wù)對(duì)象Id查詢業(yè)務(wù)對(duì)象數(shù)據(jù)-findByIds
定義:Fx.object.findByIds(<String apiName>,<List objectDataIds>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectDataIds | 對(duì)象實(shí)例的ID的List |
data返回值類型:List
舉例:
def (Boolean error,List data,String errorMessage) = Fx.object.findByIds("AccountObj",["e6a338ae8a944cdfb2bae737db1aa12f","4cd5a9f902af4f66a34df35a53630237"])
7、按查詢條件查詢業(yè)務(wù)對(duì)象-find
普通查詢:Fx.object.find(<String apiName>,<List<Map> criteria>,<BigDecimal limit>,<BigDecimal skip>) 參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
criteria | 查詢條件 |
limit | 限制查詢條數(shù),最大100條,如超過(guò)返回100條,使用skip參數(shù)分批查詢 |
skip | 跳過(guò)多少數(shù)據(jù) |
data返回值類型:QueryResult
舉例:
def (Boolean error,QueryResult data,String errorMessage) = Fx.object.find("AccountObj",[["name":"紛享銷客"],["create_time": Operator.GT(1602325440000)]],10,0);
查詢并排序:Fx.object.find(<String apiName>,<List<Map> criteria>,<Map orderBy>,<BigDecimal limit>,<BigDecimal skip>) 參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
criteria | 查詢條件 |
limit | 限制查詢條數(shù),最大100條,如超過(guò)返回100條,使用skip參數(shù)分批查詢 |
orderBy | 排序規(guī)則 key:按哪個(gè)字段排序,字段名稱 ;value:1 - 升序,-1 - 降序 |
skip | 跳過(guò)多少數(shù)據(jù) |
data返回值類型:QueryResult
舉例:
def (Boolean error,QueryResult data,String errorMessage) = Fx.object.find("AccountObj",[["name":"分享逍客"],["create_time": Operator.GT(1602325440000)]],["name":1],10,0);
使用用戶身份查詢數(shù)據(jù):Fx.object.find(<String apiName>,<List<Map> criteria>,<Map orderBy>,<BigDecimal limit>,<BigDecimal skip>,<Boolean useCurrentIdentity>) 參數(shù)說(shuō)明:
參數(shù) |說(shuō)明 -|- apiName | 對(duì)象的api名稱 criteria | 查詢條件 limit | 限制查詢條數(shù),最大100條,如超過(guò)返回100條,使用skip參數(shù)分批查詢 orderBy | 排序規(guī)則 key:按哪個(gè)字段排序,字段名稱 ;value:1 - 升序,-1 - 降序 skip | 跳過(guò)多少數(shù)據(jù) useCurrentIdentity | 是否使用用戶身份。注意流程后動(dòng)作執(zhí)行的函數(shù),用戶的身份依舊是系統(tǒng)。其他函數(shù)使用場(chǎng)景,例如按鈕點(diǎn)擊,可以獲取用戶的身份。
data返回值類型:QueryResult
舉例:
def (Boolean error,QueryResult data,String errorMessage) = Fx.object.find("AccountObj",[["name":"分享逍客"],["create_time": Operator.GT(1602325440000)]],["name":1],10,0,true);
Fx.object.find方法中的條件語(yǔ)句(使用Operator.調(diào)用,如 Operator.GT(1602325440000))如下:
說(shuō)明 | 代碼格式 |
---|---|
判斷相等 | EQ(<Object str>) 文本查詢條件區(qū)分大小寫 |
判斷不相等 | NE(<Object str>) |
判斷大于 | GT(<Object str>) |
判斷小于 | LT(<Object str>) |
判斷大于等于 | GTE(<Object str>) |
判斷小于等于 | LTE(<Object str>) |
判斷是否包含 | LIKE(<String str>) 文本查詢條件不區(qū)分大小寫 |
判斷不包含 | NLIKE(<String str>) |
判斷屬于其中一個(gè) | IN(<List str>) |
判斷不屬于其中 | NIN(<List list>) |
判斷字段是否有值 | EXISTS(<boolean ex>) |
注意
條件中的日期格式使用毫秒時(shí)間戳
8、作廢業(yè)務(wù)對(duì)象-remove
定義:Fx.object.remove(<String apiName>,<String objectDataId>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的api名稱 |
objectDataId | 對(duì)象實(shí)例的ID |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.remove("AccountObj","ed47841898054749a2ec9be9e6e5d728")
9、更換負(fù)責(zé)人-changeOwner
定義:Fx.object.changeOwner(<String objectAPIName>,<String ObjectDataId>,<String OwnerId>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
objectAPIName | 對(duì)象的api名稱 |
objectDataId | 對(duì)象實(shí)例的ID |
owner | 要變更的負(fù)責(zé)人的用戶ID |
無(wú)返回值
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.changeOwner("AccountObj","ed47841898054749a2ec9be9e6e5d728","1001")
定義(ActionAttribute參數(shù)):Fx.object.changeOwner(<String objectAPIName>,<String objectDataId>,<String ownerId>,<ActionAttribute attribute>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
objectAPIName | 對(duì)象的api名稱 |
objectDataId | 對(duì)象實(shí)例的ID |
ownerId | 要變更的負(fù)責(zé)人的用戶ID |
attribute | 控制觸發(fā)行為 |
ActionAttribute attribute = ActionAttribute.build{ //跳過(guò)審批流 triggerApprovalFlow = false //跳過(guò)工作流 triggerWorkflow = false //跳過(guò)前后動(dòng)作函數(shù) skipFunctionAction = true } Fx.object.changeOwner("APIName","objectId","ownerId",attribute)
10、添加團(tuán)隊(duì)成員-addTeamMember
定義:Fx.object.addTeamMember(<String ObjectAPIName>,<String ObjectDataId>,<List UserIdList>,<Integer Role>,<Integer Permission>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
ObjectAPIName | 對(duì)象的api名稱 |
ObjectDataId | 對(duì)象實(shí)例的ID |
UserIdList | 添加的團(tuán)隊(duì)成員的用戶ID的List |
Role | 添加的團(tuán)隊(duì)成員的角色:1-負(fù)責(zé)人,2-聯(lián)合跟進(jìn)人,3-售后服務(wù)人員,4-普通成員 |
Permission | 添加的團(tuán)隊(duì)成員的權(quán)限:1-只讀,2-讀寫 |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.addTeamMember("AccountObj","83cf73d957924284a96e9c44ebb333ec",["1001"],4,1)
注:不能添加負(fù)責(zé)人;如果添加的成員包括負(fù)責(zé)人,則不會(huì)修改負(fù)責(zé)人數(shù)據(jù);如果添加的成員在原系統(tǒng)中有重復(fù)的則更新該成員
11、刪除團(tuán)隊(duì)成員-deleteTeamMember
定義:Fx.object.deleteTeamMember(<String ObjectAPIName>,<String ObjectDataId>,<List UserIdList>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
ObjectAPIName | 對(duì)象的api名稱 |
ObjectDataId | 對(duì)象實(shí)例的ID |
UserIdList | 刪除的團(tuán)隊(duì)成員的用戶ID的List |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.deleteTeamMember("AccountObj","83cf73d957924284a96e9c44ebb333ec",["1001"])
12、編輯團(tuán)隊(duì)成員-editTeamMember
定義:Fx.object.editTeamMember(<String ObjectAPIName>,<String ObjectDataId>,<List<Map> TeamMemberList>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
ObjectAPIName | 對(duì)象的api名稱 |
ObjectDataId | 對(duì)象實(shí)例的ID |
TeamMemberList | 要編輯團(tuán)隊(duì)成員的信息的List(key值包括:userID:用戶ID;role:用戶角色;permisson:用戶權(quán)限,具體參考7) |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.editTeamMember("AccountObj","36fd270a986842529445bf3d252cca9b",[["userId":"1058","role":4,"permission":1],["userId":"1057","role":3,"permission":2]])
13、獲取團(tuán)隊(duì)成員-getTeamMember
定義:Fx.object.getTeamMember(<String objectAPIName>,<String objectId>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
objectAPIName | 對(duì)象的api名稱 |
objectId | 對(duì)象實(shí)例的ID |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.getTeamMember("AccountObj","83cf73d957924284a96e9c44ebb333ec")
14、添加外部團(tuán)隊(duì)成員-addOutTeamMember
定義:Fx.object.addOutTeamMember(String apiName,String objectId,int permission,List<Map> employee)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的apiname |
objectId | 對(duì)象實(shí)例的ID |
permission | 外部團(tuán)隊(duì)成員權(quán)限 1:只讀 2:讀寫 |
employee | 員工信息,其中Map包括【 userId:?jiǎn)T工Id ; outTenantId:外部企業(yè)id】 |
data返回值類型:String
舉例:
def (Boolean error,String data,String errorMessage) = Fx.object.addOutTeamMember('AccountObj',id,1,[['userId':'1001','outTenantId':'590057']])
15、獲取單選/多選業(yè)務(wù)名稱/選項(xiàng)名稱-getOptionName
定義:Fx.object.getOptionName(<String objectAPIName>,<String filedAPIName>,<String value>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
objectAPIName | 對(duì)象的api名稱 |
filedAPIName | 字段的api名稱 |
value | 單選/多選的值 |
data返回值類型:Map
舉例:
def (Boolean error,String data,String errorMessage) = Fx.object.getOptionName("AccountObj","lock_status","0")
16、根據(jù)映射規(guī)則創(chuàng)建數(shù)據(jù)-copyByRule
根據(jù)映射規(guī)則新建(不能添加額外的字段):Fx.object.copyByRule(<String sourceApiName>,<String sourceId>,<String ruleApiName>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
sourceApiName | 被映射的對(duì)象Api Name |
sourceId | 被映射的對(duì)象實(shí)例的ID |
ruleApiName | 映射規(guī)則API Name |
data返回值類型:Map
舉例:
def (Boolean error,Map data,String errorMessage) = Fx.object.copyByRule('object_ejyW2__c','5d308dc0b5a2bf0001b0bfc2','map_btp50__c')
根據(jù)映射規(guī)則直新建(同時(shí)新建從對(duì)象):Fx.object.copyByRule(<String sourceApiName>,<String sourceId>,<String ruleApiName>,<Map plus>, <Map detailPlus>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
sourceApiName | 被映射的對(duì)象Api Name |
sourceId | 被映射的對(duì)象實(shí)例的ID |
ruleApiName | 映射規(guī)則API Name |
plus | 主對(duì)象數(shù)據(jù)參數(shù) |
detailPlus | 從對(duì)象數(shù)據(jù)參數(shù) |
data返回值類型:Map
舉例:
Map plus = ["field_ZszsOc": "18800154471"]; Map detailValues1 = ["field_z5AI0c": "data1填充內(nèi)容"]; Map detailValues2 = ["field_z5AI0c": "data2填充內(nèi)容"]; List detailFillValueList= []; detailFillValueList.add( detailValues1); detailFillValueList.add( detailValues2); Map detailPlus = ["object_6hN1ic": detailFillValueList] def (Boolean error,Map data,String errorMessage) = Fx.object.copyByRule('object_ob2G0__c','5cedf0137cfed9b33b75ddaa','map_797K4__c',plus,detailPlus)
17、數(shù)據(jù)鎖定/解鎖-lock/unlock
數(shù)據(jù)鎖定:Fx.object.lock(String apiName , String objectId , boolean cascadeDetail)
數(shù)據(jù)解鎖:Fx.object.unlock(String apiName , String objectId , boolean cascadeDetail)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的apiname |
objectId | 對(duì)象實(shí)例id |
cascadeDetail | 是否鎖定/解鎖從對(duì)象 |
data返回值類型:null
舉例:
def (Boolean error,data,String errorMessage) =Fx.object.lock('AccountObj' , 'e6a338ae8a944cdfb2bae737db1aa12f' , true)
18、聚合計(jì)算-aggregate
定義:Fx.object.aggregate(String apiName,Aggregate type,int decimalScale,List criteria)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的apiname |
Aggregate | 計(jì)算類型 |
decimalScale | 小數(shù)位數(shù) |
criteria | 查詢條件(和find查詢條件使用一樣) |
其中計(jì)算類型:
Aggregate.SUM(String fieldApiName) 求和
Aggregate.COUNT() 計(jì)算數(shù)量
Aggregate.MAX(String fieldApiName) 最大值
Aggregate.MIN(String fieldApiName) 最小值
Aggregate.AVG(String fieldApiName) 平均值
data返回值類型:String
舉例:
def (Boolean error,String data,String errorMessage) =Fx.object.aggregate("object_rqa45__c",Aggregate.AVG("field_VE1by__c"),2,[["name":Operator.LIKE("name")])
19、查詢包括作廢數(shù)據(jù)的API - findIncludeInvalided
定義:Fx.object.findIncludeInvalided(String apiName, List criteria, int limit, int skip); Fx.object.findIncludeInvalided(String apiName,List criteria,Map orderBy ,int limit ,int skip); 傳參、返回值和調(diào)用方法參考find函數(shù)。
20、單多選/業(yè)務(wù)類型查詢 - getOptionInfo
定義:Fx.object.getOptionInfo(String apiName,String fieldAPIName);
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象的apiname |
fieldAPIName | 單多選/業(yè)務(wù)類型的API名稱 |
data返回值類型:map(label -> value , value -> label 的雙向映射)
舉例:
def(boolean error,Map result,String errorMessage) = Fx.object.getOptionInfo("object_i66LR__c","record_type")
21、批量鎖定/解鎖- batchLock/batchUnlock
鎖定:Fx.object.batchLock(String apiName,List objectIds,boolean cascadeDetail);
解鎖:Fx.object.batchUnlock(String apiName,List objectIds,boolean cascadeDetail);
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象APIName |
objectIds | 數(shù)據(jù)id |
cascadeDetail | 是否遞歸鎖定從對(duì)象數(shù)據(jù) |
data返回值類型:無(wú)
舉例:
def (Boolean error,data,String errorMessage) =Fx.object.batchLock('AccountObj' , ["e6a338ae8a944cdfb2bae737db1aa12f"] , true) def (Boolean error,data,String errorMessage) =Fx.object.batchUnlock('AccountObj' , ["e6a338ae8a944cdfb2bae737db1aa12f"] , true)
22、批量作廢- bulkRemove
定義
Fx.object.bulkRemove(String apiName,List<String> objectIds)
Fx.object.bulkRemove(String apiName,List<String> objectIds, ActionAttribute attribute)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
apiName | 對(duì)象APIName |
objectIds | 數(shù)據(jù)id |
ActionAttribute | triggerApprovalFlow:是否觸發(fā)審批流(這個(gè)參數(shù)true才有效,因?yàn)榕孔鲝U是異步的,不管有沒(méi)有配置審批流都不會(huì)觸發(fā)審批流) triggerWorkflow:是否觸發(fā)工作流 skipFunctionAction:是否跳過(guò)前后動(dòng)作函數(shù),這個(gè)參數(shù)設(shè)置為true,前后動(dòng)作的函數(shù)都會(huì)跳過(guò) 使用方法詳見下方示例 |
data返回值類型:Map,包含objectDataList,里面是刪除的對(duì)象數(shù)據(jù)
舉例:
ActionAttribute attribute = ActionAttribute.build{ triggerApprovalFlow = false triggerWorkflow = false skipFunctionAction = true } def ret = Fx.object.bulkRemove("object_oMTq9__c",objectIds,attribute) Fx.log.info(ret)object.batchUnlock('AccountObj' , ["e6a338ae8a944cdfb2bae737db1aa12f"] , true)
23、批量更換負(fù)責(zé)人-batchChangeOwner
定義:Fx.object.batchChangeOwner(<String objectAPIName>,<List<Map> datas>,<ActionAttribute attribute>)
參數(shù)說(shuō)明:
參數(shù) | 說(shuō)明 |
---|---|
objectAPIName | 對(duì)象的api名稱 |
datas | 要變更的負(fù)責(zé)人的數(shù)據(jù)ID和用戶ID |
attribute | 控制觸發(fā)行為 |
無(wú)返回值
舉例:
``` Map changeData1 = [ "objectId":"5f86b47b1bdac00001f2c300", "ownerId":["-10000"] ] Map changeData2 = [ "objectId":"5f86b4a71bdac00001f2d232", "ownerId":["-10000"] ] List arg = [changeData1,changeData2] def ret = Fx.object.batchChangeOwner("object_i66LR__c",arg, attribute) Fx.log.info(ret) ```