Safe Function in CPQ to retrieve QuoteHed.reference

We utilize the QuoteHed.Reference field in lieu of the QuoteHed.QuoteNum on our Quotes. The reasoning for this is that we have historically kept the same Quote # for our Customer for a project, just adding a Rev. at the end.

So if we have Quote 181012, and the Customer asked for a revision, we cannot copy the Quote into 181012R01. So when they copy the Quote, it becomes, say, 181071, and we enter 181012R01 into the Reference field in the Header. This is so the Customer as well as us can track the revision history easier. I’m sure there are other ways to do this but its where we are now.

In CPQ, I can extract the key “kineticQuoteNumber” from the parameters map. But now, I need to get the QuoteHed.Reference field. So I am trying to use a Safe Function that runs in the Loaded ruleset.

https://centralusdtpilot79.epicorsaas.com/SaaS5395Pilot/api/v2/odata/\\[MY COMPANY]/Erp.BO.QuoteSvc/Quotes?api-key=[MY API-KEY]&$filter=QuoteNum%20eq%[MyQuoteNo]&$select=Reference”

The Safe Function is set to use an HTTP call using a rest client. If I enter the above in an URL, I am prompted for a username/password, and get what I am after. However, if I use the same URL in the HTTP call, whether I use basic authorization or a Base-64 for a Header, I always get:

Error Code: 500: Object reference not set to an instance of an object.

Anyone have experience in this arena?

Resolved. I had added a declaration for a restClient before the HTTP call and added a BaseURL. This in turn added that BaseURL and the whole URL in the HTTP call, thus almost duplicating the entire URL.