Thursday, August 18, 2016

Padding preceding zeros to Colleague ID

In Colleague, ID numbers often have preceding 0s, and these are often truncated as the data is imported into Colleague. To add a small check to the ID to make sure it always is 7 number-long, you can add the following:

* Add zeros padding to PERSON ID
X.PERSON.ID.LEN = LEN(A.PERSON.ID)
X.ZEROS.TO.PAD = 7 - X.PERSON.ID.LEN
IF (X.ZEROS.TO.PAD GT 0) THEN
   A.PERSON.ID = STR("0", X.ZEROS.TO.PAD) : A.PERSON.ID
END

Monday, June 20, 2016

Detail to screens cross applications

If you are familiar with the application tree in Colleague, you know we can detail (UI screen) from a process to another within the same environment, or up one level, but not to the adjunct application. The tree looks like this:

                        UT
                          |
                     CORE
                   /      |      \
               ST     HR     CA

A screen from ST can detail to another screen in ST, or CORE, or UT, but it can't go to HR or CA. There's a trick to make this happen. If you want to detail to a HR screen from ST, you can do this:

   CALL S.SESSION.INIT('HR')
   CALL_SCREEN SUSPEND HRS105($PRIMARY)
   CALL S.SESSION.INIT('ST')

This code would initialize all environment variables required from HR application, open the screen, then reinitialize the ST application. 

Credit:  Eric Small from eCommunities.

Monday, May 30, 2016

WebAPI connection exception Error Subset Found: Server error-00150-No response returned from the server

When writing a Colleague custom WebAPI, I encountered a connection error while executing a transaction:

[Ellucian.Data.Colleague.Exceptions.ColleagueTransactionException] = {"Error Subset Found: Server error-00150-No response returned from the server."}

I made sure my credential was correct and the connection was established before calling the transaction. After much debugging, I found out that the string that was passed to the transaction exceeded the size limit of a field in Colleague. I passed in a 15 character long string and tried to write it to a 10 character long field in Colleague through the transaction, and it resulted in a truncation error which ended the Colleague session. This also returned the error above. They do not look like they're related, so it was hard to track down. Make sure you check the size of the arguments of the transaction when you get these error.

Friday, May 13, 2016

Check if a record is locked

It is useful to check to see if the record is lock before beginning any processing. This eliminates the process to spin and wait for the record to be unlocked. When you work withe the WebAPI, it is more important to return a status of "resource is unavailable please try again" than to wait and risk the process timing out. To check to see if a record is locked, follow the below template:

XKV.FILE = V.BPV.DOC.IDS
XR.FILE = ""
CALL @MIO.READ.RECORD(MIO.READU.EXIT.ON.LOCKED,XFV.FILE,XKV.FILE,XR.FILE)
IF MIO.STATUS = MIO.STAT.LOCKED THEN ;* file is locked
   X.ERROR = 1
   * Output your message, set the status, or do some other process
END ELSE ;* record is not lock, proceed like normal
   * normal record read/write
END

The following give you different statuses of the lock check:


To read a record from a previously opened file.
@MIO.READ.RECORD(read_option, FV.FILE, KV.FILE, R.FILE)

Where FV.FILE is the previously opened file, KV.FILE is the key of the
record to be read, and R.FILE is the array into which the record will be
read.

Read_option is one of the following. These are equates so they should not
be surrounded by quotes.

MIO.READ - Reads the record without locking

MIO.READU - Reads the record and locks. If the record is already locked by
someone else, the user will get a message and will have the opportunity to
cancel the command.

MIO.READU.NO.CANCEL - Same as READU but without the option to cancel if the
record is locked.

MIO.READ.VERIFY - Checks to see if the record exists. R.FILE will be set to
1 if the record exists and 0 if the record does not exist. The entire
record is not read into the R.FILE variable if this option is used.

MIO.READ.ORIG - Will read the record from disk instead of from the MIO
memory buffers.

Tuesday, April 19, 2016

Modify/Compile Envision processes in the terminal

If you have access to Desktop UI's terminal, or connection to the unidata application layer, you can directly modify and compile envision processes. Altho this is not a recommended practice, it can come in handy when you need to put out fire quickly.

In the terminal, open the file you want to edit with command:

:AE ST.SUBROUTINES C70.S.MY.SUBROUTINE

You need to determine the location of the process you're trying to edit. If it's a FA subroutine, then then instead of ST.SUBROUTINES, use FA.SUBROUTINES.


You can search for the text using "/Text to search". After you find the line, to can go to that line by just typing in the line number. You can then replace the text with "C/"Text to be replaced"/"Text to replace with". After you are done editing, use the command "FIB" to File and Batch, which also compiles the process. Boom, you're done!



You can find more about AE editor here Unidata Command Refs

Saturday, March 5, 2016

self service "Could not validate this request's antiforgery token"

You may encounter this error while customizing Ellucian's self service. To fix this error, make sure you run the application in Local IIS, instead of IIS Express

After setting the default to Local IIS, you will want to delete all the cookies pertaining to the localhost. In chrome, go to Settings - Content Settings - All cookies and site data... then search for cookies belong to localhost

Delete these and try again. Similar steps should be taken with the browser you use to test self service.

Tuesday, February 9, 2016

How to find references to a field in SQL backend

This query will give you a good list of reference on a particular field. You can find all references to it from processes and screens. This requires you to have a SQL backend and a studio to query the database. Replace 'APPLICATIONS.ID' with name of the field you want to find reference.

declare @fieldName as varchar(20) = 'APPLICATIONS.ID'
SELECT PROCESS_NAME as 'Process ID', PROCESS_TYPE as 'Process Type', PROCESS_DIRECT_ACCESS_NAME as 'UI Mnemonic' from PRCS_DEF A left JOIN PRCS_CTL B
ON A.PROCESS_NAME = B.PROCESS_MNEMONIC
where PROCESS_DATA_ELEMENTS like '%'+@fieldName+'%' or
PROCESS_DEMAND_ELEMENTS like '%'+@fieldName+'%' or PROCESS_DEMAND_POINTERS like '%'+@fieldName+'%'
ORDER BY PROCESS_DIRECT_ACCESS_NAME DESC, PROCESS_TYPE 

The result would look something like this:


Tuesday, January 19, 2016

How to add ColleagueSDK to Visual Studio

ColleagueSDK for .NET allows you to add DataContract and Transactions from Colleague to your VS projects. You will need this if you want to compile/customize Ellucian Self Service. In this post I will use ColleagueSDK for .NET version 1.8 and MS 2013.

First, you can download the installer from SA Valet.


Run the .exe file and you will have this folder created.


Run ColleagueDataContractGenerator.vsix and the VS extension will be added to your local Microsoft Visual Studio. ColleagueSDK no longer supports VS 2010 and only supports 2012 and 2013 so far. Make sure you have one of those installed first.

To add Colleague parameters, double click on CollSDKParamsEditor.exe. You will see the editor as following:


Click on Help/View Help if you need help filling out the screen. This form requires similar information you use to login to Colleague Studio. Once you're done, hit File/Save to save your configuration file that you can then use in your VS project.

After the extension has been added to VS, you should be able to add DataContract or Colleague Transaction to your VS project.