Opportunity Web Picker - Person Validate script Issue

I have written a custom validation script for the person field in the Opportunity Web Picker screen of Create New Opportunity. The script is shown below:

var person = eWare.FindRecord('Person', 'pers_personid='+Values('oppo_primarypersonid'));

var brnch = Values('oppo_branchid');

if (brnch != null && brnch != '') {

if (person != null) {

if (person.pers_branchid != brnch) {

Valid = false;

ErrorStr = "The person selected does not belong to this branch. Please re-select the person";

}

} else {

Valid = false;

ErrorStr = "The person selected cannot be found";

}

}

Where branchid links to a custom entity called Branch

The script works perfectly on the customer's test server but not on their live server even though Sage 200 CRM is identical on both servers. On the test server, the person validates correctly but on the live server, the person validation fails with the person does not belong to this branch error. The same Branch - Person combination was used on each server.

Please can you advise me what could be causing this difference in script behaviour. The version of CRM is 7.3 SP 1.3 .

  • 0

    OK so assuming the software is the same version, and the data is the same in both systems, then what about your user in the test system versus the user in the production system - could there be territory or other user restrictions preventing the person being found? Are you testing both using non-admin users?