Api ASYRFNC.AGET_ASYRURL
This function returns a URL that accesses a class or representation page. The URL can be a full URL (used when the link is triggered from an external document such as an email embedding the link), or only a resource URL (used when the URL is in a client page).
The parameters are described below:
Code | Type and dimension | Contents |
---|---|---|
CTX | Variable Instance Using =[V]CST_C_NAME_CLASS_CONTEXT | The current context used (for error messages). |
FULLURL | Value Integer | Full URL ([V]CST_ATRUE or [V]CST_AFALSE)). |
REPRESENTATION | Value Char | The name of the representation. |
FACET | Value Integer | The facet used (can be [V]CST_AFAC_DETAILS, [V]CST_AFAC_EDIT, [V]CST_AFAC_QUERY, [V]CST_AFAC_LOOKUP, [V]CST_AFAC_SUMMARY). |
TABKEY | Value Array of Char | List of the key segments for the entity. |
TABKEYVAL | Value Array of Char | Values corresponding to property names defined in TABKEY. |
TABPAR | Value Array of Char | Additional parameter names that can be sent in the URL as parameters. |
TABPARVAL | Value Array of Char | Additional parameter values corresponding to parameter names defined in TABPAR. |
WURL | Variable Clbfile | The result URL. |
Example
CODECODE CODEsh
# Let's create a URL that accesses a given BANK detail.
Local Char TABKEY(50)(1..10),TABKEYVAL(50)(1..10),TABPAR(50)(1..10),TABPARVAL(250)(1..10)
Local Char REPRESENTATION(30)
Local Integer ASTATUS, FULLURL
Local Clbfile WURL
REPRESENTATION = "ABANK"
TABKEY(1)="CRY" : TABKEYVAL(1)="DE"
TABKEY(2)="BAN" : TABKEYVAL(2)="69490000"
FULLURL=[V]CST_ATRUE
ASTATUS = func ASYRFNC.AGET_SYRAURL(
& GACTX,FULLURL,REPRESENTATION,[V]CST_ADETAILS,TABKEY,TABKEYVAL,TABPAR,TABPARVAL,WURL)
# Let's imagine that the server address is http://my_server:8124, and the endpoint is MYFOLD
# After the execution of AGET_SYRURL function, WURL contains the following value:
# http://my_server:8124/syracuse-main/html/main.html?url=/api1/x3/erp/MYFOLD/ABANK('DE~69490000')?representation=ABANK.$details
FULLURL=[V]CST_AFALSE
ASTATUS = func ASYRFNC.AGET_SYRAURL(
& GACTX,FULLURL,REPRESENTATION,[V]CST_ADETAILS,TABKEY,TABKEYVAL,TABPAR,TABPARVAL,WURL)
# Now, because FULLUSR is false, the result is:
# /api1/x3/erp/MYFOLD/ABANK('DE~69490000')?representation=ABANK.$details
Api ASYRFNC.AGET_CLASSICURL
This function returns a URL that accesses a classic page.
The parameters are described below:
Code | Type and dimension | Contents |
---|---|---|
CTX | Variable Instance Using =[V]CST_C_NAME_CLASS_CONTEXT | The current context used (for error messages). |
FULLURL | Value Integer | Full URL ([V]CST_ATRUE or [V]CST_AFALSE)). |
FUNCTION | Value Char | The name of the function. |
MODE | Value Integer | The mode used, that can be creation mode ([V]CST_ACREATIONFCT) or edit mode ([V]CST_AMODIFFCT). |
TABKEY | Value Array of Char | List of the key segments for the entity. |
TABKEYVAL | Value Array of Char | Values corresponding to property names defined in TABKEY. |
TABPAR | Value Array of Char | Additional parameter names that can be sent in the URL as parameters. |
TABPARVAL | Value Array of Char | Additional parameter values corresponding to parameter names defined in TABPAR. |
WURL | Variable Clbfile | The result URL. |
Example
CODECODE CODEsh
# Let's create a URL that accesses a given BANK detail.
Local Char TABKEY(50)(1..10),TABKEYVAL(50)(1..10),TABPAR(50)(1..10),TABPARVAL(250)(1..10)
Local Char FUNCTION(30)
Local Integer ASTATUS, FULLURL
Local Clbfile WURL
FUNCTION = "GESABN"
TABKEY(1)="CRY" : TABKEYVAL(1)="DE"
TABKEY(2)="BAN" : TABKEYVAL(2)="69490000"
FULLURL=[V]CST_ATRUE
ASTATUS = func ASYRFNC.AGET_CLASSICURL(
& GACTX,FULLURL,FUNCTION,[V]CST_AMODIFFCT,TABKEY,TABKEYVAL,TABPAR,TABPARVAL,WURL)
# Let's imagine that the server address is http://my_server:8124, and the endpoint is MYFOLD
# After the execution of AGET_CLASSICURL function, WURL contains the following value:
# http://my_server:8124/syracuse-main/html/main.html?url=/trans/x3/erp/MYFOLD/$sessions?f=GESABN/2//M/69490000~DE
FULLURL=[V]CST_AFALSE
ASTATUS = func ASYRFNC.AGET_CLASSICURL(
& GACTX,FULLURL, FUNCTION,[V]CST_AMODIFFCT,TABKEY,TABKEYVAL,TABPAR,TABPARVAL,WURL)
# Now, because FULLUSR is false, the result is:
# /trans/x3/erp/MYFOLD/$sessions?f=GESABN/2//M/69490000~DE