Question

I am very new to jbilling and i am trying to create new custom fields under Add Customer and in Add Product page.

I need Blood Group in Add Customer and Expiry Date in Add Products.

So how can i add these custom fields?
Do i need to add it using code or is there some other way of doing it.

Also if i create these fields do the SOAP inter face for these fields gets created also? To access it from Jbilling Client API.

Was it helpful?

Solution

You can add custom fields on the fly in JBilling. No programming required.

Please confirm your jBilling version. If it is 3.1 or higher, you will see a 'Meta Fields' link under 'Configuration' main menu in the jBilling GUI. On the Meta Fields configuration page, you may select an Entity first (CUSTOMER, PRODUCT in your case) and add/edit meta fields. You can also configure Data Types, default values, mandatory flag as well.

OTHER TIPS

U can also use api for creating meta fields. jbilling provide apis for creating meta fields

api.createMetaField(MetaFieldWS metafieldWs)

you can find above method in WebServicesSessionSpringBean.java

public Integer createMetaField(MetaFieldWS metafieldWs)

public static void main(String arg[]){
    createMetaField()
}
public static void createMetaField() {

        try {

            JbillingAPI api = JbillingAPIFactory.getAPI();

            MetaFieldWS metafield = new MetaFieldWS();
            metafield.setEntityType(EntityType.CUSTOMER);
            metafield.setName("BloodGroup");
            metafield.setDataType(DataType.STRING);
            metafield.setPrimary(true);
            metafield.setMandatory(false);          
            metafield.setEntityId(api.getCompany().getId());

            Integer result = api.createMetaField(metafield);
            System.out.println("Metafield Created field ID:" + result);
        } catch (JbillingAPIException e) {          
            e.printStackTrace();
        } catch (IOException e) {           
            e.printStackTrace();
        }

    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top