API Create Account

Hi @emre

This is a very hard issue to pin point - basically 2 times out of 20 tests the API to create an Entity Account has failed to LINK the Account back to the Entity?

The ACCOUNT is Created OK it just does not write back to the Entity Record:

The Script is very simple:

function Check(fPrimary, aName, eType, eCode) {

	// api.Entity(01234B).Exists()
	
	if (!api.Entity(fPrimary+eCode).Exists()) {
	
		api.Entity(fPrimary+eCode).Create(eType); 
		api.Entity(fPrimary+eCode).Data("Full Name").Update(aName.substring(aName.indexOf("-")+1));
		//dlg.ShowMessage("Exit A - Added Entity:"+fPrimary+eCode+' '+aName.substring(aName.indexOf("-")+1));
   	}
   	
  	if (!api.Account(aName).Exists()) {
  	
       api.Entity(fPrimary+eCode).CreateAccount(aName) ;
	   //dlg.ShowMessage("Exit B - Added Account:"+aName+' for '+fPrimary+eCode);
	}
	
   	//dlg.ShowMessage("Exit 1 - Entity OK:"+fPrimary+eCode);
	return 1;
}

Since the ACCOUNT is created, and there is no intervention by custom automation I can only assume the issue is internal? This code will go LIVE on Tuesday so will have better understanding of Live failure rate in about 7-14 days time I guess.

Your comments welcome.

EDIT:
Below shows what is passed to the above script from the Custom Search Grid shown in the Multiple Account GIF:

Customer Account=ZUCU_Wallets:EntityID={ENTITY NAME}-{ENTITY DATA:Full Name},EntitySearch={ENTITY NAME},EntityType=Customers,EntityCode=
House Wallet=ZUCU_Wallets:EntityID={ENTITY NAME}B-{ENTITY DATA:Full Name},EntitySearch={ENTITY NAME},EntityType=Bar Wallets,EntityCode=B
Member Wallet=ZUCU_Wallets:EntityID={ENTITY NAME}M-{ENTITY DATA:Full Name},EntitySearch={ENTITY NAME},EntityType=Member Wallets,EntityCode=M
Prize Wallet=ZUCU_Wallets:EntityID={ENTITY NAME}P-{ENTITY DATA:Full Name},EntitySearch={ENTITY NAME},EntityType=Prize Wallets,EntityCode=P

Note:
Last parameter ‘eCode’ would have been BLANK which is correct for Master Entity (Customer).

Not the question but just out of intester, how do you push updates? Do you remoted desktop toconnect to each database and change the setting of each one, or do you use like sql script for changes?

Yes that is a whole new topic…
Currently RDP and Exporting / Importing Scripts, Screens, Rules etc.- individually.

Eventually would like to use Configuration Tasks and a GITHUB repository but that’s another thing to learn.

Really hard to guess. Having a non null Notes value makes me think something else may updates Entity and makes AccountId 0.

Oh Yes sorry I EDITED that back to 0 just to show what it would look like, as that was one of the Customer Records. I manually changed the Account under Editing Entity in Management back to blank as I had corrected it there previously.