Code Not Populating the Business Relation field on Contact Business Relation table

Hi Guys, could anyone hazard a guess as to the following cde will not populated the Business Relationship field on the Contact Business Relations table in version 4 SP1

ContBusRel.INIT;
ContBusRel.“Contact No.” := Contact.“No.”;
// ContBusRel.“Business Relation Code” := RMSetup.“Bus. Rel. Code for Customers”;
ContBusRel.“Business Relation Code” := ‘CUSTNEW’;
ContBusRel.“Link to Table” := ContBusRel.“Link to Table”::Customer;
ContBusRel.“No.” := Customer.“No.”;
ContBusRel.INSERT;

as you can see, I gave up and hardcoded it in and before you ask, the Business Realtion Code is defined in Relationship Management Setup. All the other fields get populated correctly.

Thanks and I await your expert opinion

This might be obvious but did you do a RMSetup.get somewhere?

Is this our code or is it in an existing object? where?

Hi JohnCon, thanks for your help. Some background for you. This routine is an inhouse routine written by a previous NSC some 6 years ago in version 2.60. I upgraded them to version 4.0 6 months ago and this particular routine was not tested during the upgrade because it is only run once a year (yesterday) and no data was available until now. The routine failed because it was trying to read the Prospect table instead of the Contact table but also needed code to write to the Contact Business Relation Table added. However not being a developer I forgot to add a RMSetup.GET; to the code.

So you were 100% correct, I have added this line and it works perfectly.

Thanks very much for the answer it is very much appreciated…Paul [:D]