Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Transaction Patterns » add1 in shared account
add1 in shared account [message #5347] Thu, 28 January 2016 05:35 Go to next message
htManager is currently offline  htManager
Messages: 316
Registered: May 2014
Senior Member
Hello Tony,

is it possible to insert records from a normal account in a shared account?

I have a contact-pool table where all new inserted records should be available for everyone. I want to do this by changing the key values in $fieldarray[] (user_id, user_seq_no, rdcaccount_id) in the _cm_getInitialData() method in the class file.

function _cm_getInitialData ($fieldarray)
{
// get next available number for user_seq_no for user HTM
$where = "user_id='HTM'";
$query = "SELECT max(user_seq_no) FROM $this->tablename WHERE $where";
$count = $this->getCount($query);
$fieldarray['user_id'] = 'HTM';
$fieldarray['user_seq_no'] = $count + 1;
$fieldarray['rdcaccount_id'] = '1';

return $fieldarray;

} // _cm_getInitialData

But when pressing the New button I get the following error message: [rdcaccount_id] User's account (4) is not compatible with record's account (1)
When commenting out $fieldarray['rdcaccount_id'] the add1 task works fine with the next available user_seq_no for user HTM but with rdcaccount=(4).

So is there a possibility to realize that?
Re: add1 in shared account [message #5349 is a reply to message #5347] Thu, 28 January 2016 08:56 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2244
Registered: April 2006
Location: Surrey, UK
Senior Member
Anyone who is logged in with an rdcaccount_id which is greater than 1 can only add records with their rdcaccount_id. Only someone who is logged in with an rdcaccount_id of 1 (or null) can add records to the shared account. You therefore need to have a separate user_id set up who can add records to the shared account.

Re: add1 in shared account [message #5352 is a reply to message #5349] Fri, 29 January 2016 04:38 Go to previous message
htManager is currently offline  htManager
Messages: 316
Registered: May 2014
Senior Member
Thank you for the confirmation.
Previous Topic: Del1 - no table name in query
Next Topic: PopUp - Selection criteria
Goto Forum:
  


Current Time: Wed May 12 16:58:04 EDT 2021

Total time taken to generate the page: 0.01271 seconds