[SOLVED] Auto Action Question

10 years 1 month ago #243611 by rmwalker
Replied by rmwalker on topic Auto Action Question
Ok. I've spent most of the day trying various combinations of syntax and values to try to make this work with no luck. I've attached the code that's included in my AutoAction code block. I've got an include for a custom PHP library and I know the functions that I'm using work outside of CB. I'm not sure if I have a problem with my getField() syntax or if something else needs to be added to call the external functions. On top of that, everytime it tries to run it changes my user password in CB. A little help would be greatly appreciated.

File Attachment:

File Name: Gen_CRM_Creds.txt
File Size:1 KB
Attachments:

Please Log in to join the conversation.

10 years 1 month ago #243636 by krileon
Replied by krileon on topic Auto Action Question
You don't need PHP at all. All substitutions are available within your code. Please see the below substitution tutorial for substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

Substitutions like [name], [username], etc.. are all functional.

The getFields usage you're using is not valid. If you want to use getFields then please be sure to review the below tutorial carefully.

www.joomlapolis.com/support/tutorials/120-api-usage/18361-obtaining-field-values-through-getfields-api

Please provide a screenshot of your auto action configuration as it not working could have nothing to do with the substitutions but a conditional, access incorrectly set, or the user set incorrectly.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

10 years 1 month ago #243650 by rmwalker
Replied by rmwalker on topic Auto Action Question
So in my situation when I'm using the autoaction trigger 'onAfterUserApproval' the following fields are available for substitution without using getfields:

[username]
[firstname]
[lastname]
[email]

Please Log in to join the conversation.

10 years 1 month ago - 10 years 1 month ago #243667 by rmwalker
Replied by rmwalker on topic Auto Action Question
Here's what I just tried in my Auto Actions PHP code block. I'm using substitutions as you mentioned in your last post. The code follows and the error it generated is included as well. Any suggestions would be appreciated.
Function Gen_CRM_Creds()
	{
	// Include Backend library	
	include '/hermes/bosoraweb077/b945/ipg.usjbcom/usjbcom/butler/include/Butler.php';
	$RandPass = Vt_Rand_Str(10);
	$New_User_Id = VtInsert($newuser = [username],$newpass = $RandPass,$newemail = [email], $newfirstname = [firstname], $newlastname = [lastname]	);
	}

Parse error: syntax error, unexpected '@' in .../com_comprofiler/plugin/user/plug_cbautoactions/models/code.php(59) : runtime-created function on line 6 Fatal error: Function name must be a string in .../com_comprofiler/plugin/user/plug_cbautoactions/models/code.php on line 60

Please Log in to join the conversation.

10 years 1 month ago - 10 years 1 month ago #243668 by rmwalker
Replied by rmwalker on topic Auto Action Question
Followup: I put single quotes around the email substitution so that the offending line looked like this:
$newemail = '[email]'

While that got rid of the error, I still don't get a new user in the backend system. Shouldn't Auto Action be able to execute code like this?

Please Log in to join the conversation.

10 years 1 month ago #243671 by rmwalker
Replied by rmwalker on topic Auto Action Question
Let me continue the topic this way. I'm setting up CBSubs and want to create subscription based user accounts in Vtiger. I've been trying to do this through AutoAction with little success, but I'm curious if there is a better way. Is there a better way to user accounts in Vtiger when CBSubs is being used? Has anybody done this before?

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.196 seconds

Facebook Twitter LinkedIn