Jump to content

Provisioning module with required fields?


Recommended Posts

I'm trying to create a provisioning module that will be automatically run when activating an order.

 

My issue is that even thou I return a non-successful response from the CreateAccount function, activation takes place and there's no error message shown for the admin. I've tested exiting in the function, just to see that it is called, and it is. When I use the module-button "Create", I do get the error message shown.

 

How can I make a provisioning module that:

 

a) Show some fields when admin adds the order?

b) Validates these fields and shows admin an error message when saving unless validation passes?

c) Blocks activation if the CreateAccount function returns and error?

 

Am I barking up the wrong tree here? Is this not doable?

 

/Magnus

Link to comment
Share on other sites

Hello freddybear,

 

You mention in your post that you did get an error message, can you relay the error message in the thread.

 

Also, if you are having an issue creating a module you may want to check out Modules Garden and see if one already exists or you can have them make it for you for a fee. You can find more information here - http://www.modulesgarden.com/.

 

--Thanks

Link to comment
Share on other sites

Hi Ryan,

 

You misunderstand. The error I'm talking about is the error I choose to return from my CreateAccount function. It should be shown. The issue is that it isn't when the function is called automatically, as when set to provision on activating an order.

 

Please, re-read my post. I thought the questions are very specific and to the point, but I'll rephrase:

 

a) When an admin adds an order, can a provisioning module inject its fields in this form?

 

b) When an admin edits an order, and the AdminServicesTabFieldsSave function is called, even thou I return an error message, WHMCS shows "Changes Saved Successfully!". How can I prevent that and actually show the error?

 

c) This one I was actually wrong about, I do see the error message if I try to activate the order without first filling out the correct fields. Issue (a) means I need to edit the order first thou.

 

Thanks,

Magnus

Link to comment
Share on other sites

c) This one I was actually wrong about, I do see the error message if I try to activate the order without first filling out the correct fields. Issue (a) means I need to edit the order first thou.

 

I tested some more with this, and it's not consistent.

 

If I'm logged into the admin GUI, and I go to "Manage Orders" on a pending order (/admin/orders.php), and I press the button "Accept Order", this triggers the CreateAccount function, and if I return an error message, the order is not activated, and the error message is shown. Great, works as expected.

 

If I instead go on Products/Services (/admin/clientservices.php), and I select "Status: Active" and press button "Save Changes", the following happens:

 

* CreateAccount is NOT called

* AdminServicesTabFieldsSave is called, but returning an error message does nothing

* "Changes Saved Successfully!" is shown, even thou the module fields were not saved

* Status is set to Active

 

So at this stage I have successfully activated the order/service without provisioning the service.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated