IRB Exchange Client
In order to interact with the IRB Exchange, you will need methods in your code to get the IRB Exchange client for the correct IRB Exchange account and endpoint for each situation.
There are two scenarios to support:
- Get the IRB Exchange client for a given IRB Exchange account name and the store's default endpoint.
- Get the IRB Exchange client for an IRB submission's IRB Exchange account name and the store's default endpoint.
Get IRB Exchange Client for Given Account Name
ClickIRBUtils.getExchangeClient Method Example
/** Gets the exchange client for the store.
@param accountName (string) The account name selected on the admin office for communicating with the IRB Exchange as.
@return IRBExchangeClient
**/
function getExchangeClient(accountName) {
if(EntityUtils.EntityTypeExists("IrbExchange")){
return IrbExchange.GetIrbExchangeForAccountName(accountName);
}
throw new Error("The Portal IRB Client Library is not installed");
}
Technical note about this method example:
- The
IrbExchange.GetIrbExchangeForAccountName
method gets the IRB Exchange client for the account with the given name and the store's default endpoint.
Get IRB Exchange Client for an IRB Submission
_IRBSubmission.getIrbExchangePoRef Method Example
/** Get the IrbExchange poRef for this submission based on its admin office
@return (string) poRef of the IrbExchange entity correlating to this submission
**/
function getIrbExchangePoRef() {
var accountName = this.getQualifiedAttribute("customAttributes.IRB.customAttributes.iRBExchangeAccountName");
if(accountName != null) {
return ClickIRBUtils.getExchangeClient(accountName) + "";
}
return null;
}