Problem: When SAP connection properties bind to personalization keys in the mobile business object (MBO) definition, the generated Windows Mobile application throws a “No Argument exception” error when the user clicks the Submit button in the operation screen during runtime .
: // button (Submit) click event handler internal virtual void SubmitButton_Handler(FormsManagerDataObject dataObject)
Sybase.Persistence.Connection defaultConnection = Sybase.Persistence.ConnectionManager.Instance.DefaultConnection; PersonalizationKeyManager pkmgr = new PersonalizationKeyManager(); pkmgr.Initialize(); Dictionary<string, Personalization> pkmap = pkmgr.GetAllPersonalizationKey(); pkmgr.Dispose(); Sybase.Persistence.ConnectionManager.Instance.DefaultConnection = defaultConnection; ${operation.name}ParameterList.Add(pkmap["<personalization key >"].KeyValue); … … ${operation.name}ParameterList.Add(pkmap["<personalization key>"].KeyValue); ${operation.name}ParameterList.Add(parameterxxxx);
When adding personalization key values, you must follow the sequence that is shown in the MBO definition class ${operation.name} method parameter.
For example, when the method is defined as: public void Createfromdat1(System.String jco_client_passwd, System.String jco_client_user, System.String jco_client_client, System.String jco_client_sysnr, System.String jco_client_ashost,…) ,, the code should be entered this way:
createfromdat1ParameterList.Add(pkmap["<pk of password>"].KeyValue);//first
createfromdat1ParameterList.Add(pkmap["<pk of user>"].KeyValue);//second
createfromdat1ParameterList.Add(pkmap["<pk of clientID>"].KeyValue);//third
createfromdat1ParameterList.Add(pkmap["<pk of Sysnumber>"].KeyValue);//fourth
createfromdat1ParameterList.Add(pkmap["<pk of AppSer>"].KeyValue);//fifth