Jump to content

Custom Provisioning modules, custom fields.


Recommended Posts

Hi,

 

I've been trying to figure out how to create a custom provisioning module and have a couple of questions.

http://docs.whmcs.com/Provisioning_Module_Developer_Docs

 

I download the example from here: https://github.com/WHMCS/sample-provisioning-module/blob/master/modules/servers/provisioningmodule/provisioningmodule.php#L86

 

And works great as a demo. My first question though is how to package a module. I see the structure in the github but I have to add custom fields to my provisioning module... how do you package those within the structure?

 

Is it expected to have a Readme and hand hold the user into creating those custom fields through the interface?

 

Is it expected to manually create them with SQL on the fly within the provisioning module? I so I did not notice in the example on github. I did see the "mod_customtable" table within the docs.whmcs.com which does not seem to be created by default (mine does not have it). And its not what I need since they are custom fields they already appear in the admin interface.

 

 

My second question is how to interact with them. I noticed that we receive an argument $params in the functions within the provisioning modules and the custom fields are in there, which is great. But when if I need to update them right after the account as been created? for the SSO and retrieving of client's account details...

 

Is it expected to manually craft SQL to update the value ourselves? If so I want to extend a big thanks to whomever decided to name ALL FOREIGN keys "relid" so we have no idea what they are in tables... Another weird thanks to whomever decided to prefix all tables with "tbl"... But I digress.

 

tblcustomfields.relid=tblproducts.id

tblcustomfieldvalues.relid=??? (closest I could find is: tblinvoiceitems.relid)

 

Anyone can confirm this?

 

 

Maybe i'm trying to put information where it does not belong. After the account is created at a third party service it usually returns data specific to the account, to access it again. Am I wrong to think that those goes into Custom Fields?

 

Thanks for your time.

Link to comment
Share on other sites

About the `tblcustomfieldvalues`.relid I found my answer in this comment: https://forum.whmcs.com/showthread.php?18020-Sorting-on-user-defined-quot-Status-quot-field-but-for-ALL-products-SQL-query-needed&p=93641#post93641

 

so tblcustomfieldvalues.relid=`tblhosting`.id

 

Would be nice to get some insight on the rest of the questions...

 

Thanks.

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