Difference between revisions of "GetResourceGuid"

From Catglobe Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
====getResourceGuid====
 
====getResourceGuid====
  
Returns the resource's Guid by its type and id or its unique id.
+
Returns the resource's Guid  
  
 
'''Syntax'''
 
'''Syntax'''
  
getResourceGuid(''resourceType, id'')
+
getResourceGuid(''resourceType, LegacyId'')  
 +
 
 +
This function is obsolete with 2 parameters, only implemented for questionnaire and PQ, others resource type will throw error
  
 
or
 
or
  
getResourceGuid(''uniqueId'')
+
getResourceGuid(''ResourceId'')
  
 
'''Arguments'''
 
'''Arguments'''
Line 18: Line 20:
 
''resourceType: ''Is a number expression. It must be one of the pre-defined constants specified in ''getResourceTypeFromGuid ''function.
 
''resourceType: ''Is a number expression. It must be one of the pre-defined constants specified in ''getResourceTypeFromGuid ''function.
  
''id'': Is a number expression. It is the id of the resource with its specific type.
+
''LegacyId'': Is a number expression. It is the Legacy id of the resource with its specific type.
  
''uniqueId'': Is a number expression. It is the unique id of the resource.
+
''ResourceId'': Is a number expression. It is the resource id.
  
 
'''Return type'''
 
'''Return type'''
Line 28: Line 30:
 
'''Examples'''
 
'''Examples'''
  
string guid = getResourceGuid(Resource_Type_User, 1);
+
string guid = getResourceGuid(Resource_Type_Questionnaire, 1);
 
 
//guid == getResourceGuid(123), with 123 is the unique id of user with id = 1
 
  
'''Availability'''
+
or
  
Version 5.4
+
string guid == getResourceGuid(123); // with 123 is resource id of the legacyId 1
__NOTOC__
 
<!-- imported from file: 4151.htm-->
 

Latest revision as of 10:48, 21 August 2023



getResourceGuid

Returns the resource's Guid

Syntax

getResourceGuid(resourceType, LegacyId)

This function is obsolete with 2 parameters, only implemented for questionnaire and PQ, others resource type will throw error

or

getResourceGuid(ResourceId)

Arguments

resourceType: Is a number expression. It must be one of the pre-defined constants specified in getResourceTypeFromGuid function.

LegacyId: Is a number expression. It is the Legacy id of the resource with its specific type.

ResourceId: Is a number expression. It is the resource id.

Return type

string

Examples

string guid = getResourceGuid(Resource_Type_Questionnaire, 1);

or

string guid == getResourceGuid(123); // with 123 is resource id of the legacyId 1