Fx.tag

Fx.tag: processing tag function

1. Query tag definition

Fx.tag.findTagDefine(<String objectApiName>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| objectApiName | String | Object API name |

return type

APIResult

Return value description

queryResult returns tag information: tag id, tag name, tag API name, tag description, tag group

Java example

APIResult ret = Fx.tag.findTagDefine("object_76is3__c");
log.info(ret.getData());

Groovy example

def (Boolean error,QueryResult data,String errorMessage) = Fx.tag.findTagDefine("object_76is3__c")
log. info(data)

2. Find all tags on a piece of data

Fx.tag.findTagById(<String objectApiName>, <String dataId>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| objectApiName | String | Object API name |
| dataId | String | The data id of the updated tag |

return type

APIResult

Return value description

queryResult returns tag information: tag id, tag name

Java example

APIResult ret = Fx.tag.findTagById( "NewOpportunityObj", "5f62c3f577187e0001d4a845");
log.info(ret.getData());

Groovy example

def (Boolean error,List data,String errorMessage) = Fx.tag.findTagById( "NewOpportunityObj", "5f62c3f577187e0001d4a845")
log. info(data)

3. Update the label of the data

Fx.tag.update(<String objectApiName>, <String dataId>, <List tagIdList>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| objectApiName | String | Object API name |
| dataId | String | The data id of the updated label|
| tagIdList | List | Tag ids updated to data (overwrite update) |

return type

APIResult

Return value description

map (data returns the tagged data id after success)

Java example

APIResult ret = Fx.tag.update("object_76is3__c", "5f4dc0100c0ab60001724e74", Lists.newArrayList("5eb4ce6378c8c000018f67a3"));
log.info(ret.getData());

Groovy example

def (Boolean error,String data,String errorMessage) = Fx.tag.update("object_76is3__c", "5f4dc0100c0ab60001724e74", ["5eb4ce6378c8c000018f67a3"])
log. info(data)

4. Create tags

Fx.tag.createTag(<TagArg tagArg>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| tagArg | TagArg | See the tag parameter description below for details |

return type

APIResult

Return value description

Java example

final TagArg arg = TagArg. builder()
        .groupId("5ea3b0e5e1a70b0001e2f65b")
        .tagApiName("tag_scDwW__c")
        .tagName("Function create tag 1-fj")
        .description("test001")
        .build();
final APIResult result = Fx.tag.createTag(arg);

Groovy example

def arg = TagArg. builder()
        .groupId("5ea3b0e5e1a70b0001e2f65b")
        .tagApiName("tag_scDwW__c")
        .tagName("Function create tag 1-fj")
        .description("test001")
        .build();
def result = Fx. tag. createTag(arg)

(1). Reference TagArg


5. Update tags

Fx.tag.updateTag(<TagArg tagArg>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| tagArg | TagArg | See the tag parameter description below for details |

return type

APIResult

Return value description

Java example

TagArg arg = TagArg. builder()
       .tagId("61b950f0fb62ec0001772c63")
       .groupId("5ec78e7f520f4000019ac54a")
       .tagName("Function create tag 03-fj")
       .dedescription("update label 3")
       .build();
APIResult result = Fx.tag.updateTag(arg);

Groovy example

def arg = TagArg. builder()
       .tagId("61b950f0fb62ec0001772c63")
       .groupId("5ec78e7f520f4000019ac54a")
       .tagName("Function create tag 03-fj")
       .description("Update label 3")
       .build()
def result = Fx. tag. updateTag(arg)

(1). Reference TagArg


6. Create label groups

Fx.tag.createTagGroup(<List describe_api_names>, <String api_name>, <Boolean is_applied_to_all>, <String tag_group_name>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| describe_api_names | List | List of objects to which this label group applies |
| api_name | String | group apiName |
| is_applied_to_all | Boolean | Whether to apply to all objects |
| tag_group_name | String | group name |

return type

APIResult

Return value description

Map

Groovy example

def (String message,Map data,Boolean error) = Fx.tag.createTagGroup(["AccountObj"],"group_ceshi11__c",false,"Test group name 123")

7. Modify label grouping

Fx.tag.updateTagGroup(<String api_name>, <String id>, <List describe_api_names>, <Boolean is_applied_to_all>, <String tag_group_name>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| api_name | String | group apiName |
| id | String | label group id |
| describe_api_names | List | List of objects to which this label group applies |
| is_applied_to_all | Boolean | Whether to apply to all objects|
| tag_group_name | String | group name |

return type

APIResult

Return value description

Map

Groovy example

def(String message,Map data,Boolean error) = Fx.tag.updateTagGroup("group_ceshi11__c","624272c1babe24000101d2e5",[],true,"Change test name")

8. Delete label group

Fx.tag.deleteTagGroup(<String id>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| id | String | label group id |

return type

APIResult

Return value description

Map

Groovy example

def(String message,Map data,Boolean error) = Fx.tag.deleteTagGroup("624272c1babe24000101d2e5")

9. Enable tags

Fx.tag.enableTag(<String tag_api_name>, <String tag_group_api_name>, <String tag_group_id>, <String tag_id>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| tag_api_name | String | tag apiName |
| tag_group_api_name | String | tag group apiName |
| tag_group_id | String | tag group id |
| tag_id | String | tag id |

return type

APIResult

Return value description

Map

Groovy example

def result = Fx.tag.enableTag("tag_scDwW__c","group_ceshi11__c","62427820babe24000101d80d","6242784d06e1bf00015f33ec")

10. Disable tags

Fx.tag.disableTag(<String tag_api_name>, <String tag_group_api_name>, <String tag_group_id>, <String tag_id>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ------------------------------------------- ----------------- |
| tag_api_name | String | tag apiName |
| tag_group_api_name | String | tag group apiName |
| tag_group_id | String | tag group id |
| tag_id | String | tag id |

return type

APIResult

Return value description

Map

Groovy example

def result = Fx.tag.disableTag("tag_scDwW__c","group_ceshi11__c","62427820babe24000101d80d","6242784d06e1bf00015f33ec")

11. Delete tags

Fx.tag.deleteTag(<String tag_api_name>, <String tag_group_api_name>, <String tag_group_id>, <String tag_id>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| tag_api_name | String | tag apiName |
| tag_group_api_name | String | tag group apiName |
| tag_group_id | String | tag group id |
| tag_id | String | tag id |

return type

APIResult

Return value description

Map

Groovy example

def result = Fx.tag.deleteTag("tag_scDwW__c","group_ceshi11__c","62427820babe24000101d80d","6242784d06e1bf00015f33ec")

12. Find label groups and their applicable objects according to apiName

Fx.tag.findTagGroup(<String group_api_name>)

Parameter Description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| group_api_name | String | group label apiName |

return type

APIResult

Return value description

Map

Groovy example

def (String message, Map data, Boolean error) = Fx.tag.findTagGroup("group_ceshi11__c")

Reference class com.fxiaoke.functions.model.TagArg

field description

| parameter | type | description |
| ------------ | ------------ | ----------------------- ----------------------------------------- |
| groupId | String | tag group id |
| groupApiName | String | optional parameter, |
| tagName | String | tag name |
| tagApiName | String | tag apiName |
| tagId | String | tag id |
| description | String | description |

2022-11-23
0 0